[arch] tighten up linker scripts to make sure the section sentinels cover just what they need

This commit is contained in:
Travis Geiselbrecht
2015-11-06 15:53:28 -08:00
parent 7c1b8a0b66
commit 121d0b603b
8 changed files with 101 additions and 25 deletions

View File

@@ -57,8 +57,16 @@ SECTIONS
*(.rodata .rodata.* .gnu.linkonce.r.*)
}
.data : ALIGN(4) {
/*
* extra linker scripts tend to insert sections just after .rodata,
* so we want to make sure this symbol comes after anything inserted above,
* but not aligned to the next section necessarily.
*/
.dummy_post_rodata : {
__rodata_end = .;
}
.data : ALIGN(4) {
/* writable data */
__data_start_rom = .;
/* in one segment binaries, the rom data address is on top of the ram data address */
@@ -79,10 +87,17 @@ SECTIONS
.got : { *(.got.plt) *(.got) }
.dynamic : { *(.dynamic) }
/*
* extra linker scripts tend to insert sections just after .data,
* so we want to make sure this symbol comes after anything inserted above,
* but not aligned to the next section necessarily.
*/
.dummy_post_data : {
__data_end = .;
}
/* unintialized data (in same segment as writable data) */
.bss : ALIGN(4) {
__data_end = .;
KEEP(*(.bss.prebss.*))
. = ALIGN(4);
__bss_start = .;