From 3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Sat, 27 Feb 2010 12:34:25 +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/armbpabi.sc | 38 ++++++++++++++++++++------------------ ld/scripttempl/elf.sc | 30 ++++++++++++++++-------------- ld/scripttempl/elf32sh-symbian.sc | 30 ++++++++++++++++-------------- ld/scripttempl/elf64hppa.sc | 30 ++++++++++++++++-------------- ld/scripttempl/elfxtensa.sc | 30 ++++++++++++++++-------------- 5 files changed, 84 insertions(+), 74 deletions(-) (limited to 'ld/scripttempl') diff --git a/ld/scripttempl/armbpabi.sc b/ld/scripttempl/armbpabi.sc index 556ff1e..8b3ea0a 100644 --- a/ld/scripttempl/armbpabi.sc +++ b/ld/scripttempl/armbpabi.sc @@ -64,6 +64,24 @@ else NO_SMALL_DATA=" " fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " +INIT_ARRAY=".init_array ${RELOCATING-0} : + { + /* SymbianOS uses this symbol. */ + ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);} + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}} + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}} + /* SymbianOS uses this symbol. */ + ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);} + }" +FINI_ARRAY=".fini_array ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}} + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}} + }" CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} @@ -218,24 +236,8 @@ cat <