summaryrefslogtreecommitdiff
path: root/ld/scripttempl/elf.sc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-03-02 01:25:26 +0000
committerRichard Henderson <rth@redhat.com>2002-03-02 01:25:26 +0000
commit47bd9f0b861ae6a2e41894058f2f0f111ce8a54c (patch)
treebeeeff526acc0aec56091ca4d0f1998826de819f /ld/scripttempl/elf.sc
parent557c5bf8e95ede79ceb874a09d55821f465165dc (diff)
downloadbinutils-redhat-47bd9f0b861ae6a2e41894058f2f0f111ce8a54c.tar.gz
* scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
.init_array, and .fini_array.
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r--ld/scripttempl/elf.sc17
1 files changed, 17 insertions, 0 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index be6fc09b52..bf67811777 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -246,6 +246,23 @@ cat <<EOF
${RELOCATING+${INIT_END}}
} =${NOP-0}
+ /* Ensure the __preinit_array_start label is properly aligned. We
+ could instead move the label definition inside the section, but
+ the linker would then create the section even if it turns out to
+ be empty, which isn't pretty. */
+ ${RELOCATING+. = ALIGN(${ALIGNMENT})}
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
+ .preinit_array ${RELOCATING-0} : { *(.preinit_array) }
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .)}};
+ .init_array ${RELOCATING-0} : { *(.init_array) }
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
+ .fini_array ${RELOCATING-0} : { *(.fini_array) }
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+
${DATA_PLT-${BSS_PLT-${PLT}}}
.text ${RELOCATING-0} :
{