* scripttempl/elf32cr16.sc: Emit empty script for ld -r and ld -Ur.

* scripttempl/elf32cr16c.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/tic54xcoff.sc: Likewise.
	* scripttempl/aix.sc: Delete ${RELOCATING-0}.
	* scripttempl/avr.sc: Likewise.
	* scripttempl/elf32msp430.sc: Likewise.
	* scripttempl/elf32msp430_3.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf_chaos.sc: Likewise.
	* scripttempl/elfi370.sc: Likewise.
	* scripttempl/nw.sc: Likewise.
	* scripttempl/psos.sc: Likewise.
	* scripttempl/armbpabi.sc: Delete ${RELOCATING-0} and ${CONSTRUCTING-0}.
	* scripttempl/elf.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elfd10v.sc: Likewise.
	* scripttempl/elfd30v.sc: Likewise.
	* scripttempl/elfm68hc11.sc: Likewise.
	* scripttempl/elfm68hc12.sc: Likewise.
	* scripttempl/elfmicroblaze.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/iq2000.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/xstormy16.sc: Likewise.
This commit is contained in:
Alan Modra 2009-09-28 07:08:50 +00:00
parent 9188c27260
commit df381c72f4
26 changed files with 949 additions and 961 deletions

View File

@ -1,3 +1,30 @@
2009-09-28 Alan Modra <amodra@bigpond.net.au>
* scripttempl/elf32cr16.sc: Emit empty script for ld -r and ld -Ur.
* scripttempl/elf32cr16c.sc: Likewise.
* scripttempl/elf32crx.sc: Likewise.
* scripttempl/aix.sc: Delete ${RELOCATING-0}.
* scripttempl/avr.sc: Likewise.
* scripttempl/elf32msp430.sc: Likewise.
* scripttempl/elf32msp430_3.sc: Likewise.
* scripttempl/elf32sh-symbian.sc: Likewise.
* scripttempl/elf_chaos.sc: Likewise.
* scripttempl/elfi370.sc: Likewise.
* scripttempl/nw.sc: Likewise.
* scripttempl/psos.sc: Likewise.
* scripttempl/armbpabi.sc: Delete ${RELOCATING-0} and ${CONSTRUCTING-0}.
* scripttempl/elf.sc: Likewise.
* scripttempl/elf64hppa.sc: Likewise.
* scripttempl/elfd10v.sc: Likewise.
* scripttempl/elfd30v.sc: Likewise.
* scripttempl/elfm68hc11.sc: Likewise.
* scripttempl/elfm68hc12.sc: Likewise.
* scripttempl/elfmicroblaze.sc: Likewise.
* scripttempl/elfxtensa.sc: Likewise.
* scripttempl/iq2000.sc: Likewise.
* scripttempl/mep.sc: Likewise.
* scripttempl/xstormy16.sc: Likewise.
2009-09-27 Christopher Faylor <me+cygwin@cgf.cx> 2009-09-27 Christopher Faylor <me+cygwin@cgf.cx>
* ldlang.c (lang_size_sections_1): Always force output vma to zero for * ldlang.c (lang_size_sections_1): Always force output vma to zero for

View File

@ -12,7 +12,7 @@ SECTIONS
.pad 0 : { *(.pad) } .pad 0 : { *(.pad) }
. = 0x10000000; . = 0x10000000;
.text ${RELOCATING-0} : { .text : {
${RELOCATING+PROVIDE (_text = .);} ${RELOCATING+PROVIDE (_text = .);}
*(.text) *(.text)
*(.pr) *(.pr)

View File

@ -27,12 +27,12 @@ if test -n "${COMMONPAGESIZE}"; then
fi fi
fi fi
INTERP=".interp 0 : { *(.interp) }" INTERP=".interp 0 : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
if test -z "${NO_SMALL_DATA}"; then if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} : SBSS=".sbss :
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
@ -42,29 +42,29 @@ if test -z "${NO_SMALL_DATA}"; then
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets SDATA="/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }" SDATA2=".sdata2 : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
else else
NO_SMALL_DATA=" " NO_SMALL_DATA=" "
fi fi
test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -90,7 +90,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
KEEP (*(.ctors)) KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=".dtors ${CONSTRUCTING-0} : DTOR=".dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -100,7 +100,7 @@ DTOR=".dtors ${CONSTRUCTING-0} :
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
}" }"
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+_stack = .;} ${RELOCATING+_stack = .;}
*(.stack) *(.stack)
@ -131,10 +131,6 @@ ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
/* ARM's proprietary toolchain generate these symbols to match the start /* ARM's proprietary toolchain generate these symbols to match the start
and end of particular sections of the image. SymbianOS uses these and end of particular sections of the image. SymbianOS uses these
@ -173,13 +169,13 @@ SECTIONS
EOF EOF
cat <<EOF cat <<EOF
.init ${RELOCATING-0} : .init :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
${RELOCATING+${INIT_END}} ${RELOCATING+${INIT_END}}
} =${NOP-0} } =${NOP-0}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
@ -187,7 +183,7 @@ cat <<EOF
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0} } =${NOP-0}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
@ -204,7 +200,7 @@ cat <<EOF
${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Limit = .);} ${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Limit = .);}
${WRITABLE_RODATA-${RODATA}} ${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
@ -212,13 +208,13 @@ cat <<EOF
segment; there is no runtime relocation applied to these segment; there is no runtime relocation applied to these
arrays. */ arrays. */
.preinit_array ${RELOCATING-0} : .preinit_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}}
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}}
} }
.init_array ${RELOCATING-0} : .init_array :
{ {
/* SymbianOS uses this symbol. */ /* SymbianOS uses this symbol. */
${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);} ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);}
@ -229,7 +225,7 @@ cat <<EOF
/* SymbianOS uses this symbol. */ /* SymbianOS uses this symbol. */
${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);} ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);}
} }
.fini_array ${RELOCATING-0} : .fini_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}}
KEEP (*(.fini_array)) KEEP (*(.fini_array))
@ -239,8 +235,8 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -249,16 +245,16 @@ cat <<EOF
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } .tbss : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
${RELOCATING+${CTOR}} ${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}} ${RELOCATING+${DTOR}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${RELOCATING+${DATARELRO}} ${RELOCATING+${DATARELRO}}
${OTHER_RELRO_SECTIONS} ${OTHER_RELRO_SECTIONS}
@ -266,13 +262,13 @@ cat <<EOF
${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}} ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
@ -287,7 +283,7 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})

View File

@ -13,66 +13,66 @@ SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : .rel.text :
{ {
*(.rel.text) *(.rel.text)
${RELOCATING+*(.rel.text.*)} ${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t*)} ${RELOCATING+*(.rel.gnu.linkonce.t*)}
} }
.rela.text ${RELOCATING-0} : .rela.text :
{ {
*(.rela.text) *(.rela.text)
${RELOCATING+*(.rela.text.*)} ${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t*)} ${RELOCATING+*(.rela.gnu.linkonce.t*)}
} }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : .rel.rodata :
{ {
*(.rel.rodata) *(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)} ${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r*)} ${RELOCATING+*(.rel.gnu.linkonce.r*)}
} }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ {
*(.rela.rodata) *(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)} ${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r*)} ${RELOCATING+*(.rela.gnu.linkonce.r*)}
} }
.rel.data ${RELOCATING-0} : .rel.data :
{ {
*(.rel.data) *(.rel.data)
${RELOCATING+*(.rel.data.*)} ${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d*)} ${RELOCATING+*(.rel.gnu.linkonce.d*)}
} }
.rela.data ${RELOCATING-0} : .rela.data :
{ {
*(.rela.data) *(.rela.data)
${RELOCATING+*(.rela.data.*)} ${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d*)} ${RELOCATING+*(.rela.gnu.linkonce.d*)}
} }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.bss : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.bss : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
/* Internal text space or external memory. */ /* Internal text space or external memory. */
.text ${RELOCATING-0} : .text :
{ {
*(.vectors) *(.vectors)
KEEP(*(.vectors)) KEEP(*(.vectors))
@ -155,7 +155,7 @@ SECTIONS
${RELOCATING+ _etext = . ; } ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} .data : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{ {
${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__data_start = .) ; }
*(.data) *(.data)
@ -168,7 +168,7 @@ SECTIONS
${RELOCATING+ PROVIDE (__data_end = .) ; } ${RELOCATING+ PROVIDE (__data_end = .) ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
.bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))} .bss :${RELOCATING+ AT (ADDR (.bss))}
{ {
${RELOCATING+ PROVIDE (__bss_start = .) ; } ${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss) *(.bss)
@ -181,7 +181,7 @@ SECTIONS
${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); } ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
/* Global data not cleared after reset. */ /* Global data not cleared after reset. */
.noinit ${RELOCATING-0}: .noinit :
{ {
${RELOCATING+ PROVIDE (__noinit_start = .) ; } ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
*(.noinit*) *(.noinit*)
@ -190,7 +190,7 @@ SECTIONS
${RELOCATING+ PROVIDE (__heap_start = .) ; } ${RELOCATING+ PROVIDE (__heap_start = .) ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
.eeprom ${RELOCATING-0}: .eeprom :
{ {
*(.eeprom*) *(.eeprom*)
${RELOCATING+ __eeprom_end = . ; } ${RELOCATING+ __eeprom_end = . ; }

View File

@ -110,42 +110,42 @@ if test -n "${COMMONPAGESIZE}"; then
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
fi fi
if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" INITIAL_READONLY_SECTIONS=".interp : { *(.interp) }"
fi fi
if test -z "$PLT"; then if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" IPLT=".iplt : { *(.iplt) }"
PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} } PLT=".plt : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
${IREL_IN_PLT-$IPLT}" ${IREL_IN_PLT-$IPLT}"
fi fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }" GOT=".got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }" GOT=".got : { *(.got) *(.igot) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" GOTPLT=".got.plt : { *(.got.plt) *(.igot.plt) }"
fi fi
fi fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" REL_IFUNC=".rel.ifunc : { *(.rel.ifunc) }"
RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }" RELA_IFUNC=".rela.ifunc : { *(.rela.ifunc) }"
REL_IPLT=".rel.iplt ${RELOCATING-0} : REL_IPLT=".rel.iplt :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}
*(.rel.iplt) *(.rel.iplt)
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}
}" }"
RELA_IPLT=".rela.iplt ${RELOCATING-0} : RELA_IPLT=".rela.iplt :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}
*(.rela.iplt) *(.rela.iplt)
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}
}" }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" DYNAMIC=".dynamic : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }"
DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
if test -z "${NO_SMALL_DATA}"; then if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} : SBSS=".sbss :
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
@ -154,29 +154,29 @@ if test -z "${NO_SMALL_DATA}"; then
*(.scommon) *(.scommon)
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets SDATA="/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : SDATA2=".sdata2 :
{ {
${RELOCATING+${SDATA2_START_SYMBOLS}} ${RELOCATING+${SDATA2_START_SYMBOLS}}
*(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*})
}" }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
else else
NO_SMALL_DATA=" " NO_SMALL_DATA=" "
fi fi
@ -192,31 +192,31 @@ if test -z "${SDATA_GOT}"; then
fi fi
test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
test "${LARGE_SECTIONS}" = "yes" && REL_LARGE=" test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
.rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) } .rel.ldata : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
.rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) } .rela.ldata : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
.rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) } .rel.lbss : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
.rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) } .rela.lbss : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
.rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) } .rel.lrodata : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
.rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }" .rela.lrodata : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
.lbss ${RELOCATING-0} : .lbss :
{ {
*(.dynlbss) *(.dynlbss)
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
*(LARGE_COMMON) *(LARGE_COMMON)
}" }"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .lrodata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
{ {
*(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*}) *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
} }
.ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .ldata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
{ {
*(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}" }"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -242,7 +242,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
KEEP (*(.ctors)) KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=".dtors ${CONSTRUCTING-0} : DTOR=".dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -252,7 +252,7 @@ DTOR=".dtors ${CONSTRUCTING-0} :
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
}" }"
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+${USER_LABEL_PREFIX}_stack = .;} ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
*(.stack) *(.stack)
@ -277,10 +277,6 @@ ${RELOCATING+ENTRY(${ENTRY})}
${RELOCATING+${LIB_SEARCH_DIRS}} ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
@ -296,13 +292,13 @@ test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC= test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
cat > ldscripts/dyntmp.$$ <<EOF cat > ldscripts/dyntmp.$$ <<EOF
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.gnu.hash ${RELOCATING-0} : { *(.gnu.hash) } .gnu.hash : { *(.gnu.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
EOF EOF
if [ "x$COMBRELOC" = x ]; then if [ "x$COMBRELOC" = x ]; then
@ -311,36 +307,36 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } .rel.text : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } .rela.text : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } .rel.rodata : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } .rela.rodata : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) } .rel.data.rel.ro : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) }
.rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) } .rela.data.rel.ro : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) }
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } .rel.data : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } .rela.data : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) } .rel.tdata : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) } .rela.tdata : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) } .rel.tbss : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
.rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) } .rela.tbss : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
${REL_SDATA} ${REL_SDATA}
${REL_SBSS} ${REL_SBSS}
${REL_SDATA2} ${REL_SDATA2}
${REL_SBSS2} ${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rel.bss : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } .rela.bss : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
${REL_LARGE} ${REL_LARGE}
${IREL_IN_PLT+$REL_IFUNC} ${IREL_IN_PLT+$REL_IFUNC}
${IREL_IN_PLT+$RELA_IFUNC} ${IREL_IN_PLT+$RELA_IFUNC}
@ -350,13 +346,13 @@ EOF
if [ -n "$COMBRELOC" ]; then if [ -n "$COMBRELOC" ]; then
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
.rel.dyn ${RELOCATING-0} : .rel.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
} }
.rela.dyn ${RELOCATING-0} : .rela.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
@ -366,14 +362,14 @@ EOF
fi fi
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
.rel.plt ${RELOCATING-0} : .rel.plt :
{ {
*(.rel.plt) *(.rel.plt)
${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}} ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}}
${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}} ${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}}
${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}} ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}}
} }
.rela.plt ${RELOCATING-0} : .rela.plt :
{ {
*(.rela.plt) *(.rela.plt)
${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}} ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}}
@ -398,7 +394,7 @@ if test -z "${NON_ALLOC_DYN}"; then
fi fi
cat <<EOF cat <<EOF
.init ${RELOCATING-0} : .init :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
@ -407,7 +403,7 @@ cat <<EOF
${TEXT_PLT+${PLT}} ${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION} ${TINY_READONLY_SECTION}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
${RELOCATING+*(.text.unlikely .text.*_unlikely)} ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
@ -416,7 +412,7 @@ cat <<EOF
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0} } =${NOP-0}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
@ -426,13 +422,13 @@ cat <<EOF
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
${WRITABLE_RODATA-${RODATA}} ${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -441,27 +437,27 @@ cat <<EOF
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } .tbss : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
.preinit_array ${RELOCATING-0} : .preinit_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
} }
.init_array ${RELOCATING-0} : .init_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
} }
.fini_array ${RELOCATING-0} : .fini_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
KEEP (*(.fini_array)) KEEP (*(.fini_array))
@ -470,7 +466,7 @@ cat <<EOF
} }
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}} ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${RELOCATING+${DATARELRO}} ${RELOCATING+${DATARELRO}}
${OTHER_RELRO_SECTIONS} ${OTHER_RELRO_SECTIONS}
@ -484,13 +480,13 @@ cat <<EOF
${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
@ -506,7 +502,7 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})

