]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7958 : kemurphy/rust/link-section, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 24 Jul 2013 03:04:53 +0000 (20:04 -0700)
committerbors <bors@rust-lang.org>
Wed, 24 Jul 2013 03:04:53 +0000 (20:04 -0700)
This allows for control over the section placement of static, static
mut, and fn items.  One caveat is that if a static and a static mut are
placed in the same section, the static is declared first, and the static
mut is assigned to, the generated program crashes.  For example:

#[link_section=".boot"]
static foo : uint = 0xdeadbeef;

#[link_section=".boot"]
static mut bar : uint = 0xcafebabe;

Declaring bar first would mark .bootdata as writable, preventing the
crash when bar is written to.

1  2 
src/librustc/middle/trans/base.rs

Simple merge