X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ld%2Fscripttempl%2Fmep.sc;h=1e5a57983171e457042e4140df762a3ecbbb4667;hb=db3ad2f031d4da70db35977abbcede0399d81d6b;hp=e61342d7da3f629741bd9495680ef480659e320a;hpb=09b910c68c67101602c8f8b86a3b1e1f9b110216;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/mep.sc b/ld/scripttempl/mep.sc index e61342d7da..1e5a579831 100644 --- a/ld/scripttempl/mep.sc +++ b/ld/scripttempl/mep.sc @@ -1,3 +1,8 @@ +# Copyright (C) 2014-2019 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. # # Unusual variables checked by this code: # NOP - four byte opcode for no-op (defaults to 0) @@ -34,15 +39,15 @@ # PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement. # BSS_PLT - .plt should be in bss 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 # start address of shared library. # INPUT_FILES - INPUT command of files to always include # WRITABLE_RODATA - if set, the .rodata section should be writable # INIT_START, INIT_END - statements just before and just after -# combination of .init sections. +# combination of .init sections. # FINI_START, FINI_END - statements just before and just after -# combination of .fini sections. +# combination of .fini sections. # STACK_ADDR - start of a .stack section. # OTHER_END_SYMBOLS - symbols to place right at the end of the script. # SEPARATE_GOTPLT - if set, .got.plt should be separate output section, @@ -104,7 +109,7 @@ INTERP=".interp ${RELOCATING-0} : { *(.interp) }" PLT=".plt ${RELOCATING-0} : { *(.plt) }" if test -z "$GOT"; then if test -z "$SEPARATE_GOTPLT"; then - GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" + GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }" else GOT=".got ${RELOCATING-0} : { *(.got) }" GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}} @@ -113,7 +118,7 @@ if test -z "$GOT"; then fi DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" RODATA=".rodata ${RELOCATING-0} : { *(.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 .data.rel.ro.*) }" DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" if test -z "${NO_SMALL_DATA}"; then SBSS=".sbss ${RELOCATING-0} : @@ -121,9 +126,9 @@ if test -z "${NO_SMALL_DATA}"; then ${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} - *(.dynsbss) + ${RELOCATING+*(.dynsbss)} *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) - *(.scommon) + ${RELOCATING+*(.scommon)} ${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);} }" @@ -131,7 +136,7 @@ if test -z "${NO_SMALL_DATA}"; then SDATA="/* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata ${RELOCATING-0} : + .sdata ${RELOCATING-0} : { ${RELOCATING+${SDATA_START_SYMBOLS}} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} @@ -150,7 +155,7 @@ else NO_SMALL_DATA=" " fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " -CTOR=".ctors ${CONSTRUCTING-0} : +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of @@ -190,7 +195,7 @@ STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : *(.stack) }" -# if this is for an embedded system, don't add SIZEOF_HEADERS. +# If this is for an embedded system, don't add SIZEOF_HEADERS. if [ -z "$EMBEDDED" ]; then test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS" else @@ -198,6 +203,12 @@ else fi cat <