diff options
author | Alan Modra <amodra@gmail.com> | 2023-07-07 14:32:00 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-07-12 09:31:40 +0930 |
commit | dbe6d432d1f48fe77200cf4baff06d9f8d7debd7 (patch) | |
tree | 9c8697944085755ad53bf050bbbe9fc836b00098 /ld | |
parent | 9596ca8194b0b829f7392f5da773026b7aa293fd (diff) | |
download | gdb-dbe6d432d1f48fe77200cf4baff06d9f8d7debd7.zip gdb-dbe6d432d1f48fe77200cf4baff06d9f8d7debd7.tar.gz gdb-dbe6d432d1f48fe77200cf4baff06d9f8d7debd7.tar.bz2 |
.noinit and .persistent alignment
It's more elegant to make the section match up with its "_start"
symbol. We could align by setting the address of the section (by
using ALIGN before the colon), but this way we also set sh_addralign
to at least $ALIGNMENT.
* scripttempl/elf.sc (.noinit, .persistent): Align the output
section rather than using ". = ALIGN();" at the beginning.
Set address to zero when not a final link.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/scripttempl/elf.sc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index bfd8b5e..82de4ed 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -342,9 +342,8 @@ STACK=".stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : test "${HAVE_NOINIT}" = "yes" && NOINIT=" /* This section contains data that is not initialized during load, or during the application's initialization sequence. */ - .noinit (NOLOAD) : + .noinit ${RELOCATING-0} (NOLOAD) : ${RELOCATING+ALIGN(${ALIGNMENT})} { - ${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+PROVIDE (__noinit_start = .);} *(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*}) ${RELOCATING+. = ALIGN(${ALIGNMENT});} @@ -353,9 +352,8 @@ test "${HAVE_NOINIT}" = "yes" && NOINIT=" test "${HAVE_PERSISTENT}" = "yes" && PERSISTENT=" /* This section contains data that is initialized during load, but not during the application's initialization sequence. */ - .persistent : + .persistent ${RELOCATING-0} : ${RELOCATING+ALIGN(${ALIGNMENT})} { - ${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+PROVIDE (__persistent_start = .);} *(.persistent${RELOCATING+ .persistent.* .gnu.linkonce.p.*}) ${RELOCATING+. = ALIGN(${ALIGNMENT});} |