* scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections.
Add new BSS_PLT variable for when .plt need not be contained in the file. Move _etext so that it is also after .fini, and provide both etext and _etext with a leading underscore. Mark the start and end of .sbss.
This commit is contained in:
parent
65edb64b15
commit
6c86c54107
|
@ -1,3 +1,11 @@
|
||||||
|
2000-04-13 Geoff Keating <geoffk@cygnus.com>
|
||||||
|
|
||||||
|
* scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections.
|
||||||
|
Add new BSS_PLT variable for when .plt need not be contained in
|
||||||
|
the file. Move _etext so that it is also after .fini, and provide
|
||||||
|
both etext and _etext with a leading underscore. Mark the start
|
||||||
|
and end of .sbss.
|
||||||
|
|
||||||
2000-04-12 Alan Modra <alan@linuxcare.com.au>
|
2000-04-12 Alan Modra <alan@linuxcare.com.au>
|
||||||
|
|
||||||
* emultempl/elf32.em (struct orphan_save): New.
|
* emultempl/elf32.em (struct orphan_save): New.
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
|
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
|
||||||
# .bss section besides __bss_start.
|
# .bss section besides __bss_start.
|
||||||
# DATA_PLT - .plt should be in data segment, not text segment.
|
# DATA_PLT - .plt should be in data segment, not text segment.
|
||||||
|
# BSS_PLT - .plt should be in bss segment
|
||||||
# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
|
# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
|
||||||
# EMBEDDED - whether this is for an embedded system.
|
# EMBEDDED - whether this is for an embedded system.
|
||||||
# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
|
# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
|
||||||
|
@ -47,6 +48,8 @@ INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
|
||||||
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
|
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
|
||||||
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
|
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
|
||||||
RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r*)} }"
|
RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r*)} }"
|
||||||
|
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) }"
|
||||||
|
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) }"
|
||||||
CTOR=".ctors ${CONSTRUCTING-0} :
|
CTOR=".ctors ${CONSTRUCTING-0} :
|
||||||
{
|
{
|
||||||
${CONSTRUCTING+${CTOR_START}}
|
${CONSTRUCTING+${CTOR_START}}
|
||||||
|
@ -121,8 +124,6 @@ SECTIONS
|
||||||
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
|
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
|
||||||
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
|
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
|
||||||
|
|
||||||
.rel.init ${RELOCATING-0} : { *(.rel.init) }
|
|
||||||
.rela.init ${RELOCATING-0} : { *(.rela.init) }
|
|
||||||
.rel.text ${RELOCATING-0} :
|
.rel.text ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
*(.rel.text)
|
*(.rel.text)
|
||||||
|
@ -135,6 +136,8 @@ SECTIONS
|
||||||
${RELOCATING+*(.rela.text.*)}
|
${RELOCATING+*(.rela.text.*)}
|
||||||
${RELOCATING+*(.rela.gnu.linkonce.t*)}
|
${RELOCATING+*(.rela.gnu.linkonce.t*)}
|
||||||
}
|
}
|
||||||
|
.rel.init ${RELOCATING-0} : { *(.rel.init) }
|
||||||
|
.rela.init ${RELOCATING-0} : { *(.rela.init) }
|
||||||
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
|
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
|
||||||
.rela.fini ${RELOCATING-0} : { *(.rela.fini) }
|
.rela.fini ${RELOCATING-0} : { *(.rela.fini) }
|
||||||
.rel.rodata ${RELOCATING-0} :
|
.rel.rodata ${RELOCATING-0} :
|
||||||
|
@ -183,20 +186,19 @@ SECTIONS
|
||||||
}
|
}
|
||||||
.rel.sbss ${RELOCATING-0} : { *(.rel.sbss) }
|
.rel.sbss ${RELOCATING-0} : { *(.rel.sbss) }
|
||||||
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
|
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
|
||||||
|
.rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2) }
|
||||||
|
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2) }
|
||||||
|
.rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2) }
|
||||||
|
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2) }
|
||||||
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
|
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
|
||||||
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
|
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
|
||||||
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
|
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
|
||||||
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
|
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
|
||||||
${OTHER_PLT_RELOC_SECTIONS}
|
${OTHER_PLT_RELOC_SECTIONS}
|
||||||
|
|
||||||
.init ${RELOCATING-0} :
|
${DATA_PLT-${BSS_PLT-${PLT}}}
|
||||||
{
|
/* .text should be before .init and so on, so that -Ttext=0x1234
|
||||||
${INIT_START}
|
will work. */
|
||||||
KEEP (*(.init))
|
|
||||||
${INIT_END}
|
|
||||||
} =${NOP-0}
|
|
||||||
|
|
||||||
${DATA_PLT-${PLT}}
|
|
||||||
.text ${RELOCATING-0} :
|
.text ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
${RELOCATING+${TEXT_START_SYMBOLS}}
|
${RELOCATING+${TEXT_START_SYMBOLS}}
|
||||||
|
@ -208,16 +210,25 @@ SECTIONS
|
||||||
${RELOCATING+*(.gnu.linkonce.t*)}
|
${RELOCATING+*(.gnu.linkonce.t*)}
|
||||||
${RELOCATING+${OTHER_TEXT_SECTIONS}}
|
${RELOCATING+${OTHER_TEXT_SECTIONS}}
|
||||||
} =${NOP-0}
|
} =${NOP-0}
|
||||||
${RELOCATING+_etext = .;}
|
.init ${RELOCATING-0} :
|
||||||
${RELOCATING+PROVIDE (etext = .);}
|
{
|
||||||
|
${INIT_START}
|
||||||
|
KEEP (*(.init))
|
||||||
|
${INIT_END}
|
||||||
|
} =${NOP-0}
|
||||||
.fini ${RELOCATING-0} :
|
.fini ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
${FINI_START}
|
${FINI_START}
|
||||||
KEEP (*(.fini))
|
KEEP (*(.fini))
|
||||||
${FINI_END}
|
${FINI_END}
|
||||||
} =${NOP-0}
|
} =${NOP-0}
|
||||||
|
${RELOCATING+PROVIDE (__etext = .);}
|
||||||
|
${RELOCATING+PROVIDE (_etext = .);}
|
||||||
|
${RELOCATING+PROVIDE (etext = .);}
|
||||||
${WRITABLE_RODATA-${RODATA}}
|
${WRITABLE_RODATA-${RODATA}}
|
||||||
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
|
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
|
||||||
|
${CREATE_SHLIB-${SDATA2}}
|
||||||
|
${CREATE_SHLIB-${SBSS2}}
|
||||||
${RELOCATING+${OTHER_READONLY_SECTIONS}}
|
${RELOCATING+${OTHER_READONLY_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
|
||||||
|
@ -242,7 +253,9 @@ SECTIONS
|
||||||
${RELOCATING+${DTOR}}
|
${RELOCATING+${DTOR}}
|
||||||
${DATA_PLT+${PLT}}
|
${DATA_PLT+${PLT}}
|
||||||
${RELOCATING+${OTHER_GOT_SYMBOLS}}
|
${RELOCATING+${OTHER_GOT_SYMBOLS}}
|
||||||
.got ${RELOCATING-0} : { *(.got.plt) *(.got) }
|
.got ${RELOCATING-0} : { *(.got.plt) *(.got) }
|
||||||
|
${CREATE_SHLIB+${SDATA2}}
|
||||||
|
${CREATE_SHLIB+${SBSS2}}
|
||||||
${TEXT_DYNAMIC-${DYNAMIC}}
|
${TEXT_DYNAMIC-${DYNAMIC}}
|
||||||
/* 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
|
||||||
|
@ -261,11 +274,16 @@ SECTIONS
|
||||||
${RELOCATING+${OTHER_BSS_SYMBOLS}}
|
${RELOCATING+${OTHER_BSS_SYMBOLS}}
|
||||||
.sbss ${RELOCATING-0} :
|
.sbss ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
|
${RELOCATING+PROVIDE (__sbss_start = .);}
|
||||||
|
${RELOCATING+PROVIDE (___sbss_start = .);}
|
||||||
*(.dynsbss)
|
*(.dynsbss)
|
||||||
*(.sbss)
|
*(.sbss)
|
||||||
${RELOCATING+*(.sbss.*)}
|
${RELOCATING+*(.sbss.*)}
|
||||||
*(.scommon)
|
*(.scommon)
|
||||||
|
${RELOCATING+PROVIDE (__sbss_end = .);}
|
||||||
|
${RELOCATING+PROVIDE (___sbss_end = .);}
|
||||||
}
|
}
|
||||||
|
${BSS_PLT+${PLT}}
|
||||||
.bss ${RELOCATING-0} :
|
.bss ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|
Loading…
Reference in New Issue