2013-07-23 16:23:22 -05:00
|
|
|
#[cfg(not(target_os = "macos"))]
|
|
|
|
#[link_section=".moretext"]
|
|
|
|
fn i_live_in_more_text() -> &'static str {
|
|
|
|
"knock knock"
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(target_os = "macos"))]
|
|
|
|
#[link_section=".imm"]
|
|
|
|
static magic: uint = 42;
|
|
|
|
|
|
|
|
#[cfg(not(target_os = "macos"))]
|
|
|
|
#[link_section=".mut"]
|
|
|
|
static mut frobulator: uint = 0xdeadbeef;
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
#[link_section="__TEXT,__moretext"]
|
|
|
|
fn i_live_in_more_text() -> &'static str {
|
|
|
|
"knock knock"
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
#[link_section="__RODATA,__imm"]
|
|
|
|
static magic: uint = 42;
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
#[link_section="__DATA,__mut"]
|
|
|
|
static mut frobulator: uint = 0xdeadbeef;
|
|
|
|
|
2013-09-25 02:43:37 -05:00
|
|
|
pub fn main() {
|
2013-07-23 16:23:22 -05:00
|
|
|
unsafe {
|
|
|
|
frobulator = 0xcafebabe;
|
|
|
|
printfln!("%? %? %?", i_live_in_more_text(), magic, frobulator);
|
|
|
|
}
|
|
|
|
}
|