Commit 64ff30a
committed
Add link_section attribute for static and fn items
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 parent 74f4bad commit 64ff30a
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2456 | 2456 | | |
2457 | 2457 | | |
2458 | 2458 | | |
2459 | | - | |
| 2459 | + | |
2460 | 2460 | | |
2461 | 2461 | | |
2462 | 2462 | | |
| |||
2488 | 2488 | | |
2489 | 2489 | | |
2490 | 2490 | | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
2491 | 2499 | | |
| 2500 | + | |
2492 | 2501 | | |
2493 | 2502 | | |
2494 | 2503 | | |
| |||
0 commit comments