mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-12 01:24:12 +08:00
* scripttempl/elf.sc (RODATA_NAME, SDATA_NAME, SBSS_NAME,
BSS_NAME): Define if not already defined. Use in place of some hardcoded section names.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2010-03-23 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* scripttempl/elf.sc (RODATA_NAME, SDATA_NAME, SBSS_NAME,
|
||||||
|
BSS_NAME): Define if not already defined. Use in place of some
|
||||||
|
hardcoded section names.
|
||||||
|
|
||||||
2010-03-18 H.J. Lu <hongjiu.lu@intel.com>
|
2010-03-18 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* scripttempl/elf.sc (INIT_ARRAY): Re-indent.
|
* scripttempl/elf.sc (INIT_ARRAY): Re-indent.
|
||||||
|
@ -58,6 +58,8 @@
|
|||||||
# the number of bytes in the beginning of .got.plt which can be
|
# the number of bytes in the beginning of .got.plt which can be
|
||||||
# in the RELRO area as well.
|
# in the RELRO area as well.
|
||||||
# USER_LABEL_PREFIX - prefix to add to user-visible symbols.
|
# USER_LABEL_PREFIX - prefix to add to user-visible symbols.
|
||||||
|
# RODATA_NAME, SDATA_NAME, SBSS_NAME, BSS_NAME - base parts of names
|
||||||
|
# for standard sections, without initial "." or suffixes.
|
||||||
#
|
#
|
||||||
# When adding sections, do note that the names of some sections are used
|
# When adding sections, do note that the names of some sections are used
|
||||||
# when specifying the start address of the next.
|
# when specifying the start address of the next.
|
||||||
@ -89,6 +91,10 @@
|
|||||||
#
|
#
|
||||||
# Each of these can also have corresponding .rel.* and .rela.* sections.
|
# Each of these can also have corresponding .rel.* and .rela.* sections.
|
||||||
|
|
||||||
|
test -z "$RODATA_NAME" && RODATA_NAME=rodata
|
||||||
|
test -z "$SDATA_NAME" && SDATA_NAME=sdata
|
||||||
|
test -z "$SBSS_NAME" && SBSS_NAME=sbss
|
||||||
|
test -z "$BSS_NAME" && BSS_NAME=bss
|
||||||
test -z "$ENTRY" && ENTRY=${USER_LABEL_PREFIX}_start
|
test -z "$ENTRY" && ENTRY=${USER_LABEL_PREFIX}_start
|
||||||
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}
|
||||||
@ -141,42 +147,42 @@ RELA_IPLT=".rela.iplt ${RELOCATING-0} :
|
|||||||
${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 ${RELOCATING-0} : { *(.dynamic) }"
|
||||||
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
|
RODATA=".${RODATA_NAME} ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .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_NAME} ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
${RELOCATING+${SBSS_START_SYMBOLS}}
|
${RELOCATING+${SBSS_START_SYMBOLS}}
|
||||||
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
|
${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
|
||||||
*(.dynsbss)
|
*(.dyn${SBSS_NAME})
|
||||||
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
|
*(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
|
||||||
*(.scommon)
|
*(.scommon)
|
||||||
${RELOCATING+${SBSS_END_SYMBOLS}}
|
${RELOCATING+${SBSS_END_SYMBOLS}}
|
||||||
}"
|
}"
|
||||||
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
|
SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .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_NAME} ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
${RELOCATING+${SDATA_START_SYMBOLS}}
|
${RELOCATING+${SDATA_START_SYMBOLS}}
|
||||||
${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
|
${CREATE_SHLIB+*(.${SDATA_NAME}2 .${SDATA_NAME}2.* .gnu.linkonce.s2.*)}
|
||||||
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
|
*(.${SDATA_NAME}${RELOCATING+ .${SDATA_NAME}.* .gnu.linkonce.s.*})
|
||||||
}"
|
}"
|
||||||
SDATA2=".sdata2 ${RELOCATING-0} :
|
SDATA2=".${SDATA_NAME}2 ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
${RELOCATING+${SDATA2_START_SYMBOLS}}
|
${RELOCATING+${SDATA2_START_SYMBOLS}}
|
||||||
*(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*})
|
*(.${SDATA_NAME}2${RELOCATING+ .${SDATA_NAME}2.* .gnu.linkonce.s2.*})
|
||||||
}"
|
}"
|
||||||
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
|
REL_SDATA=".rel.${SDATA_NAME} ${RELOCATING-0} : { *(.rel.${SDATA_NAME}${RELOCATING+ .rel.${SDATA_NAME}.* .rel.gnu.linkonce.s.*}) }
|
||||||
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
|
.rela.${SDATA_NAME} ${RELOCATING-0} : { *(.rela.${SDATA_NAME}${RELOCATING+ .rela.${SDATA_NAME}.* .rela.gnu.linkonce.s.*}) }"
|
||||||
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
|
REL_SBSS=".rel.${SBSS_NAME} ${RELOCATING-0} : { *(.rel.${SBSS_NAME}${RELOCATING+ .rel.${SBSS_NAME}.* .rel.gnu.linkonce.sb.*}) }
|
||||||
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
|
.rela.${SBSS_NAME} ${RELOCATING-0} : { *(.rela.${SBSS_NAME}${RELOCATING+ .rela.${SBSS_NAME}.* .rela.gnu.linkonce.sb.*}) }"
|
||||||
REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
|
REL_SDATA2=".rel.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rel.${SDATA_NAME}2${RELOCATING+ .rel.${SDATA_NAME}2.* .rel.gnu.linkonce.s2.*}) }
|
||||||
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
|
.rela.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rela.${SDATA_NAME}2${RELOCATING+ .rela.${SDATA_NAME}2.* .rela.gnu.linkonce.s2.*}) }"
|
||||||
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
|
REL_SBSS2=".rel.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rel.${SBSS_NAME}2${RELOCATING+ .rel.${SBSS_NAME}2.* .rel.gnu.linkonce.sb2.*}) }
|
||||||
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
|
.rela.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rela.${SBSS_NAME}2${RELOCATING+ .rela.${SBSS_NAME}2.* .rela.gnu.linkonce.sb2.*}) }"
|
||||||
else
|
else
|
||||||
NO_SMALL_DATA=" "
|
NO_SMALL_DATA=" "
|
||||||
fi
|
fi
|
||||||
@ -332,13 +338,14 @@ eval $COMBRELOCCAT <<EOF
|
|||||||
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
|
.rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
|
||||||
.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+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
|
.rel.${RODATA_NAME} ${RELOCATING-0} : { *(.rel.${RODATA_NAME}${RELOCATING+ .rel.${RODATA_NAME}.* .rel.gnu.linkonce.r.*}) }
|
||||||
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
|
.rela.${RODATA_NAME} ${RELOCATING-0} : { *(.rela.${RODATA_NAME}${RELOCATING+ .rela.${RODATA_NAME}.* .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 ${RELOCATING-0} : { *(.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 ${RELOCATING-0} : { *(.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 ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
|
||||||
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
|
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
|
||||||
|
${OTHER_READWRITE_RELOC_SECTIONS}
|
||||||
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
|
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
|
||||||
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
|
.rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
|
||||||
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
|
.rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
|
||||||
@ -354,8 +361,8 @@ eval $COMBRELOCCAT <<EOF
|
|||||||
${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_NAME} ${RELOCATING-0} : { *(.rel.${BSS_NAME}${RELOCATING+ .rel.${BSS_NAME}.* .rel.gnu.linkonce.b.*}) }
|
||||||
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
|
.rela.${BSS_NAME} ${RELOCATING-0} : { *(.rela.${BSS_NAME}${RELOCATING+ .rela.${BSS_NAME}.* .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}
|
||||||
@ -441,7 +448,7 @@ 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) }
|
.${RODATA_NAME}1 ${RELOCATING-0} : { *(.${RODATA_NAME}1) }
|
||||||
${CREATE_SHLIB-${SDATA2}}
|
${CREATE_SHLIB-${SDATA2}}
|
||||||
${CREATE_SHLIB-${SBSS2}}
|
${CREATE_SHLIB-${SBSS2}}
|
||||||
${OTHER_READONLY_SECTIONS}
|
${OTHER_READONLY_SECTIONS}
|
||||||
@ -509,10 +516,10 @@ cat <<EOF
|
|||||||
${RELOCATING+${OTHER_BSS_SYMBOLS}}
|
${RELOCATING+${OTHER_BSS_SYMBOLS}}
|
||||||
${SBSS}
|
${SBSS}
|
||||||
${BSS_PLT+${PLT}}
|
${BSS_PLT+${PLT}}
|
||||||
.bss ${RELOCATING-0} :
|
.${BSS_NAME} ${RELOCATING-0} :
|
||||||
{
|
{
|
||||||
*(.dynbss)
|
*(.dyn${BSS_NAME})
|
||||||
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
|
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
/* Align here to ensure that the .bss section occupies space up to
|
/* Align here to ensure that the .bss section occupies space up to
|
||||||
_end. Align after .bss to ensure correct alignment even if the
|
_end. Align after .bss to ensure correct alignment even if the
|
||||||
|
Reference in New Issue
Block a user