View File

@ -1,4 +1,5 @@
# Linker Script for National Semiconductor's CR16-ELF32. # Linker Script for National Semiconductor's CR16-ELF32.
test -z "$RELOCATING" && exit 0
# The next line should be uncommented if it is desired to link # The next line should be uncommented if it is desired to link
# without libstart.o and directly enter main. # without libstart.o and directly enter main.
@ -12,7 +13,7 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${RELOCATING+ENTRY(${ENTRY})} ENTRY(${ENTRY})
/* Define memory regions. */ /* Define memory regions. */
MEMORY MEMORY

View File

@ -1,4 +1,5 @@
# Linker Script for National Semiconductor's CR16C-ELF32. # Linker Script for National Semiconductor's CR16C-ELF32.
test -z "$RELOCATING" && exit 0
test -z "$ENTRY" && ENTRY=_start test -z "$ENTRY" && ENTRY=_start
cat <<EOF cat <<EOF
@ -7,7 +8,7 @@ cat <<EOF
elf32 files, which were compiled with either the near data elf32 files, which were compiled with either the near data
model or the default data model. */ model or the default data model. */
${RELOCATING+ENTRY(${ENTRY})} ENTRY(${ENTRY})
MEMORY MEMORY
{ {

View File

@ -1,4 +1,5 @@
# Linker Script for National Semiconductor's CRX-ELF32. # Linker Script for National Semiconductor's CRX-ELF32.
test -z "$RELOCATING" && exit 0
# The next line should be uncommented if it is desired to link # The next line should be uncommented if it is desired to link
# without libstart.o and directly enter main. # without libstart.o and directly enter main.
@ -12,7 +13,7 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${RELOCATING+ENTRY(${ENTRY})} ENTRY(${ENTRY})
/* Define memory regions. */ /* Define memory regions. */
MEMORY MEMORY

View File

@ -5,7 +5,7 @@ HEAP_MEMORY_MSP430=" "
if test ${GOT_HEAP_MSP-0} -ne 0 if test ${GOT_HEAP_MSP-0} -ne 0
then then
HEAP_SECTION_MSP430=".heap ${RELOCATING-0} : HEAP_SECTION_MSP430=".heap :
{ {
${RELOCATING+ PROVIDE (__heap_data_start = .) ; } ${RELOCATING+ PROVIDE (__heap_data_start = .) ; }
*(.heap*) *(.heap*)
@ -37,63 +37,63 @@ SECTIONS
{ {
/* Read-only sections, merged into text segment. */ /* Read-only sections, merged into text segment. */
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : .rel.text :
{ {
*(.rel.text) *(.rel.text)
${RELOCATING+*(.rel.text.*)} ${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t*)} ${RELOCATING+*(.rel.gnu.linkonce.t*)}
} }
.rela.text ${RELOCATING-0} : .rela.text :
{ {
*(.rela.text) *(.rela.text)
${RELOCATING+*(.rela.text.*)} ${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t*)} ${RELOCATING+*(.rela.gnu.linkonce.t*)}
} }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : .rel.rodata :
{ {
*(.rel.rodata) *(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)} ${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r*)} ${RELOCATING+*(.rel.gnu.linkonce.r*)}
} }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ {
*(.rela.rodata) *(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)} ${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r*)} ${RELOCATING+*(.rela.gnu.linkonce.r*)}
} }
.rel.data ${RELOCATING-0} : .rel.data :
{ {
*(.rel.data) *(.rel.data)
${RELOCATING+*(.rel.data.*)} ${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d*)} ${RELOCATING+*(.rel.gnu.linkonce.d*)}
} }
.rela.data ${RELOCATING-0} : .rela.data :
{ {
*(.rela.data) *(.rela.data)
${RELOCATING+*(.rela.data.*)} ${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d*)} ${RELOCATING+*(.rela.gnu.linkonce.d*)}
} }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.bss : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.bss : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
/* Internal text space. */ /* Internal text space. */
.text : .text :
@ -139,7 +139,7 @@ SECTIONS
_etext = .; _etext = .;
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} .data : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{ {
${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__data_start = .) ; }
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
@ -151,7 +151,7 @@ SECTIONS
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
/* Bootloader. */ /* Bootloader. */
.bootloader ${RELOCATING-0} : .bootloader :
{ {
${RELOCATING+ PROVIDE (__boot_start = .) ; } ${RELOCATING+ PROVIDE (__boot_start = .) ; }
*(.bootloader) *(.bootloader)
@ -160,7 +160,7 @@ SECTIONS
} ${RELOCATING+ > bootloader} } ${RELOCATING+ > bootloader}
/* Information memory. */ /* Information memory. */
.infomem ${RELOCATING-0} : .infomem :
{ {
*(.infomem) *(.infomem)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
@ -168,7 +168,7 @@ SECTIONS
} ${RELOCATING+ > infomem} } ${RELOCATING+ > infomem}
/* Information memory (not loaded into MPU). */ /* Information memory (not loaded into MPU). */
.infomemnobits ${RELOCATING-0} : .infomemnobits :
{ {
*(.infomemnobits) *(.infomemnobits)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
@ -193,7 +193,7 @@ SECTIONS
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
.vectors ${RELOCATING-0}: .vectors :
{ {
${RELOCATING+ PROVIDE (__vectors_start = .) ; } ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
*(.vectors*) *(.vectors*)

View File

@ -13,63 +13,63 @@ SECTIONS
{ {
/* Read-only sections, merged into text segment. */ /* Read-only sections, merged into text segment. */
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : .rel.text :
{ {
*(.rel.text) *(.rel.text)
${RELOCATING+*(.rel.text.*)} ${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t*)} ${RELOCATING+*(.rel.gnu.linkonce.t*)}
} }
.rela.text ${RELOCATING-0} : .rela.text :
{ {
*(.rela.text) *(.rela.text)
${RELOCATING+*(.rela.text.*)} ${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t*)} ${RELOCATING+*(.rela.gnu.linkonce.t*)}
} }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : .rel.rodata :
{ {
*(.rel.rodata) *(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)} ${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r*)} ${RELOCATING+*(.rel.gnu.linkonce.r*)}
} }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ {
*(.rela.rodata) *(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)} ${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r*)} ${RELOCATING+*(.rela.gnu.linkonce.r*)}
} }
.rel.data ${RELOCATING-0} : .rel.data :
{ {
*(.rel.data) *(.rel.data)
${RELOCATING+*(.rel.data.*)} ${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d*)} ${RELOCATING+*(.rel.gnu.linkonce.d*)}
} }
.rela.data ${RELOCATING-0} : .rela.data :
{ {
*(.rela.data) *(.rela.data)
${RELOCATING+*(.rela.data.*)} ${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d*)} ${RELOCATING+*(.rela.gnu.linkonce.d*)}
} }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.bss : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.bss : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
/* Internal text space. */ /* Internal text space. */
.text : .text :
@ -115,7 +115,7 @@ SECTIONS
${RELOCATING+ _etext = . ; } ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} .data : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{ {
${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__data_start = .) ; }
*(.data) *(.data)
@ -142,7 +142,7 @@ SECTIONS
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
.vectors ${RELOCATING-0}: .vectors :
{ {
${RELOCATING+ PROVIDE (__vectors_start = .) ; } ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
*(.vectors*) *(.vectors*)

View File

@ -84,7 +84,7 @@ fi
DYNAMIC=".dynamic : { *(.dynamic) } :dynamic :dyn" DYNAMIC=".dynamic : { *(.dynamic) } :dynamic :dyn"
RODATA=".rodata ALIGN(4) : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata ALIGN(4) : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.directive) *(.gnu.lto_*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.directive) *(.gnu.lto_*) }"
test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) } :dynamic :dyn" test -z "$GOT" && GOT=".got : { *(.got.plt) *(.got) } :dynamic :dyn"
CTOR=".ctors ALIGN(4) : CTOR=".ctors ALIGN(4) :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
@ -121,7 +121,7 @@ DTOR=".dtors ALIGN(4) :
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
} :text" } :text"
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+_stack = .;} ${RELOCATING+_stack = .;}
*(.stack) *(.stack)
@ -145,10 +145,6 @@ ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
PHDRS PHDRS
{ {
@ -208,20 +204,20 @@ SECTIONS
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
. = ALIGN(128) + (. & (128 - 1)); . = ALIGN(128) + (. & (128 - 1));
.preinit_array ${RELOCATING-0} : .preinit_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}}
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}}
} }
.init_array ${RELOCATING-0} : .init_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}}
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}}
} }
.fini_array ${RELOCATING-0} : .fini_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}}
KEEP (*(.fini_array)) KEEP (*(.fini_array))
@ -273,14 +269,14 @@ SECTIONS
${TEXT_DYNAMIC-${DYNAMIC}} ${TEXT_DYNAMIC-${DYNAMIC}}
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } :dynamic :dyn .hash : { *(.hash) } :dynamic :dyn
.dynsym ${RELOCATING-0} : { *(.dynsym) } :dynamic :dyn .dynsym : { *(.dynsym) } :dynamic :dyn
.dynstr ${RELOCATING-0} : { *(.dynstr) } :dynamic :dyn .dynstr : { *(.dynstr) } :dynamic :dyn
${DATA_PLT-${BSS_PLT-${PLT}}} ${DATA_PLT-${BSS_PLT-${PLT}}}
.got.plt : { *(.got.plt) } :dynamic :dyn .got.plt : { *(.got.plt) } :dynamic :dyn
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
EOF EOF
if [ "x$COMBRELOC" = x ]; then if [ "x$COMBRELOC" = x ]; then
COMBRELOCCAT=cat COMBRELOCCAT=cat
@ -288,40 +284,40 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } .rel.text : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } .rela.text : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } .rel.rodata : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } .rela.rodata : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } .rel.data : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } .rela.data : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) } .rel.tdata : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) } .rela.tdata : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) } .rel.tbss : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
.rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) } .rela.tbss : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rel.bss : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } .rela.bss : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
EOF EOF
if [ -n "$COMBRELOC" ]; then if [ -n "$COMBRELOC" ]; then
cat <<EOF cat <<EOF
.rel.dyn ${RELOCATING-0} : .rel.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
cat <<EOF cat <<EOF
} }
.rela.dyn ${RELOCATING-0} : .rela.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
@ -330,8 +326,8 @@ cat <<EOF
EOF EOF
fi fi
cat <<EOF cat <<EOF
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}

