diff options
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r-- | ld/scripttempl/elf.sc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 3de86b0..139773d 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -245,6 +245,12 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} }" +PREINIT_ARRAY=".preinit_array ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}} + KEEP (*(.preinit_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}} + }" if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))" SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))" @@ -568,12 +574,7 @@ cat <<EOF .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } - .preinit_array ${RELOCATING-0} : - { - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}} - KEEP (*(.preinit_array)) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}} - } + ${RELOCATING+${PREINIT_ARRAY}} ${RELOCATING+${INIT_ARRAY}} ${RELOCATING+${FINI_ARRAY}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} |