diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/emulparams/elf_x86_64.sh | 1 | ||||
-rw-r--r-- | ld/scripttempl/elf.sc | 39 |
3 files changed, 45 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 09f6bdc..460fb39 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2005-07-25 Jan Hubicka <jh@suse.cz> + H.J. Lu <hongjiu.lu@intel.com> + + * emulparams/elf_x86_64.sh (LARGE_SECTIONS): New. + + * scripttempl/elf.sc: Updated for large section support. + 2005-07-21 Ralf Corsepius <ralf.corsepius@rtems.org> * configure.tgt: Remove i[3-7]86-*-rtemself*. diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh index 172b4b1..35240df 100644 --- a/ld/emulparams/elf_x86_64.sh +++ b/ld/emulparams/elf_x86_64.sh @@ -12,6 +12,7 @@ TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes GENERATE_PIE_SCRIPT=yes NO_SMALL_DATA=yes +LARGE_SECTIONS=yes SEPARATE_GOTPLT=24 if [ "x${host}" = "x${target}" ]; then diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 2d92e3a..e1ac9e6 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -78,6 +78,9 @@ # .debug_info .gnu.linkonce.wi.foo # .tdata .gnu.linkonce.td.foo # .tbss .gnu.linkonce.tb.foo +# .lrodata .gnu.linkonce.lr.foo +# .ldata .gnu.linkonce.l.foo +# .lbss .gnu.linkonce.lb.foo # # Each of these can also have corresponding .rel.* and .rela.* sections. @@ -157,6 +160,31 @@ if test -z "${SDATA_GOT}"; then SDATA_GOT=" " fi fi +if test -n "${LARGE_SECTIONS}"; then + LBSS=" + .lbss ${RELOCATING-0} : + { + *(.dynlbss) + *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) + *(LARGE_COMMON) + }" + LARGE_SECTIONS=" + .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : + { + *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*}) + } + .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : + { + *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) + ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} + }" + REL_LDATA=".rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) } + .rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }" + REL_LBSS=".rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) } + .rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }" + REL_LRODATA=".rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) } + .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }" +fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " CTOR=".ctors ${CONSTRUCTING-0} : { @@ -274,6 +302,9 @@ eval $COMBRELOCCAT <<EOF ${REL_SBSS2} .rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } + ${REL_LDATA} + ${REL_LBSS} + ${REL_LRODATA} EOF if [ -n "$COMBRELOC" ]; then cat <<EOF @@ -397,13 +428,17 @@ cat <<EOF *(COMMON) /* Align here to ensure that the .bss section occupies space up to _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ + .bss section disappears because there are no input sections. + FIXME: Why do we need it? When there is no .bss section, we don't + pad the .data section. */ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} } + ${LBSS} ${OTHER_BSS_SECTIONS} + ${RELOCATING+${OTHER_BSS_END_SYMBOLS}} + ${LARGE_SECTIONS} ${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+_end = .;} - ${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+PROVIDE (end = .);} ${RELOCATING+${DATA_SEGMENT_END}} |