View File

@ -110,26 +110,26 @@ if test -n "${COMMONPAGESIZE}"; then
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
fi fi
if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" INITIAL_READONLY_SECTIONS=".interp : { *(.interp) }"
fi fi
if test -z "$PLT"; then if test -z "$PLT"; then
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
fi fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got : { *(.got.plt) *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }" GOTPLT=".got.plt : { *(.got.plt) }"
fi fi
fi fi
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" DYNAMIC=".dynamic : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }"
DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
if test -z "${NO_SMALL_DATA}"; then if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} : SBSS=".sbss :
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
@ -138,29 +138,29 @@ if test -z "${NO_SMALL_DATA}"; then
*(.scommon) *(.scommon)
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets SDATA="/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : SDATA2=".sdata2 :
{ {
${RELOCATING+${SDATA2_START_SYMBOLS}} ${RELOCATING+${SDATA2_START_SYMBOLS}}
*(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*})
}" }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
else else
NO_SMALL_DATA=" " NO_SMALL_DATA=" "
fi fi
@ -176,31 +176,31 @@ if test -z "${SDATA_GOT}"; then
fi fi
test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
test "${LARGE_SECTIONS}" = "yes" && REL_LARGE=" test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
.rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) } .rel.ldata : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
.rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) } .rela.ldata : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
.rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) } .rel.lbss : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
.rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) } .rela.lbss : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
.rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) } .rel.lrodata : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
.rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }" .rela.lrodata : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
.lbss ${RELOCATING-0} : .lbss :
{ {
*(.dynlbss) *(.dynlbss)
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
*(LARGE_COMMON) *(LARGE_COMMON)
}" }"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .lrodata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
{ {
*(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*}) *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
} }
.ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .ldata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
{ {
*(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}" }"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -226,7 +226,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
KEEP (*(.ctors)) KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=".dtors ${CONSTRUCTING-0} : DTOR=".dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -236,7 +236,7 @@ DTOR=".dtors ${CONSTRUCTING-0} :
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
}" }"
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+_stack = .;} ${RELOCATING+_stack = .;}
*(.stack) *(.stack)
@ -261,10 +261,6 @@ ${RELOCATING+ENTRY(${ENTRY})}
${RELOCATING+${LIB_SEARCH_DIRS}} ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
@ -280,13 +276,13 @@ test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC= test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
cat > ldscripts/dyntmp.$$ <<EOF cat > ldscripts/dyntmp.$$ <<EOF
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.gnu.hash ${RELOCATING-0} : { *(.gnu.hash) } .gnu.hash : { *(.gnu.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
EOF EOF
if [ "x$COMBRELOC" = x ]; then if [ "x$COMBRELOC" = x ]; then
@ -295,58 +291,58 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } .rel.text : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } .rela.text : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } .rel.rodata : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } .rela.rodata : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) } .rel.data.rel.ro : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) }
.rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) } .rela.data.rel.ro : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) }
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } .rel.data : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } .rela.data : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) } .rel.tdata : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) } .rela.tdata : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) } .rel.tbss : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
.rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) } .rela.tbss : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
${REL_SDATA} ${REL_SDATA}
${REL_SBSS} ${REL_SBSS}
${REL_SDATA2} ${REL_SDATA2}
${REL_SBSS2} ${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rel.bss : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } .rela.bss : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
${REL_LARGE} ${REL_LARGE}
EOF EOF
if [ -n "$COMBRELOC" ]; then if [ -n "$COMBRELOC" ]; then
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
.rel.dyn ${RELOCATING-0} : .rel.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
} }
.rel.ifunc.dyn ${RELOCATING-0} : .rel.ifunc.dyn :
{ {
*(.rel.ifunc.*) *(.rel.ifunc.*)
} }
.rela.dyn ${RELOCATING-0} : .rela.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
} }
.rela.ifunc.dyn ${RELOCATING-0} : .rela.ifunc.dyn :
{ {
*(.rela.ifunc.*) *(.rela.ifunc.*)
} }
@ -354,8 +350,8 @@ EOF
fi fi
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}
EOF EOF
@ -374,7 +370,7 @@ if test -z "${NON_ALLOC_DYN}"; then
fi fi
cat <<EOF cat <<EOF
.init ${RELOCATING-0} : .init :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
@ -383,7 +379,7 @@ cat <<EOF
${TEXT_PLT+${PLT}} ${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION} ${TINY_READONLY_SECTION}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
@ -391,7 +387,7 @@ cat <<EOF
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0} } =${NOP-0}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
@ -401,13 +397,13 @@ cat <<EOF
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
${WRITABLE_RODATA-${RODATA}} ${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -416,26 +412,26 @@ cat <<EOF
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.preinit_array ${RELOCATING-0} : .preinit_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
} }
.init_array ${RELOCATING-0} : .init_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
} }
.fini_array ${RELOCATING-0} : .fini_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
KEEP (*(.fini_array)) KEEP (*(.fini_array))
@ -444,7 +440,7 @@ cat <<EOF
} }
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}} ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${RELOCATING+${DATARELRO}} ${RELOCATING+${DATARELRO}}
${OTHER_RELRO_SECTIONS} ${OTHER_RELRO_SECTIONS}
@ -458,13 +454,13 @@ cat <<EOF
${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
@ -480,7 +476,7 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})

View File

@ -71,12 +71,12 @@ test -z "${ELFSIZE}" && ELFSIZE=32
test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }" test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" DYNAMIC=".dynamic : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
if test -z "${NO_SMALL_DATA}"; then if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} : SBSS=".sbss :
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
@ -86,24 +86,24 @@ if test -z "${NO_SMALL_DATA}"; then
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets SDATA="/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }" SDATA2=".sdata2 : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
fi fi
CTOR=" CTOR="
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
@ -139,7 +139,7 @@ DTOR="
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
" "
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+_stack = .;} ${RELOCATING+_stack = .;}
*(.stack) *(.stack)
@ -158,10 +158,6 @@ ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
@ -171,12 +167,12 @@ SECTIONS
${CREATE_SHLIB-${INTERP}} ${CREATE_SHLIB-${INTERP}}
${INITIAL_READONLY_SECTIONS} ${INITIAL_READONLY_SECTIONS}
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
EOF EOF
if [ "x$COMBRELOC" = x ]; then if [ "x$COMBRELOC" = x ]; then
@ -185,40 +181,40 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } .rel.text : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } .rela.text : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } .rel.rodata : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } .rela.rodata : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } .rel.data : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } .rela.data : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
${REL_SDATA} ${REL_SDATA}
${REL_SBSS} ${REL_SBSS}
${REL_SDATA2} ${REL_SDATA2}
${REL_SBSS2} ${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rel.bss : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } .rela.bss : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
EOF EOF
if [ -n "$COMBRELOC" ]; then if [ -n "$COMBRELOC" ]; then
cat <<EOF cat <<EOF
.rel.dyn ${RELOCATING-0} : .rel.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
cat <<EOF cat <<EOF
} }
.rela.dyn ${RELOCATING-0} : .rela.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
@ -228,11 +224,11 @@ EOF
fi fi
cat <<EOF cat <<EOF
. = ALIGN(0x1000); . = ALIGN(0x1000);
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}
${DATA_PLT-${BSS_PLT-${PLT}}} ${DATA_PLT-${BSS_PLT-${PLT}}}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
@ -240,7 +236,7 @@ cat <<EOF
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0} } =${NOP-0}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
@ -256,7 +252,7 @@ cat <<EOF
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
. = ALIGN(0x1000); . = ALIGN(0x1000);
.data ${RELOCATING-0} : .data :
{ {
*(.rodata .rodata.*) *(.rodata .rodata.*)
*(.rodata1) *(.rodata1)
@ -270,15 +266,15 @@ cat <<EOF
${DTOR} ${DTOR}
KEEP (*(.jcr)) KEEP (*(.jcr))
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
. = ALIGN(0x1000); . = ALIGN(0x1000);
.gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } .gcc_except_table : { *(.gcc_except_table) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${TEXT_DYNAMIC-${DYNAMIC}} ${TEXT_DYNAMIC-${DYNAMIC}}
${DATA_PLT+${PLT}} ${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}} ${RELOCATING+${OTHER_GOT_SYMBOLS}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) } .got : { *(.got.plt) *(.got) }
${OTHER_GOT_SECTIONS} ${OTHER_GOT_SECTIONS}
${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}} ${CREATE_SHLIB+${SBSS2}}
@ -291,7 +287,7 @@ cat <<EOF
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
. = ALIGN(0x1000); . = ALIGN(0x1000);
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})

View File

