aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl/elf.sc
diff options
context:
space:
mode:
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r--ld/scripttempl/elf.sc14
1 files changed, 10 insertions, 4 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 149eec7..7994b5f 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -1,6 +1,6 @@
#
# Unusual variables checked by this code:
-# NOP - four byte opcode for no-op (defaults to 0)
+# NOP - four byte opcode for no-op (defaults to none)
# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
# empty.
# SMALL_DATA_CTOR - .ctors contains small data.
@@ -91,6 +91,12 @@
#
# Each of these can also have corresponding .rel.* and .rela.* sections.
+if test -n "$NOP"; then
+ FILL="=$NOP"
+else
+ FILL=
+fi
+
test -z "$RODATA_NAME" && RODATA_NAME=rodata
test -z "$SDATA_NAME" && SDATA_NAME=sdata
test -z "$SBSS_NAME" && SBSS_NAME=sbss
@@ -438,7 +444,7 @@ cat <<EOF
${RELOCATING+${INIT_START}}
KEEP (*(.init))
${RELOCATING+${INIT_END}}
- } =${NOP-0}
+ } ${FILL}
${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION}
@@ -453,13 +459,13 @@ cat <<EOF
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}}
- } =${NOP-0}
+ } ${FILL}
.fini ${RELOCATING-0} :
{
${RELOCATING+${FINI_START}}
KEEP (*(.fini))
${RELOCATING+${FINI_END}}
- } =${NOP-0}
+ } ${FILL}
${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}