2002-03-04 H.J. Lu <hjl@gnu.org>

* scripttempl/elf.sc: Put .preinit_array, .init_array and
	.fini_array in the data segment.
This commit is contained in:
H.J. Lu 2002-03-04 20:40:14 +00:00
parent 937f164bda
commit b5090659de
2 changed files with 22 additions and 17 deletions

View file

@ -1,3 +1,8 @@
2002-03-04 H.J. Lu <hjl@gnu.org>
* scripttempl/elf.sc: Put .preinit_array, .init_array and
.fini_array in the data segment.
2002-03-04 Alan Modra <amodra@bigpond.net.au>
* scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit.

View file

@ -246,23 +246,6 @@ 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} :
{
@ -293,6 +276,23 @@ cat <<EOF
${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* 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 ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}