@ -3,11 +3,11 @@ test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -34,7 +34,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -106,12 +106,12 @@ SECTIONS
*(.rodata.*) *(.rodata.*)
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
.rodata1 ${RELOCATING-0} : { .rodata1 : {
*(.rodata1) *(.rodata1)
*(.rodata1.*) *(.rodata1.*)
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data) *(.data)
@ -120,7 +120,7 @@ SECTIONS
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
.data1 ${RELOCATING-0} : { .data1 : {
*(.data1) *(.data1)
*(.data1.*) *(.data1.*)
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
@ -131,7 +131,7 @@ SECTIONS
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { .sdata : {
*(.sdata) *(.sdata)
*(.sdata.*) *(.sdata.*)
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
@ -139,8 +139,8 @@ SECTIONS
${RELOCATING+_edata = .;} ${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
.sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA} .sbss : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.dynbss.*) *(.dynbss.*)

View File

@ -1,5 +1,5 @@
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+ __CTOR_LIST__ = .; } ${CONSTRUCTING+ __CTOR_LIST__ = .; }
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -26,7 +26,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+ __CTOR_END__ = .; } ${CONSTRUCTING+ __CTOR_END__ = .; }
} ${RELOCATING+ > ${DATA_MEMORY}}" } ${RELOCATING+ > ${DATA_MEMORY}}"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+ __DTOR_LIST__ = .; } ${CONSTRUCTING+ __DTOR_LIST__ = .; }
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -53,57 +53,57 @@ SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.text ${RELOCATING-0} : { *(.rel.text) *(.rel.gnu.linkonce.t*) } .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) } .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) } .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) } .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rel.stext ${RELOCATING-0} : { *(.rel.stest) } .rel.stext : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) } .rela.stext : { *(.rela.stest) }
.rel.etext ${RELOCATING-0} : { *(.rel.etest) } .rel.etext : { *(.rel.etest) }
.rela.etext ${RELOCATING-0} : { *(.rela.etest) } .rela.etext : { *(.rela.etest) }
.rel.sdata ${RELOCATING-0} : { *(.rel.sdata) } .rel.sdata : { *(.rel.sdata) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } .rela.sdata : { *(.rela.sdata) }
.rel.edata ${RELOCATING-0} : { *(.rel.edata) } .rel.edata : { *(.rel.edata) }
.rela.edata ${RELOCATING-0} : { *(.rela.edata) } .rela.edata : { *(.rela.edata) }
.rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) } .rel.eit_v : { *(.rel.eit_v) }
.rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) } .rela.eit_v : { *(.rela.eit_v) }
.rel.sbss ${RELOCATING-0} : { *(.rel.sbss) } .rel.sbss : { *(.rel.sbss) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss) } .rela.sbss : { *(.rela.sbss) }
.rel.ebss ${RELOCATING-0} : { *(.rel.ebss) } .rel.ebss : { *(.rel.ebss) }
.rela.ebss ${RELOCATING-0} : { *(.rela.ebss) } .rela.ebss : { *(.rela.ebss) }
.rel.srodata ${RELOCATING-0} : { *(.rel.srodata) } .rel.srodata : { *(.rel.srodata) }
.rela.srodata ${RELOCATING-0} : { *(.rela.srodata) } .rela.srodata : { *(.rela.srodata) }
.rel.erodata ${RELOCATING-0} : { *(.rel.erodata) } .rel.erodata : { *(.rel.erodata) }
.rela.erodata ${RELOCATING-0} : { *(.rela.erodata) } .rela.erodata : { *(.rela.erodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.bss : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.bss : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
.init ${RELOCATING-0} : { *(.init) } =${NOP-0} .init : { *(.init) } =${NOP-0}
${DATA_PLT-${PLT}} ${DATA_PLT-${PLT}}
/* Internal text space */ /* Internal text space */
.stext ${RELOCATING-0} : { *(.stext) } ${RELOCATING+ > text} .stext : { *(.stext) } ${RELOCATING+ > text}
/* Internal text space or external memory */ /* Internal text space or external memory */
.text : .text :
@ -116,23 +116,23 @@ SECTIONS
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
/* Internal data space */ /* Internal data space */
.srodata ${RELOCATING-0} : { *(.srodata) } ${RELOCATING+ > data} .srodata : { *(.srodata) } ${RELOCATING+ > data}
.sdata ${RELOCATING-0} : { *(.sdata) } ${RELOCATING+ > data} .sdata : { *(.sdata) } ${RELOCATING+ > data}
/* Internal data space or external memory */ /* Internal data space or external memory */
.rodata ${RELOCATING-0} : { *(.rodata) } ${RELOCATING+ > ${DATA_MEMORY}} .rodata : { *(.rodata) } ${RELOCATING+ > ${DATA_MEMORY}}
/* C++ exception support. */ /* C++ exception support. */
.eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${DATA_MEMORY}} .eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${DATA_MEMORY}}
.gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}} .gcc_except_table : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}}
/* Java class registration support. */ /* Java class registration support. */
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } ${RELOCATING+ >${DATA_MEMORY}} .jcr : { KEEP (*(.jcr)) } ${RELOCATING+ >${DATA_MEMORY}}
${RELOCATING+${CTOR}} ${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}} ${RELOCATING+${DTOR}}
.data ${RELOCATING-0} : .data :
{ {
*(.data) *(.data)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
@ -141,31 +141,31 @@ SECTIONS
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
/* External memory */ /* External memory */
.etext ${RELOCATING-0} : .etext :
{ {
${RELOCATING+ PROVIDE (__etext_start = .) ; } ${RELOCATING+ PROVIDE (__etext_start = .) ; }
*(.etext) *(.etext)
${RELOCATING+ PROVIDE (__etext_end = .) ; } ${RELOCATING+ PROVIDE (__etext_end = .) ; }
} ${RELOCATING+ > emem} } ${RELOCATING+ > emem}
.erodata ${RELOCATING-0} : { *(.erodata) } ${RELOCATING+ > emem} .erodata : { *(.erodata) } ${RELOCATING+ > emem}
.edata ${RELOCATING-0} : { *(.edata) } ${RELOCATING+ > emem} .edata : { *(.edata) } ${RELOCATING+ > emem}
.sbss ${RELOCATING-0} : .sbss :
{ {
${RELOCATING+ PROVIDE (__sbss_start = .) ; } ${RELOCATING+ PROVIDE (__sbss_start = .) ; }
*(.sbss) *(.sbss)
${RELOCATING+ PROVIDE (__sbss_end = .) ; } ${RELOCATING+ PROVIDE (__sbss_end = .) ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
.ebss ${RELOCATING-0} : .ebss :
{ {
${RELOCATING+ PROVIDE (__ebss_start = .) ; } ${RELOCATING+ PROVIDE (__ebss_start = .) ; }
*(.ebss) *(.ebss)
${RELOCATING+ PROVIDE (__ebss_end = .) ; } ${RELOCATING+ PROVIDE (__ebss_end = .) ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
.bss ${RELOCATING-0} : .bss :
{ {
${RELOCATING+ PROVIDE (__bss_start = .) ; } ${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss) *(.bss)
@ -174,7 +174,7 @@ SECTIONS
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
.eit_v ${RELOCATING-0} : .eit_v :
{ {
${RELOCATING+ PROVIDE (__eit_start = .) ; } ${RELOCATING+ PROVIDE (__eit_start = .) ; }
*(.eit_v) *(.eit_v)

View File

@ -27,10 +27,10 @@ test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }" test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) }" SBSS2=".sbss2 : { *(.sbss2) }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) }" SDATA2=".sdata2 : { *(.sdata2) }"
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
cat <<EOF cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}") "${LITTLE_OUTPUT_FORMAT}")
@ -41,10 +41,6 @@ ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+/* Do we need any of these for elf? ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
${RELOCATING+PROVIDE (__stack = 0);} ${RELOCATING+PROVIDE (__stack = 0);}
SECTIONS SECTIONS
@ -53,32 +49,32 @@ SECTIONS
${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}} ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}} ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}} ${CREATE_SHLIB-${INTERP}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rela.text ${RELOCATING-0} : .rela.text :
{ *(.rela.text) *(.rela.gnu.linkonce.t*) } { *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rela.data ${RELOCATING-0} : .rela.data :
{ *(.rela.data) *(.rela.gnu.linkonce.d*) } { *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ *(.rela.rodata) *(.rela.gnu.linkonce.r*) } { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rela.got1 ${RELOCATING-0} : { *(.rela.got1) } .rela.got1 : { *(.rela.got1) }
.rela.got2 ${RELOCATING-0} : { *(.rela.got2) } .rela.got2 : { *(.rela.got2) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.bss : { *(.rela.bss) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } .rela.sdata : { *(.rela.sdata) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss) } .rela.sbss : { *(.rela.sbss) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2) } .rela.sdata2 : { *(.rela.sdata2) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2) } .rela.sbss2 : { *(.rela.sbss2) }
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text) *(.text)
@ -86,10 +82,10 @@ SECTIONS
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) *(.gnu.linkonce.t*)
} =${NOP-0} } =${NOP-0}
.init ${RELOCATING-0} : { *(.init) } =${NOP-0} .init : { *(.init) } =${NOP-0}
.fini ${RELOCATING-0} : { *(.fini) } =${NOP-0} .fini : { *(.fini) } =${NOP-0}
.rodata ${RELOCATING-0} : { *(.rodata) *(.gnu.linkonce.r*) } .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${RELOCATING+_etext = .;} ${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);} ${RELOCATING+PROVIDE (etext = .);}
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
@ -112,42 +108,42 @@ SECTIONS
be referenced). */ be referenced). */
${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};} ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data) *(.data)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
.got1 ${RELOCATING-0} : { *(.got1) } .got1 : { *(.got1) }
.dynamic ${RELOCATING-0} : { *(.dynamic) } .dynamic : { *(.dynamic) }
/* Put .ctors and .dtors next to the .got2 section, so that the pointers /* Put .ctors and .dtors next to the .got2 section, so that the pointers
get relocated with -mrelocatable. Also put in the .fixup pointers. get relocated with -mrelocatable. Also put in the .fixup pointers.
The current compiler no longer needs this, but keep it around for 2.7.2 */ The current compiler no longer needs this, but keep it around for 2.7.2 */
${RELOCATING+PROVIDE (_GOT2_START_ = .);} ${RELOCATING+PROVIDE (_GOT2_START_ = .);}
.got2 ${RELOCATING-0} : { *(.got2) } .got2 : { *(.got2) }
${RELOCATING+PROVIDE (__CTOR_LIST__ = .);} ${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
.ctors ${RELOCATING-0} : { *(.ctors) } .ctors : { *(.ctors) }
${RELOCATING+PROVIDE (__CTOR_END__ = .);} ${RELOCATING+PROVIDE (__CTOR_END__ = .);}
${RELOCATING+PROVIDE (__DTOR_LIST__ = .);} ${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
.dtors ${RELOCATING-0} : { *(.dtors) } .dtors : { *(.dtors) }
${RELOCATING+PROVIDE (__DTOR_END__ = .);} ${RELOCATING+PROVIDE (__DTOR_END__ = .);}
${RELOCATING+PROVIDE (_FIXUP_START_ = .);} ${RELOCATING+PROVIDE (_FIXUP_START_ = .);}
.fixup ${RELOCATING-0} : { *(.fixup) } .fixup : { *(.fixup) }
${RELOCATING+PROVIDE (_FIXUP_END_ = .);} ${RELOCATING+PROVIDE (_FIXUP_END_ = .);}
${RELOCATING+PROVIDE (_GOT2_END_ = .);} ${RELOCATING+PROVIDE (_GOT2_END_ = .);}
${RELOCATING+PROVIDE (_GOT_START_ = .);} ${RELOCATING+PROVIDE (_GOT_START_ = .);}
.got ${RELOCATING-0} : { *(.got) } .got : { *(.got) }
.got.plt ${RELOCATING-0} : { *(.got.plt) } .got.plt : { *(.got.plt) }
${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}} ${CREATE_SHLIB+${SBSS2}}
${RELOCATING+PROVIDE (_GOT_END_ = .);} ${RELOCATING+PROVIDE (_GOT_END_ = .);}
@ -155,10 +151,10 @@ SECTIONS
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { *(.sdata) } .sdata : { *(.sdata) }
${RELOCATING+_edata = .;} ${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+PROVIDE (edata = .);}
.sbss ${RELOCATING-0} : .sbss :
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
*(.sbss) *(.sbss)
@ -167,7 +163,7 @@ SECTIONS
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
} }
${PLT} ${PLT}
.bss ${RELOCATING-0} : .bss :
{ {
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${RELOCATING+PROVIDE (__bss_start = .);} ${RELOCATING+PROVIDE (__bss_start = .);}

View File

@ -24,7 +24,7 @@ test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); }
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
@ -34,7 +34,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); }
} ${RELOCATING+ > ${TEXT_MEMORY}}" } ${RELOCATING+ > ${TEXT_MEMORY}}"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); }
KEEP (*(.dtors)) KEEP (*(.dtors))
@ -127,34 +127,34 @@ PRE_COMPUTE_DATA_SIZE="
" "
INSTALL_RELOC=" INSTALL_RELOC="
.install0 0 : { *(.install0) } .install0 : { *(.install0) }
.install1 0 : { *(.install1) } .install1 : { *(.install1) }
.install2 0 : { *(.install2) } .install2 : { *(.install2) }
.install3 0 : { *(.install3) } .install3 : { *(.install3) }
.install4 0 : { *(.install4) } .install4 : { *(.install4) }
" "
FINISH_RELOC=" FINISH_RELOC="
.fini0 0 : { *(.fini0) } .fini0 : { *(.fini0) }
.fini1 0 : { *(.fini1) } .fini1 : { *(.fini1) }
.fini2 0 : { *(.fini2) } .fini2 : { *(.fini2) }
.fini3 0 : { *(.fini3) } .fini3 : { *(.fini3) }
.fini4 0 : { *(.fini4) } .fini4 : { *(.fini4) }
" "
BSS_DATA_RELOC=" BSS_DATA_RELOC="
.data1 0 : { *(.data1) } .data1 : { *(.data1) }
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata 0 : { *(.sdata) } .sdata : { *(.sdata) }
.sbss 0 : { *(.sbss) } .sbss : { *(.sbss) }
.scommon 0 : { *(.scommon) } .scommon : { *(.scommon) }
" "
SOFT_REGS_RELOC=" SOFT_REGS_RELOC="
.softregs 0 : { *(.softregs) } .softregs : { *(.softregs) }
" "
cat <<EOF cat <<EOF
@ -172,113 +172,113 @@ ${RELOCATING+${MEMORY_DEF}}
SECTIONS SECTIONS
{ {
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.text ${RELOCATING-0} : .rel.text :
{ {
*(.rel.text) *(.rel.text)
${RELOCATING+*(.rel.text.*)} ${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t.*)} ${RELOCATING+*(.rel.gnu.linkonce.t.*)}
} }
.rela.text ${RELOCATING-0} : .rela.text :
{ {
*(.rela.text) *(.rela.text)
${RELOCATING+*(.rela.text.*)} ${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t.*)} ${RELOCATING+*(.rela.gnu.linkonce.t.*)}
} }
.rel.data ${RELOCATING-0} : .rel.data :
{ {
*(.rel.data) *(.rel.data)
${RELOCATING+*(.rel.data.*)} ${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d.*)} ${RELOCATING+*(.rel.gnu.linkonce.d.*)}
} }
.rela.data ${RELOCATING-0} : .rela.data :
{ {
*(.rela.data) *(.rela.data)
${RELOCATING+*(.rela.data.*)} ${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d.*)} ${RELOCATING+*(.rela.gnu.linkonce.d.*)}
} }
.rel.rodata ${RELOCATING-0} : .rel.rodata :
{ {
*(.rel.rodata) *(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)} ${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r.*)} ${RELOCATING+*(.rel.gnu.linkonce.r.*)}
} }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ {
*(.rela.rodata) *(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)} ${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r.*)} ${RELOCATING+*(.rela.gnu.linkonce.r.*)}
} }
.rel.sdata ${RELOCATING-0} : .rel.sdata :
{ {
*(.rel.sdata) *(.rel.sdata)
${RELOCATING+*(.rel.sdata.*)} ${RELOCATING+*(.rel.sdata.*)}
${RELOCATING+*(.rel.gnu.linkonce.s.*)} ${RELOCATING+*(.rel.gnu.linkonce.s.*)}
} }
.rela.sdata ${RELOCATING-0} : .rela.sdata :
{ {
*(.rela.sdata) *(.rela.sdata)
${RELOCATING+*(.rela.sdata.*)} ${RELOCATING+*(.rela.sdata.*)}
${RELOCATING+*(.rela.gnu.linkonce.s.*)} ${RELOCATING+*(.rela.gnu.linkonce.s.*)}
} }
.rel.sbss ${RELOCATING-0} : .rel.sbss :
{ {
*(.rel.sbss) *(.rel.sbss)
${RELOCATING+*(.rel.sbss.*)} ${RELOCATING+*(.rel.sbss.*)}
${RELOCATING+*(.rel.gnu.linkonce.sb.*)} ${RELOCATING+*(.rel.gnu.linkonce.sb.*)}
} }
.rela.sbss ${RELOCATING-0} : .rela.sbss :
{ {
*(.rela.sbss) *(.rela.sbss)
${RELOCATING+*(.rela.sbss.*)} ${RELOCATING+*(.rela.sbss.*)}
${RELOCATING+*(.rel.gnu.linkonce.sb.*)} ${RELOCATING+*(.rel.gnu.linkonce.sb.*)}
} }
.rel.bss ${RELOCATING-0} : .rel.bss :
{ {
*(.rel.bss) *(.rel.bss)
${RELOCATING+*(.rel.bss.*)} ${RELOCATING+*(.rel.bss.*)}
${RELOCATING+*(.rel.gnu.linkonce.b.*)} ${RELOCATING+*(.rel.gnu.linkonce.b.*)}
} }
.rela.bss ${RELOCATING-0} : .rela.bss :
{ {
*(.rela.bss) *(.rela.bss)
${RELOCATING+*(.rela.bss.*)} ${RELOCATING+*(.rela.bss.*)}
${RELOCATING+*(.rela.gnu.linkonce.b.*)} ${RELOCATING+*(.rela.gnu.linkonce.b.*)}
} }
.rel.stext ${RELOCATING-0} : { *(.rel.stest) } .rel.stext : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) } .rela.stext : { *(.rela.stest) }
.rel.etext ${RELOCATING-0} : { *(.rel.etest) } .rel.etext : { *(.rel.etest) }
.rela.etext ${RELOCATING-0} : { *(.rela.etest) } .rela.etext : { *(.rela.etest) }
.rel.sdata ${RELOCATING-0} : { *(.rel.sdata) } .rel.sdata : { *(.rel.sdata) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } .rela.sdata : { *(.rela.sdata) }
.rel.edata ${RELOCATING-0} : { *(.rel.edata) } .rel.edata : { *(.rel.edata) }
.rela.edata ${RELOCATING-0} : { *(.rela.edata) } .rela.edata : { *(.rela.edata) }
.rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) } .rel.eit_v : { *(.rel.eit_v) }
.rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) } .rela.eit_v : { *(.rela.eit_v) }
.rel.ebss ${RELOCATING-0} : { *(.rel.ebss) } .rel.ebss : { *(.rel.ebss) }
.rela.ebss ${RELOCATING-0} : { *(.rela.ebss) } .rela.ebss : { *(.rela.ebss) }
.rel.srodata ${RELOCATING-0} : { *(.rel.srodata) } .rel.srodata : { *(.rel.srodata) }
.rela.srodata ${RELOCATING-0} : { *(.rela.srodata) } .rela.srodata : { *(.rela.srodata) }
.rel.erodata ${RELOCATING-0} : { *(.rel.erodata) } .rel.erodata : { *(.rel.erodata) }
.rela.erodata ${RELOCATING-0} : { *(.rela.erodata) } .rela.erodata : { *(.rela.erodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
/* Concatenate .page0 sections. Put them in the page0 memory bank /* Concatenate .page0 sections. Put them in the page0 memory bank
unless we are creating a relocatable file. */ unless we are creating a relocatable file. */
@ -289,12 +289,12 @@ SECTIONS
} ${RELOCATING+ > page0} } ${RELOCATING+ > page0}
/* Start of text section. */ /* Start of text section. */
.stext ${RELOCATING-0} : .stext :
{ {
*(.stext) *(.stext)
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.init ${RELOCATING-0} : .init :
{ {
*(.init) *(.init)
} ${RELOCATING+=${NOP-0}} } ${RELOCATING+=${NOP-0}}
@ -302,7 +302,7 @@ SECTIONS
${RELOCATING-${INSTALL_RELOC}} ${RELOCATING-${INSTALL_RELOC}}
${RELOCATING-${FINISH_RELOC}} ${RELOCATING-${FINISH_RELOC}}
.text ${RELOCATING-0}: .text :
{ {
/* Put startup code at beginning so that _start keeps same address. */ /* Put startup code at beginning so that _start keeps same address. */
${RELOCATING+${STARTUP_CODE}} ${RELOCATING+${STARTUP_CODE}}
@ -323,24 +323,24 @@ SECTIONS
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.eh_frame ${RELOCATING-0} : .eh_frame :
{ {
KEEP (*(.eh_frame)) KEEP (*(.eh_frame))
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.gcc_except_table ${RELOCATING-0} : .gcc_except_table :
{ {
*(.gcc_except_table) *(.gcc_except_table)
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.rodata ${RELOCATING-0} : .rodata :
{ {
*(.rodata) *(.rodata)
${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.rodata.*)}
${RELOCATING+*(.gnu.linkonce.r*)} ${RELOCATING+*(.gnu.linkonce.r*)}
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.rodata1 ${RELOCATING-0} : .rodata1 :
{ {
*(.rodata1) *(.rodata1)
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
@ -349,7 +349,7 @@ SECTIONS
${RELOCATING+${CTOR}} ${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}} ${RELOCATING+${DTOR}}
.jcr ${RELOCATING-0} : .jcr :
{ {
KEEP (*(.jcr)) KEEP (*(.jcr))
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
@ -362,7 +362,7 @@ SECTIONS
We construct the DATA image section in PROM at end of all these We construct the DATA image section in PROM at end of all these
read-only sections. The data image must be copied at init time. read-only sections. The data image must be copied at init time.
Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */ Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */
.data ${RELOCATING-0} : ${RELOCATING+AT (__data_image)} .data : ${RELOCATING+AT (__data_image)}
{ {
${RELOCATING+__data_section_start = .;} ${RELOCATING+__data_section_start = .;}
${RELOCATING+PROVIDE (__data_section_start = .);} ${RELOCATING+PROVIDE (__data_section_start = .);}
@ -385,7 +385,7 @@ SECTIONS
${RELOCATING+${PRE_COMPUTE_DATA_SIZE}} ${RELOCATING+${PRE_COMPUTE_DATA_SIZE}}
/* .install ${RELOCATING-0}: /* .install :
{ {
. = _data_image_end; . = _data_image_end;
} ${RELOCATING+ > ${TEXT_MEMORY}} */ } ${RELOCATING+ > ${TEXT_MEMORY}} */
@ -394,7 +394,7 @@ SECTIONS
${RELOCATING-${BSS_DATA_RELOC}} ${RELOCATING-${BSS_DATA_RELOC}}
${RELOCATING-${SOFT_REGS_RELOC}} ${RELOCATING-${SOFT_REGS_RELOC}}
.bss ${RELOCATING-0} : .bss :
{ {
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
${RELOCATING+*(.sbss)} ${RELOCATING+*(.sbss)}
@ -410,7 +410,7 @@ SECTIONS
${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+__bss_size = SIZEOF(.bss);}
${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));}
.eeprom ${RELOCATING-0} : .eeprom :
{ {
*(.eeprom) *(.eeprom)
*(.eeprom.*) *(.eeprom.*)

View File

@ -24,7 +24,7 @@ test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); }
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
@ -34,7 +34,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); }
} ${RELOCATING+ > ${TEXT_MEMORY}}" } ${RELOCATING+ > ${TEXT_MEMORY}}"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); }
KEEP (*(.dtors)) KEEP (*(.dtors))
@ -127,34 +127,34 @@ PRE_COMPUTE_DATA_SIZE="
" "
INSTALL_RELOC=" INSTALL_RELOC="
.install0 0 : { *(.install0) } .install0 : { *(.install0) }
.install1 0 : { *(.install1) } .install1 : { *(.install1) }
.install2 0 : { *(.install2) } .install2 : { *(.install2) }
.install3 0 : { *(.install3) } .install3 : { *(.install3) }
.install4 0 : { *(.install4) } .install4 : { *(.install4) }
" "
FINISH_RELOC=" FINISH_RELOC="
.fini0 0 : { *(.fini0) } .fini0 : { *(.fini0) }
.fini1 0 : { *(.fini1) } .fini1 : { *(.fini1) }
.fini2 0 : { *(.fini2) } .fini2 : { *(.fini2) }
.fini3 0 : { *(.fini3) } .fini3 : { *(.fini3) }
.fini4 0 : { *(.fini4) } .fini4 : { *(.fini4) }
" "
BSS_DATA_RELOC=" BSS_DATA_RELOC="
.data1 0 : { *(.data1) } .data1 : { *(.data1) }
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata 0 : { *(.sdata) } .sdata : { *(.sdata) }
.sbss 0 : { *(.sbss) } .sbss : { *(.sbss) }
.scommon 0 : { *(.scommon) } .scommon : { *(.scommon) }
" "
SOFT_REGS_RELOC=" SOFT_REGS_RELOC="
.softregs 0 : { *(.softregs) } .softregs : { *(.softregs) }
" "
cat <<EOF cat <<EOF
@ -172,113 +172,113 @@ ${RELOCATING+${MEMORY_DEF}}
SECTIONS SECTIONS
{ {
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.text ${RELOCATING-0} : .rel.text :
{ {
*(.rel.text) *(.rel.text)
${RELOCATING+*(.rel.text.*)} ${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t.*)} ${RELOCATING+*(.rel.gnu.linkonce.t.*)}
} }
.rela.text ${RELOCATING-0} : .rela.text :
{ {
*(.rela.text) *(.rela.text)
${RELOCATING+*(.rela.text.*)} ${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t.*)} ${RELOCATING+*(.rela.gnu.linkonce.t.*)}
} }
.rel.data ${RELOCATING-0} : .rel.data :
{ {
*(.rel.data) *(.rel.data)
${RELOCATING+*(.rel.data.*)} ${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d.*)} ${RELOCATING+*(.rel.gnu.linkonce.d.*)}
} }
.rela.data ${RELOCATING-0} : .rela.data :
{ {
*(.rela.data) *(.rela.data)
${RELOCATING+*(.rela.data.*)} ${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d.*)} ${RELOCATING+*(.rela.gnu.linkonce.d.*)}
} }
.rel.rodata ${RELOCATING-0} : .rel.rodata :
{ {
*(.rel.rodata) *(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)} ${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r.*)} ${RELOCATING+*(.rel.gnu.linkonce.r.*)}
} }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ {
*(.rela.rodata) *(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)} ${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r.*)} ${RELOCATING+*(.rela.gnu.linkonce.r.*)}
} }
.rel.sdata ${RELOCATING-0} : .rel.sdata :
{ {
*(.rel.sdata) *(.rel.sdata)
${RELOCATING+*(.rel.sdata.*)} ${RELOCATING+*(.rel.sdata.*)}
${RELOCATING+*(.rel.gnu.linkonce.s.*)} ${RELOCATING+*(.rel.gnu.linkonce.s.*)}
} }
.rela.sdata ${RELOCATING-0} : .rela.sdata :
{ {
*(.rela.sdata) *(.rela.sdata)
${RELOCATING+*(.rela.sdata.*)} ${RELOCATING+*(.rela.sdata.*)}
${RELOCATING+*(.rela.gnu.linkonce.s.*)} ${RELOCATING+*(.rela.gnu.linkonce.s.*)}
} }
.rel.sbss ${RELOCATING-0} : .rel.sbss :
{ {
*(.rel.sbss) *(.rel.sbss)
${RELOCATING+*(.rel.sbss.*)} ${RELOCATING+*(.rel.sbss.*)}
${RELOCATING+*(.rel.gnu.linkonce.sb.*)} ${RELOCATING+*(.rel.gnu.linkonce.sb.*)}
} }
.rela.sbss ${RELOCATING-0} : .rela.sbss :
{ {
*(.rela.sbss) *(.rela.sbss)
${RELOCATING+*(.rela.sbss.*)} ${RELOCATING+*(.rela.sbss.*)}
${RELOCATING+*(.rel.gnu.linkonce.sb.*)} ${RELOCATING+*(.rel.gnu.linkonce.sb.*)}
} }
.rel.bss ${RELOCATING-0} : .rel.bss :
{ {
*(.rel.bss) *(.rel.bss)
${RELOCATING+*(.rel.bss.*)} ${RELOCATING+*(.rel.bss.*)}
${RELOCATING+*(.rel.gnu.linkonce.b.*)} ${RELOCATING+*(.rel.gnu.linkonce.b.*)}
} }
.rela.bss ${RELOCATING-0} : .rela.bss :
{ {
*(.rela.bss) *(.rela.bss)
${RELOCATING+*(.rela.bss.*)} ${RELOCATING+*(.rela.bss.*)}
${RELOCATING+*(.rela.gnu.linkonce.b.*)} ${RELOCATING+*(.rela.gnu.linkonce.b.*)}
} }
.rel.stext ${RELOCATING-0} : { *(.rel.stest) } .rel.stext : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) } .rela.stext : { *(.rela.stest) }
.rel.etext ${RELOCATING-0} : { *(.rel.etest) } .rel.etext : { *(.rel.etest) }
.rela.etext ${RELOCATING-0} : { *(.rela.etest) } .rela.etext : { *(.rela.etest) }
.rel.sdata ${RELOCATING-0} : { *(.rel.sdata) } .rel.sdata : { *(.rel.sdata) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } .rela.sdata : { *(.rela.sdata) }
.rel.edata ${RELOCATING-0} : { *(.rel.edata) } .rel.edata : { *(.rel.edata) }
.rela.edata ${RELOCATING-0} : { *(.rela.edata) } .rela.edata : { *(.rela.edata) }
.rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) } .rel.eit_v : { *(.rel.eit_v) }
.rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) } .rela.eit_v : { *(.rela.eit_v) }
.rel.ebss ${RELOCATING-0} : { *(.rel.ebss) } .rel.ebss : { *(.rel.ebss) }
.rela.ebss ${RELOCATING-0} : { *(.rela.ebss) } .rela.ebss : { *(.rela.ebss) }
.rel.srodata ${RELOCATING-0} : { *(.rel.srodata) } .rel.srodata : { *(.rel.srodata) }
.rela.srodata ${RELOCATING-0} : { *(.rela.srodata) } .rela.srodata : { *(.rela.srodata) }
.rel.erodata ${RELOCATING-0} : { *(.rel.erodata) } .rel.erodata : { *(.rel.erodata) }
.rela.erodata ${RELOCATING-0} : { *(.rela.erodata) } .rela.erodata : { *(.rela.erodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
/* Concatenate .page0 sections. Put them in the page0 memory bank /* Concatenate .page0 sections. Put them in the page0 memory bank
unless we are creating a relocatable file. */ unless we are creating a relocatable file. */
@ -288,12 +288,12 @@ SECTIONS
} ${RELOCATING+ > page0} } ${RELOCATING+ > page0}
/* Start of text section. */ /* Start of text section. */
.stext ${RELOCATING-0} : .stext :
{ {
*(.stext) *(.stext)
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.init ${RELOCATING-0} : .init :
{ {
*(.init) *(.init)
} ${RELOCATING+=${NOP-0}} } ${RELOCATING+=${NOP-0}}
@ -301,7 +301,7 @@ SECTIONS
${RELOCATING-${INSTALL_RELOC}} ${RELOCATING-${INSTALL_RELOC}}
${RELOCATING-${FINISH_RELOC}} ${RELOCATING-${FINISH_RELOC}}
.text ${RELOCATING-0}: .text :
{ {
/* Put startup code at beginning so that _start keeps same address. */ /* Put startup code at beginning so that _start keeps same address. */
${RELOCATING+${STARTUP_CODE}} ${RELOCATING+${STARTUP_CODE}}
@ -322,17 +322,17 @@ SECTIONS
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
} ${RELOCATING+ > ${TEXT_MEMORY} =0xa7a7a7a7} } ${RELOCATING+ > ${TEXT_MEMORY} =0xa7a7a7a7}
.eh_frame ${RELOCATING-0} : .eh_frame :
{ {
KEEP (*(.eh_frame)) KEEP (*(.eh_frame))
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.gcc_except_table ${RELOCATING-0} : .gcc_except_table :
{ {
*(.gcc_except_table) *(.gcc_except_table)
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
.rodata ${RELOCATING-0} : .rodata :
{ {
*(.rodata) *(.rodata)
${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.rodata.*)}
@ -340,7 +340,7 @@ SECTIONS
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
} ${RELOCATING+ > ${TEXT_MEMORY} =0xffffffff} } ${RELOCATING+ > ${TEXT_MEMORY} =0xffffffff}
.rodata1 ${RELOCATING-0} : .rodata1 :
{ {
*(.rodata1) *(.rodata1)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
@ -350,7 +350,7 @@ SECTIONS
${RELOCATING+${CTOR}} ${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}} ${RELOCATING+${DTOR}}
.jcr ${RELOCATING-0} : .jcr :
{ {
KEEP (*(.jcr)) KEEP (*(.jcr))
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
@ -363,7 +363,7 @@ SECTIONS
We construct the DATA image section in PROM at end of all these We construct the DATA image section in PROM at end of all these
read-only sections. The data image must be copied at init time. read-only sections. The data image must be copied at init time.
Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */ Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */
.data ${RELOCATING-0} : ${RELOCATING+AT (__data_image)} .data : ${RELOCATING+AT (__data_image)}
{ {
${RELOCATING+__data_section_start = .;} ${RELOCATING+__data_section_start = .;}
${RELOCATING+PROVIDE (__data_section_start = .);} ${RELOCATING+PROVIDE (__data_section_start = .);}
@ -387,7 +387,7 @@ SECTIONS
${RELOCATING+${PRE_COMPUTE_DATA_SIZE}} ${RELOCATING+${PRE_COMPUTE_DATA_SIZE}}
/* .install ${RELOCATING-0}: /* .install :
{ {
. = _data_image_end; . = _data_image_end;
} ${RELOCATING+ > ${TEXT_MEMORY}} */ } ${RELOCATING+ > ${TEXT_MEMORY}} */
@ -396,7 +396,7 @@ SECTIONS
${RELOCATING-${BSS_DATA_RELOC}} ${RELOCATING-${BSS_DATA_RELOC}}
${RELOCATING-${SOFT_REGS_RELOC}} ${RELOCATING-${SOFT_REGS_RELOC}}
.bss ${RELOCATING-0} : .bss :
{ {
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
${RELOCATING+*(.softregs)} ${RELOCATING+*(.softregs)}
@ -413,7 +413,7 @@ SECTIONS
${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+__bss_size = SIZEOF(.bss);}
${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));}
.eeprom ${RELOCATING-0} : .eeprom :
{ {
*(.eeprom) *(.eeprom)
*(.eeprom.*) *(.eeprom.*)

View File

@ -5,7 +5,7 @@ test -z "$ENTRY" && ENTRY=_start
#test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x0" #test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x0"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -31,7 +31,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))

View File

@ -123,30 +123,30 @@ if test -n "${COMMONPAGESIZE}"; then
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
fi fi
if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" INITIAL_READONLY_SECTIONS=".interp : { *(.interp) }"
fi fi
if test -z "$PLT"; then if test -z "$PLT"; then
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
fi fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got : { *(.got.plt) *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }" GOTPLT=".got.plt : { *(.got.plt) }"
fi fi
fi fi
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" DYNAMIC=".dynamic : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }"
DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
INIT_LIT=".init.literal 0 : { *(.init.literal) }" INIT_LIT=".init.literal : { *(.init.literal) }"
INIT=".init 0 : { *(.init) }" INIT=".init : { *(.init) }"
FINI_LIT=".fini.literal 0 : { *(.fini.literal) }" FINI_LIT=".fini.literal : { *(.fini.literal) }"
FINI=".fini 0 : { *(.fini) }" FINI=".fini : { *(.fini) }"
if test -z "${NO_SMALL_DATA}"; then if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} : SBSS=".sbss :
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
@ -155,29 +155,29 @@ if test -z "${NO_SMALL_DATA}"; then
*(.scommon) *(.scommon)
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets SDATA="/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : SDATA2=".sdata2 :
{ {
${RELOCATING+${SDATA2_START_SYMBOLS}} ${RELOCATING+${SDATA2_START_SYMBOLS}}
*(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*})
}" }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
else else
NO_SMALL_DATA=" " NO_SMALL_DATA=" "
fi fi
@ -193,31 +193,31 @@ if test -z "${SDATA_GOT}"; then
fi fi
test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
test "${LARGE_SECTIONS}" = "yes" && REL_LARGE=" test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
.rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) } .rel.ldata : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
.rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) } .rela.ldata : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
.rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) } .rel.lbss : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
.rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) } .rela.lbss : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
.rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) } .rel.lrodata : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
.rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }" .rela.lrodata : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
.lbss ${RELOCATING-0} : .lbss :
{ {
*(.dynlbss) *(.dynlbss)
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
*(LARGE_COMMON) *(LARGE_COMMON)
}" }"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .lrodata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
{ {
*(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*}) *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
} }
.ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .ldata ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
{ {
*(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}" }"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -243,7 +243,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
KEEP (*(.ctors)) KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=".dtors ${CONSTRUCTING-0} : DTOR=".dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -253,7 +253,7 @@ DTOR=".dtors ${CONSTRUCTING-0} :
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
}" }"
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+_stack = .;} ${RELOCATING+_stack = .;}
*(.stack) *(.stack)
@ -272,10 +272,6 @@ ${RELOCATING+ENTRY(${ENTRY})}
${RELOCATING+${LIB_SEARCH_DIRS}} ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
@ -291,13 +287,13 @@ test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC= test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
cat > ldscripts/dyntmp.$$ <<EOF cat > ldscripts/dyntmp.$$ <<EOF
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.gnu.hash ${RELOCATING-0} : { *(.gnu.hash) } .gnu.hash : { *(.gnu.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
EOF EOF
if [ "x$COMBRELOC" = x ]; then if [ "x$COMBRELOC" = x ]; then
@ -306,48 +302,48 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } .rel.text : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } .rela.text : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } .rel.rodata : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } .rela.rodata : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) } .rel.data.rel.ro : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) }
.rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) } .rela.data.rel.ro : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) }
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } .rel.data : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } .rela.data : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) } .rel.tdata : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) } .rela.tdata : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) } .rel.tbss : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
.rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) } .rela.tbss : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
${REL_SDATA} ${REL_SDATA}
${REL_SBSS} ${REL_SBSS}
${REL_SDATA2} ${REL_SDATA2}
${REL_SBSS2} ${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rel.bss : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } .rela.bss : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
${REL_LARGE} ${REL_LARGE}
EOF EOF
if [ -n "$COMBRELOC" ]; then if [ -n "$COMBRELOC" ]; then
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
.rel.dyn ${RELOCATING-0} : .rel.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
} }
.rela.dyn ${RELOCATING-0} : .rela.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
@ -357,8 +353,8 @@ EOF
fi fi
cat >> ldscripts/dyntmp.$$ <<EOF cat >> ldscripts/dyntmp.$$ <<EOF
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}
EOF EOF
@ -382,7 +378,7 @@ cat <<EOF
${TEXT_PLT+${PLT}} ${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION} ${TINY_READONLY_SECTION}
.text ${RELOCATING-0} : .text :
{ {
*(.got.plt* .plt*) *(.got.plt* .plt*)
@ -410,13 +406,13 @@ cat <<EOF
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
${WRITABLE_RODATA-${RODATA}} ${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -425,27 +421,27 @@ cat <<EOF
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } .tbss : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
.preinit_array ${RELOCATING-0} : .preinit_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
} }
.init_array ${RELOCATING-0} : .init_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
} }
.fini_array ${RELOCATING-0} : .fini_array :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
KEEP (*(.fini_array)) KEEP (*(.fini_array))
@ -454,7 +450,7 @@ cat <<EOF
} }
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}} ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${RELOCATING+${DATARELRO}} ${RELOCATING+${DATARELRO}}
${OTHER_RELRO_SECTIONS} ${OTHER_RELRO_SECTIONS}
@ -468,13 +464,13 @@ cat <<EOF
${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
@ -490,7 +486,7 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})

