diff options
author | Alan Modra <amodra@gmail.com> | 2018-10-26 10:01:54 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-10-29 17:50:40 +1030 |
commit | c2e863866d9b206c387d8fdc0f1bfa9f246e4355 (patch) | |
tree | 3cfe45d7951f388c4e79029abd7b767206f567b7 /ld/scripttempl/epiphany_4x4.sc | |
parent | 98a17ece013cb94cd602496b9efb92b8816b3953 (diff) | |
download | gdb-c2e863866d9b206c387d8fdc0f1bfa9f246e4355.zip gdb-c2e863866d9b206c387d8fdc0f1bfa9f246e4355.tar.gz gdb-c2e863866d9b206c387d8fdc0f1bfa9f246e4355.tar.bz2 |
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/epiphany_4x4.sc')
-rw-r--r-- | ld/scripttempl/epiphany_4x4.sc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ld/scripttempl/epiphany_4x4.sc b/ld/scripttempl/epiphany_4x4.sc index 41b2b50..18253bb 100644 --- a/ld/scripttempl/epiphany_4x4.sc +++ b/ld/scripttempl/epiphany_4x4.sc @@ -375,7 +375,7 @@ cat <<EOF ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} ${INITIAL_READONLY_SECTIONS} - .note.gnu.build-id : { *(.note.gnu.build-id) } + .note.gnu.build-id ${RELOCATING-0}: { *(.note.gnu.build-id) } EOF test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN @@ -469,7 +469,7 @@ fi cat <<EOF - .init ${RELOCATING+__init_start} : + .init ${RELOCATING-0}${RELOCATING+__init_start} : { ${RELOCATING+${INIT_START}} KEEP (*(.init)) @@ -479,14 +479,14 @@ cat <<EOF ${TEXT_PLT+${PLT}} ${TINY_READONLY_SECTION} - .fini ${RELOCATING+ADDR(.init)+SIZEOF(.init)} ${RELOCATING-0} : + .fini ${RELOCATING-0}${RELOCATING+ADDR(.init)+SIZEOF(.init)} : { ${RELOCATING+${FINI_START}} KEEP (*(.fini)) ${RELOCATING+${FINI_END}} } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0} - .text ${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} ${RELOCATING-0} : + .text ${RELOCATING-0}${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} : { ${RELOCATING+${TEXT_START_SYMBOLS}} *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) @@ -503,7 +503,7 @@ cat <<EOF ${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SBSS2}} ${OTHER_READONLY_SECTIONS} - .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame_hdr ${RELOCATING-0} : { *(.eh_frame_hdr) } .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) } @@ -557,7 +557,7 @@ cat <<EOF ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} - .data ${RELOCATING+ADDR(.dtors)+SIZEOF(.dtors)} ${RELOCATING-0} : + .data ${RELOCATING-0}${RELOCATING+ADDR(.dtors)+SIZEOF(.dtors)} : { ${RELOCATING+${DATA_START_SYMBOLS}} *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) @@ -583,7 +583,7 @@ cat <<EOF ${RELOCATING+${OTHER_BSS_SYMBOLS}} ${SBSS} ${BSS_PLT+${PLT}} - .bss ${RELOCATING+ADDR(.rodata)+SIZEOF(.rodata)} ${RELOCATING-0} : + .bss ${RELOCATING-0}${RELOCATING+ADDR(.rodata)+SIZEOF(.rodata)} : { ${RELOCATING+*(.dynbss)} *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) @@ -606,7 +606,7 @@ cat <<EOF ${RELOCATING+${DATA_SEGMENT_END}} ${RELOCATING+PROVIDE ( __stack_start_ = ORIGIN(EXTERNAL_DRAM_0) + __PROG_SIZE_FOR_CORE__ * __CORE_NUM_ + __PROG_SIZE_FOR_CORE__ - 0x10) ;} - .stack ${RELOCATING+__stack_start_} : { ${RELOCATING+___stack = .;} *(.stack) } + .stack ${RELOCATING-0}${RELOCATING+__stack_start_} : { ${RELOCATING+___stack = .;} *(.stack) } ${RELOCATING+PROVIDE ( ___heap_start = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ );} ${RELOCATING+PROVIDE ( ___heap_end = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ + __HEAP_SIZE_FOR_CORE__ - 4 );} |