aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl/nds32elf.sc
diff options
context:
space:
mode:
Diffstat (limited to 'ld/scripttempl/nds32elf.sc')
-rw-r--r--ld/scripttempl/nds32elf.sc36
1 files changed, 17 insertions, 19 deletions
diff --git a/ld/scripttempl/nds32elf.sc b/ld/scripttempl/nds32elf.sc
index dd9a0c1..a96cf2e 100644
--- a/ld/scripttempl/nds32elf.sc
+++ b/ld/scripttempl/nds32elf.sc
@@ -46,16 +46,16 @@ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
fi
if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
- PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
+ PLT=".plt ${RELOCATING-0} : { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }
${IREL_IN_PLT-$IPLT}"
fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt) *(.igot.plt)} *(.got)${RELOCATING+ *(.igot)} }"
else
- GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
- GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
+ GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi
fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
@@ -80,27 +80,27 @@ if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss_b ${RELOCATING-0} :
{
*(.sbss_b${RELOCATING+ .sbss_b.*})
- *(.scommon_b${RELOCATING+ .scommon_b.*})
+ ${RELOCATING+*(.scommon_b .scommon_b.*)}
${RELOCATING+. = ALIGN(2);}
}
.sbss_h ${RELOCATING-0} :
{
*(.sbss_h${RELOCATING+ .sbss_h.*})
- *(.scommon_h${RELOCATING+ .scommon_h.*})
+ ${RELOCATING+*(.scommon_h .scommon_h.*)}
${RELOCATING+. = ALIGN(4);}
}
.sbss_w ${RELOCATING-0} :
{
*(.sbss_w${RELOCATING+ .sbss_w.*})
- *(.scommon_w${RELOCATING+ .scommon_w.*})
+ ${RELOCATING+*(.scommon_w .scommon_w.*)
*(.dynsbss)
*(.scommon)
- ${RELOCATING+. = ALIGN(8);}
+ . = ALIGN(8);}
}
.sbss_d ${RELOCATING-0} :
{
*(.sbss_d${RELOCATING+ .sbss_d.*})
- *(.scommon_d${RELOCATING+ .scommon_d.*})
+ ${RELOCATING+*(.scommon_d .scommon_d.*)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}"
@@ -488,11 +488,9 @@ cat <<EOF
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
- .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* These sections are generated by the Sun/Oracle C++ compiler. */
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
- .exception_ranges*) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}}
/* Adjust the address for the data segment. We want to adjust up to
@@ -503,8 +501,8 @@ cat <<EOF
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@@ -565,15 +563,15 @@ cat <<EOF
${BSS_PLT+${PLT}}
.${BSS_NAME} ${RELOCATING-0} :
{
- *(.dyn${BSS_NAME})
+ ${RELOCATING+*(.dyn${BSS_NAME})}
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(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.
- FIXME: Why do we need it? When there is no .bss section, we don't
+ FIXME: Why do we need it? When there is no .bss section, we do not
pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}