diff options
author | Jie Zhang <jie.zhang@analog.com> | 2010-02-27 12:34:25 +0000 |
---|---|---|
committer | Jie Zhang <jie.zhang@analog.com> | 2010-02-27 12:34:25 +0000 |
commit | 3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db (patch) | |
tree | 9fa0a8f6e1ec56367ae6b180392f4d69520074c8 /ld/scripttempl/elfxtensa.sc | |
parent | eb1956643ddbb298d1005c939d3b9fce04980a4a (diff) | |
download | gdb-3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db.zip gdb-3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db.tar.gz gdb-3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db.tar.bz2 |
* scripttempl/armbpabi.sc: Don't combine .init_array.* or
.fini_array.* when do relocatable linking.
* scripttempl/elf.sc: Likewise.
* scripttempl/elf32sh-symbian.sc: Likewise.
* scripttempl/elf64hppa.sc: Likewise.
* scripttempl/elfxtensa.sc: Likewise.
testsuite/
* ld-elf/init-fini-arrays.s: New test.
* ld-elf/init-fini-arrays.d: New test.
Diffstat (limited to 'ld/scripttempl/elfxtensa.sc')
-rw-r--r-- | ld/scripttempl/elfxtensa.sc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/ld/scripttempl/elfxtensa.sc b/ld/scripttempl/elfxtensa.sc index 22fde0c..53cec71 100644 --- a/ld/scripttempl/elfxtensa.sc +++ b/ld/scripttempl/elfxtensa.sc @@ -217,6 +217,20 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} }" +INIT_ARRAY=".init_array ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}} + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}} + }" +FINI_ARRAY=".fini_array ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}} + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}} + }" CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} @@ -438,20 +452,8 @@ cat <<EOF KEEP (*(.preinit_array)) ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}} } - .init_array ${RELOCATING-0} : - { - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}} - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array)) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}} - } - .fini_array ${RELOCATING-0} : - { - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}} - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array)) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}} - } + ${RELOCATING+${INIT_ARRAY}} + ${RELOCATING+${FINI_ARRAY}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}} .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } |