INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+
+CTOR=".ctors ${CONSTRUCTING-0} :
+ {
+ ${CONSTRUCTING+${CTOR_START}}
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+
+ KEEP (*crtbegin.o(.ctors))
+
+ /* We don't want to include the .ctor section from
+ from the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ ${CONSTRUCTING+${CTOR_END}}
+ }"
+
+DTOR=" .dtors ${CONSTRUCTING-0} :
+ {
+ ${CONSTRUCTING+${DTOR_START}}
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ ${CONSTRUCTING+${DTOR_END}}
+ }"
+
+
# if this is for an embedded system, don't add SIZEOF_HEADERS.
if [ -z "$EMBEDDED" ]; then
test -z "${READONLY_BASE_ADDRESS}" && READONLY_BASE_ADDRESS="${READONLY_START_ADDR} + SIZEOF_HEADERS"
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data)
+ *(.data.*)
*(.gnu.linkonce.d*)
${CONSTRUCTING+CONSTRUCTORS}
}
.data1 ${RELOCATING-0} : { *(.data1) }
${RELOCATING+${OTHER_READWRITE_SECTIONS}}
- .ctors ${RELOCATING-0} :
- {
- ${CONSTRUCTING+${CTOR_START}}
- *(SORT(.ctors.*))
- *(.ctors)
- ${CONSTRUCTING+${CTOR_END}}
- }
- .dtors ${RELOCATING-0} :
- {
- ${CONSTRUCTING+${DTOR_START}}
- *(SORT(.dtors.*))
- *(.dtors)
- ${CONSTRUCTING+${DTOR_END}}
- }
+ ${RELOCATING+${CTOR}}
+ ${RELOCATING+${DTOR}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) }
.dynamic ${RELOCATING-0} : { *(.dynamic) }
${DATA_PLT+${PLT}}
.text ${RELOCATING+${TEXT_START_ADDR}} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
- *(.init)
- *(.fini)
+ KEEP (*(.init))
+ KEEP (*(.fini))
*(.text)
+ *(.text.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)