View File

@ -64,13 +64,13 @@ if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHI
test -z "${ELFSIZE}" && ELFSIZE=32 test -z "${ELFSIZE}" && ELFSIZE=32
test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" DYNAMIC=".dynamic : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }" RODATA=".rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) ${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)} }" SBSS2=".sbss2 : { *(.sbss2) ${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)} }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) ${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)} }" SDATA2=".sdata2 : { *(.sdata2) ${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)} }"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -97,7 +97,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -126,10 +126,6 @@ ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
@ -145,109 +141,109 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : .rel.text :
{ {
*(.rel.text) *(.rel.text)
${RELOCATING+*(.rel.text.*)} ${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t.*)} ${RELOCATING+*(.rel.gnu.linkonce.t.*)}
} }
.rela.text ${RELOCATING-0} : .rela.text :
{ {
*(.rela.text) *(.rela.text)
${RELOCATING+*(.rela.text.*)} ${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t.*)} ${RELOCATING+*(.rela.gnu.linkonce.t.*)}
} }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : .rel.rodata :
{ {
*(.rel.rodata) *(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)} ${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r.*)} ${RELOCATING+*(.rel.gnu.linkonce.r.*)}
} }
.rela.rodata ${RELOCATING-0} : .rela.rodata :
{ {
*(.rela.rodata) *(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)} ${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r.*)} ${RELOCATING+*(.rela.gnu.linkonce.r.*)}
} }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data ${RELOCATING-0} : .rel.data :
{ {
*(.rel.data) *(.rel.data)
${RELOCATING+*(.rel.data.*)} ${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d.*)} ${RELOCATING+*(.rel.gnu.linkonce.d.*)}
} }
.rela.data ${RELOCATING-0} : .rela.data :
{ {
*(.rela.data) *(.rela.data)
${RELOCATING+*(.rela.data.*)} ${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d.*)} ${RELOCATING+*(.rela.gnu.linkonce.d.*)}
} }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
.rel.sdata ${RELOCATING-0} : .rel.sdata :
{ {
*(.rel.sdata) *(.rel.sdata)
${RELOCATING+*(.rel.sdata.*)} ${RELOCATING+*(.rel.sdata.*)}
${RELOCATING+*(.rel.gnu.linkonce.s.*)} ${RELOCATING+*(.rel.gnu.linkonce.s.*)}
} }
.rela.sdata ${RELOCATING-0} : .rela.sdata :
{ {
*(.rela.sdata) *(.rela.sdata)
${RELOCATING+*(.rela.sdata.*)} ${RELOCATING+*(.rela.sdata.*)}
${RELOCATING+*(.rela.gnu.linkonce.s.*)} ${RELOCATING+*(.rela.gnu.linkonce.s.*)}
} }
.rel.sbss ${RELOCATING-0} : .rel.sbss :
{ {
*(.rel.sbss) *(.rel.sbss)
${RELOCATING+*(.rel.sbss.*)} ${RELOCATING+*(.rel.sbss.*)}
${RELOCATING+*(.rel.gnu.linkonce.sb.*)} ${RELOCATING+*(.rel.gnu.linkonce.sb.*)}
} }
.rela.sbss ${RELOCATING-0} : .rela.sbss :
{ {
*(.rela.sbss) *(.rela.sbss)
${RELOCATING+*(.rela.sbss.*)} ${RELOCATING+*(.rela.sbss.*)}
${RELOCATING+*(.rela.gnu.linkonce.sb.*)} ${RELOCATING+*(.rela.gnu.linkonce.sb.*)}
} }
.rel.sdata2 ${RELOCATING-0} : .rel.sdata2 :
{ {
*(.rel.sdata2) *(.rel.sdata2)
${RELOCATING+*(.rel.sdata2.*)} ${RELOCATING+*(.rel.sdata2.*)}
${RELOCATING+*(.rel.gnu.linkonce.s2.*)} ${RELOCATING+*(.rel.gnu.linkonce.s2.*)}
} }
.rela.sdata2 ${RELOCATING-0} : .rela.sdata2 :
{ {
*(.rela.sdata2) *(.rela.sdata2)
${RELOCATING+*(.rela.sdata2.*)} ${RELOCATING+*(.rela.sdata2.*)}
${RELOCATING+*(.rela.gnu.linkonce.s2.*)} ${RELOCATING+*(.rela.gnu.linkonce.s2.*)}
} }
.rel.sbss2 ${RELOCATING-0} : .rel.sbss2 :
{ {
*(.rel.sbss2) *(.rel.sbss2)
${RELOCATING+*(.rel.sbss2.*)} ${RELOCATING+*(.rel.sbss2.*)}
${RELOCATING+*(.rel.gnu.linkonce.sb2.*)} ${RELOCATING+*(.rel.gnu.linkonce.sb2.*)}
} }
.rela.sbss2 ${RELOCATING-0} : .rela.sbss2 :
{ {
*(.rela.sbss2) *(.rela.sbss2)
${RELOCATING+*(.rela.sbss2.*)} ${RELOCATING+*(.rela.sbss2.*)}
${RELOCATING+*(.rela.gnu.linkonce.sb2.*)} ${RELOCATING+*(.rela.gnu.linkonce.sb2.*)}
} }
.rel.bss ${RELOCATING-0} : .rel.bss :
{ {
*(.rel.bss) *(.rel.bss)
${RELOCATING+*(.rel.bss.*)} ${RELOCATING+*(.rel.bss.*)}
${RELOCATING+*(.rel.gnu.linkonce.b.*)} ${RELOCATING+*(.rel.gnu.linkonce.b.*)}
} }
.rela.bss ${RELOCATING-0} : .rela.bss :
{ {
*(.rela.bss) *(.rela.bss)
${RELOCATING+*(.rela.bss.*)} ${RELOCATING+*(.rela.bss.*)}
@ -271,11 +267,11 @@ cat <<EOF
EOF EOF
fi fi
cat <<EOF cat <<EOF
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}
.init ${RELOCATING-0} : .init :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
@ -283,7 +279,7 @@ cat <<EOF
} =${NOP-0} } =${NOP-0}
${DATA_PLT-${BSS_PLT-${PLT}}} ${DATA_PLT-${BSS_PLT-${PLT}}}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text) *(.text)
@ -294,7 +290,7 @@ cat <<EOF
${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+*(.gnu.linkonce.t.*)}
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0} } =${NOP-0}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
@ -309,7 +305,7 @@ cat <<EOF
${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}} ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data) *(.data)
@ -317,8 +313,8 @@ cat <<EOF
${RELOCATING+*(.gnu.linkonce.d.*)} ${RELOCATING+*(.gnu.linkonce.d.*)}
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
.eh_frame ${RELOCATING-0} : .eh_frame :
{ {
${RELOCATING+PROVIDE (__eh_frame_begin = .);} ${RELOCATING+PROVIDE (__eh_frame_begin = .);}
*(.eh_frame) *(.eh_frame)
@ -327,14 +323,14 @@ cat <<EOF
} ${RELOCATING+} } ${RELOCATING+}
.gcc_except_table : { *(.gcc_except_table) } .gcc_except_table : { *(.gcc_except_table) }
${INITIAL_READONLY_SECTIONS} ${INITIAL_READONLY_SECTIONS}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
${RODATA} ${RODATA}
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${RELOCATING+${OTHER_READONLY_SECTIONS}} ${RELOCATING+${OTHER_READONLY_SECTIONS}}
@ -345,14 +341,14 @@ cat <<EOF
.jcr : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${DATA_PLT+${PLT}} ${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}} ${RELOCATING+${OTHER_GOT_SYMBOLS}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) } .got : { *(.got.plt) *(.got) }
${RELOCATING+${OTHER_GOT_SECTIONS}} ${RELOCATING+${OTHER_GOT_SECTIONS}}
${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}} ${CREATE_SHLIB+${SBSS2}}
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
*(.sdata) *(.sdata)
@ -364,7 +360,7 @@ cat <<EOF
${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
.sbss ${RELOCATING-0} : .sbss :
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
@ -377,7 +373,7 @@ cat <<EOF
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
} }
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss) *(.bss)

