summaryrefslogtreecommitdiff
path: root/ld/scripttempl/elf32msp430.sc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-10-26 10:01:54 +1030
committerAlan Modra <amodra@gmail.com>2018-10-29 17:50:40 +1030
commitc2e863866d9b206c387d8fdc0f1bfa9f246e4355 (patch)
tree3cfe45d7951f388c4e79029abd7b767206f567b7 /ld/scripttempl/elf32msp430.sc
parent98a17ece013cb94cd602496b9efb92b8816b3953 (diff)
downloadbinutils-gdb-c2e863866d9b206c387d8fdc0f1bfa9f246e4355.tar.gz
ld -r script fixes
For ld -r, we generally set the VMA of sections to zero. This is done to make the output of ld -r most similar to that output by the assembler, which generally has sections starting at VMA zero. In some cases that covers for backend bugs which would mis-handle relocatable object files with non-zero section VMAs. This patch fixes a few sections that didn't have zero VMAs for ld -r. A missing zero on .note.gnu.build-id and .eh_frame_hdr doesn't matter much since these are linker generated symbols only output on final link, but it's good to be consistent. * Makefile.am (ei386beos.c, ei386go32.c): Correct dependencies. * Makefile.in: Regenerate. * scripttempl/elf.sc (.note.gnu.build-id, .eh_frame_hdr): Set address with ${RELOCATING-0}. * scripttempl/arclinux.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/pru.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise, and for other sections. * scripttempl/epiphany_4x4.sc: Similarly.
Diffstat (limited to 'ld/scripttempl/elf32msp430.sc')
-rw-r--r--ld/scripttempl/elf32msp430.sc12
1 files changed, 6 insertions, 6 deletions
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index b35f0ef012d..21dd1f8923c 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -137,7 +137,7 @@ SECTIONS
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
/* Internal text space. */
- .text :
+ .text ${RELOCATING-0} :
{
${RELOCATING+. = ALIGN(2);
*(SORT_NONE(.init))
@@ -187,7 +187,7 @@ SECTIONS
_etext = .;}
} ${RELOCATING+ > text}
- .rodata :
+ .rodata ${RELOCATING-0} :
{
${RELOCATING+. = ALIGN(2);
*(.lower.rodata.* .lower.rodata)
@@ -239,7 +239,7 @@ SECTIONS
KEEP (*(.dtors))}
} ${RELOCATING+ > text}
- .vectors ${RELOCATING-0}:
+ .vectors ${RELOCATING-0} :
{
${RELOCATING+ PROVIDE (__vectors_start = .) ; }
*(.vectors${RELOCATING+*})
@@ -277,7 +277,7 @@ SECTIONS
${RELOCATING+__romdatastart = LOADADDR(.data);
__romdatacopysize = SIZEOF(.data);}
- .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
+ .bss ${RELOCATING-0}${RELOCATING+SIZEOF(.data) + ADDR(.data)} :
{
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__bss_start = .); }
@@ -291,14 +291,14 @@ SECTIONS
} ${RELOCATING+ > data}
${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); }
- .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
+ .noinit ${RELOCATING-0}${RELOCATING+SIZEOF(.bss) + ADDR(.bss)} :
{
${RELOCATING+ PROVIDE (__noinit_start = .) ; }
*(.noinit)
${RELOCATING+ PROVIDE (__noinit_end = .) ; }
} ${RELOCATING+ > data}
- .persistent ${RELOCATING+ SIZEOF(.noinit) + ADDR(.noinit)} :
+ .persistent ${RELOCATING-0}${RELOCATING+SIZEOF(.noinit) + ADDR(.noinit)} :
{
${RELOCATING+ PROVIDE (__persistent_start = .) ; }
*(.persistent)