From aacef15b557877dc03827e4d0bcbbd9dd394ceb2 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Sat, 27 Feb 2010 12:34:24 +0000 Subject: * 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. --- ld/scripttempl/elfxtensa.sc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'ld/scripttempl/elfxtensa.sc') diff --git a/ld/scripttempl/elfxtensa.sc b/ld/scripttempl/elfxtensa.sc index 22fde0c777..53cec7153a 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 <