View File

@ -100,23 +100,23 @@ if test -n "${COMMONPAGESIZE}"; then
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (0, .);" DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (0, .);"
fi fi
fi fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got : { *(.got.plt) *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got : { *(.got) }"
GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}} GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}}
.got.plt ${RELOCATING-0} : { *(.got.plt) }" .got.plt : { *(.got.plt) }"
fi fi
fi fi
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" DYNAMIC=".dynamic : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
if test -z "${NO_SMALL_DATA}"; then if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} : SBSS=".sbss :
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
@ -127,30 +127,30 @@ if test -z "${NO_SMALL_DATA}"; then
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets SDATA="/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : .sdata :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${RELOCATING+${SDATA_START_SYMBOLS}}
${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }" SDATA2=".sdata2 : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } REL_SDATA=".rel.sdata : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" .rela.sdata : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } REL_SBSS=".rel.sbss : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" .rela.sbss : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } REL_SDATA2=".rel.sdata2 : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" .rela.sdata2 : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } REL_SBSS2=".rel.sbss2 : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" .rela.sbss2 : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
else else
NO_SMALL_DATA=" " NO_SMALL_DATA=" "
fi fi
test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -175,7 +175,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
KEEP (*(.ctors)) KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
}" }"
DTOR=".dtors ${CONSTRUCTING-0} : DTOR=".dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin*.o(.dtors)) KEEP (*crtbegin*.o(.dtors))
@ -184,7 +184,7 @@ DTOR=".dtors ${CONSTRUCTING-0} :
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}} ${CONSTRUCTING+${DTOR_END}}
}" }"
STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : STACK=" .stack ${RELOCATING+${STACK_ADDR}} :
{ {
${RELOCATING+_stack = .;} ${RELOCATING+_stack = .;}
*(.stack) *(.stack)
@ -208,10 +208,6 @@ ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
@ -222,12 +218,12 @@ SECTIONS
${CREATE_SHLIB-${INTERP}} ${CREATE_SHLIB-${INTERP}}
${INITIAL_READONLY_SECTIONS} ${INITIAL_READONLY_SECTIONS}
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
EOF EOF
if [ "x$COMBRELOC" = x ]; then if [ "x$COMBRELOC" = x ]; then
@ -236,46 +232,46 @@ else
COMBRELOCCAT="cat > $COMBRELOC" COMBRELOCCAT="cat > $COMBRELOC"
fi fi
eval $COMBRELOCCAT <<EOF eval $COMBRELOCCAT <<EOF
.rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.init : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.init : { *(.rela.init) }
.rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } .rel.text : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } .rela.text : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) } .rel.fini : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) } .rela.fini : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } .rel.rodata : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } .rela.rodata : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS} ${OTHER_READONLY_RELOC_SECTIONS}
.rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) } .rel.data.rel.ro : { *(.rel.data.rel.ro${RELOCATING+*}) }
.rela.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) } .rela.data.rel.ro : { *(.rel.data.rel.ro${RELOCATING+*}) }
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } .rel.data : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } .rela.data : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) } .rel.tdata : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) } .rela.tdata : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) } .rel.tbss : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
.rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) } .rela.tbss : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
${OTHER_GOT_RELOC_SECTIONS} ${OTHER_GOT_RELOC_SECTIONS}
${REL_SDATA} ${REL_SDATA}
${REL_SBSS} ${REL_SBSS}
${REL_SDATA2} ${REL_SDATA2}
${REL_SBSS2} ${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rel.bss : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } .rela.bss : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
EOF EOF
if [ -n "$COMBRELOC" ]; then if [ -n "$COMBRELOC" ]; then
cat <<EOF cat <<EOF
.rel.dyn ${RELOCATING-0} : .rel.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
cat <<EOF cat <<EOF
} }
.rela.dyn ${RELOCATING-0} : .rela.dyn :
{ {
EOF EOF
sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
@ -284,11 +280,11 @@ cat <<EOF
EOF EOF
fi fi
cat <<EOF cat <<EOF
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}
.init ${RELOCATING-0} : .init :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
@ -296,7 +292,7 @@ cat <<EOF
} =${NOP-0} } =${NOP-0}
${DATA_PLT-${BSS_PLT-${PLT}}} ${DATA_PLT-${BSS_PLT-${PLT}}}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
@ -304,7 +300,7 @@ cat <<EOF
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0} } =${NOP-0}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
@ -314,13 +310,13 @@ cat <<EOF
${RELOCATING+PROVIDE (_etext = .);} ${RELOCATING+PROVIDE (_etext = .);}
${RELOCATING+PROVIDE (etext = .);} ${RELOCATING+PROVIDE (etext = .);}
${WRITABLE_RODATA-${RODATA}} ${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -329,20 +325,20 @@ cat <<EOF
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } .tbss : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
.preinit_array ${RELOCATING-0} : { KEEP (*(.preinit_array)) } .preinit_array : { KEEP (*(.preinit_array)) }
.init_array ${RELOCATING-0} : { KEEP (*(.init_array)) } .init_array : { KEEP (*(.init_array)) }
.fini_array ${RELOCATING-0} : { KEEP (*(.fini_array)) } .fini_array : { KEEP (*(.fini_array)) }
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}} ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${RELOCATING+${DATARELRO}} ${RELOCATING+${DATARELRO}}
${OTHER_RELRO_SECTIONS} ${OTHER_RELRO_SECTIONS}
@ -355,13 +351,13 @@ cat <<EOF
${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
@ -378,7 +374,7 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})

View File

@ -23,8 +23,8 @@
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test "$LD_FLAG" = "N" && DATA_ADDR=. test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt : { *(.plt) }"
cat <<EOF cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}") "${LITTLE_OUTPUT_FORMAT}")
@ -34,38 +34,35 @@ ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+/* Do we need any of these for elf? ${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}} ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}} ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}} ${CREATE_SHLIB-${INTERP}}
.hash ${RELOCATING-0} : { *(.hash) } .hash : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) } .dynsym : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) } .dynstr : { *(.dynstr) }
.rel.text ${RELOCATING-0} : { *(.rel.text) } .rel.text : { *(.rel.text) }
.rela.text ${RELOCATING-0} : { *(.rela.text) } .rela.text : { *(.rela.text) }
.rel.data ${RELOCATING-0} : { *(.rel.data) } .rel.data : { *(.rel.data) }
.rela.data ${RELOCATING-0} : { *(.rela.data) } .rela.data : { *(.rela.data) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata) } .rel.rodata : { *(.rel.rodata) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata) } .rela.rodata : { *(.rela.rodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) } .rel.got : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) } .rela.got : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } .rel.ctors : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } .rela.ctors : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.dtors : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.dtors : { *(.rela.dtors) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.bss : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.bss : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
.init ${RELOCATING-0} : { *(.init) } =${NOP-0} .init : { *(.init) } =${NOP-0}
${DATA_PLT-${PLT}} ${DATA_PLT-${PLT}}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text) *(.text)
@ -82,36 +79,36 @@ SECTIONS
} }
${RELOCATING+_etext = .;} ${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);} ${RELOCATING+PROVIDE (etext = .);}
.fini ${RELOCATING-0} : { *(.fini) } =${NOP-0} .fini : { *(.fini) } =${NOP-0}
.ctors ${RELOCATING-0} : { *(.ctors) } .ctors : { *(.ctors) }
.dtors ${RELOCATING-0} : { *(.dtors) } .dtors : { *(.dtors) }
.rodata ${RELOCATING-0} : { *(.rodata) } .rodata : { *(.rodata) }
.rodata1 ${RELOCATING-0} : { *(.rodata1) } .rodata1 : { *(.rodata1) }
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
/* Read-write section, merged into data segment: */ /* Read-write section, merged into data segment: */
${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};} ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data) *(.data)
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 : { *(.data1) }
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) } .got : { *(.got.plt) *(.got) }
.dynamic ${RELOCATING-0} : { *(.dynamic) } .dynamic : { *(.dynamic) }
${DATA_PLT+${PLT}} ${DATA_PLT+${PLT}}
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { *(.sdata) } .sdata : { *(.sdata) }
${RELOCATING+_edata = .;} ${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
.sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } .sbss : { *(.sbss) *(.scommon) }
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss) *(.bss)

View File

@ -5,7 +5,7 @@ ${RELOCATING+${LIB_SEARCH_DIRS}}
SECTIONS SECTIONS
{ {
.text ${RELOCATING:-0} ${RELOCATING+${TEXT_START_ADDR}} : { .text ${RELOCATING+${TEXT_START_ADDR}} : {
${RELOCATING+ start = DEFINED(_START) ? _START : DEFINED(_start) ? _start : .;} ${RELOCATING+ start = DEFINED(_START) ? _START : DEFINED(_start) ? _start : .;}
${RELOCATING+ PROVIDE(__text = .);} ${RELOCATING+ PROVIDE(__text = .);}
*(.text); *(.text);
@ -31,14 +31,14 @@ SECTIONS
${RELOCATING+ PROVIDE(__etext = .);} ${RELOCATING+ PROVIDE(__etext = .);}
${RELOCATING+ PROVIDE(_etext = .);} ${RELOCATING+ PROVIDE(_etext = .);}
} }
.data ${RELOCATING:-0} : ${RELOCATING+ AT(ADDR(.text) + SIZEOF(.text))} { .data : ${RELOCATING+ AT(ADDR(.text) + SIZEOF(.text))} {
${RELOCATING+ PROVIDE(__data = .);} ${RELOCATING+ PROVIDE(__data = .);}
*(.data); *(.data);
*(vars); *(vars);
${RELOCATING+ PROVIDE(__edata = .);} ${RELOCATING+ PROVIDE(__edata = .);}
${RELOCATING+ PROVIDE(_edata = .);} ${RELOCATING+ PROVIDE(_edata = .);}
} }
.bss ${RELOCATING:-0} : .bss :
{ {
${RELOCATING+ PROVIDE(__bss = .);} ${RELOCATING+ PROVIDE(__bss = .);}
*(.bss); *(.bss);

View File

@ -1,5 +1,6 @@
# default linker script for c54x, TI COFF(1). # default linker script for c54x, TI COFF(1).
# patterned after description in TI Assembler Tools PDF, SPRU102C, 7-53 # patterned after description in TI Assembler Tools PDF, SPRU102C, 7-53
test -z "$RELOCATING" && exit 0
test -z "$ENTRY" && ENTRY=_c_int00 test -z "$ENTRY" && ENTRY=_c_int00
cat <<EOF cat <<EOF
@ -12,7 +13,7 @@ MEMORY
/*PAGE 1 : */ data (W) : ORIGIN = 0x01000080, LENGTH = 0xFF80 /*PAGE 1 : */ data (W) : ORIGIN = 0x01000080, LENGTH = 0xFF80
} }
${RELOCATING+ENTRY (${ENTRY})} ENTRY (${ENTRY})
SECTIONS SECTIONS
{ {

View File

@ -54,7 +54,7 @@ test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test -z "${ELFSIZE}" && ELFSIZE=32 test -z "${ELFSIZE}" && ELFSIZE=32
test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
CTOR=".ctors ${CONSTRUCTING-0} : CTOR=".ctors :
{ {
${CONSTRUCTING+${CTOR_START}} ${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
@ -81,7 +81,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+${CTOR_END}}
} > ROM" } > ROM"
DTOR=" .dtors ${CONSTRUCTING-0} : DTOR=" .dtors :
{ {
${CONSTRUCTING+${DTOR_START}} ${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
@ -101,10 +101,6 @@ ${RELOCATING+ENTRY(${ENTRY})}
${RELOCATING+${LIB_SEARCH_DIRS}} ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}} ${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
/* There are two memory regions we care about, one from 0 through 0x7F00 /* There are two memory regions we care about, one from 0 through 0x7F00
that is RAM and one from 0x8000 up which is ROM. */ that is RAM and one from 0x8000 up which is ROM. */
@ -116,7 +112,7 @@ MEMORY
SECTIONS SECTIONS
{ {
.data ${RELOCATING-0} : .data :
{ {
${RELOCATING+__rdata = .;} ${RELOCATING+__rdata = .;}
${RELOCATING+__data = .;} ${RELOCATING+__data = .;}
@ -133,7 +129,7 @@ SECTIONS
${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
.bss ${RELOCATING-0} : .bss :
{ {
*(.dynbss) *(.dynbss)
*(.bss) *(.bss)
@ -153,9 +149,9 @@ SECTIONS
${RELOCATING+PROVIDE (end = .);} ${RELOCATING+PROVIDE (end = .);}
/* Read-only sections in ROM. */ /* Read-only sections in ROM. */
.int_vec ${RELOCATING-0} : { *(.int_vec) } ${RELOCATING+> ROM} .int_vec : { *(.int_vec) } ${RELOCATING+> ROM}
.rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} } ${RELOCATING+> ROM} .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} } ${RELOCATING+> ROM}
${RELOCATING+${CTOR}} ${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}} ${RELOCATING+${DTOR}}
.jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM} .jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM}
@ -163,7 +159,7 @@ SECTIONS
.gcc_except_table : { *(.gcc_except_table) } ${RELOCATING+> ROM} .gcc_except_table : { *(.gcc_except_table) } ${RELOCATING+> ROM}
.plt : { *(.plt) } ${RELOCATING+> ROM} .plt : { *(.plt) } ${RELOCATING+> ROM}
.text ${RELOCATING-0} : .text :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text) *(.text)
@ -174,13 +170,13 @@ SECTIONS
${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+*(.gnu.linkonce.t.*)}
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} ${RELOCATING+> ROM =${NOP-0}} } ${RELOCATING+> ROM =${NOP-0}}
.init ${RELOCATING-0} : .init :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
${RELOCATING+${INIT_END}} ${RELOCATING+${INIT_END}}
} ${RELOCATING+> ROM =${NOP-0}} } ${RELOCATING+> ROM =${NOP-0}}
.fini ${RELOCATING-0} : .fini :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))