aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-02 12:06:23 +0100
committerSam James <sam@gentoo.org>2023-08-02 12:06:23 +0100
commitb5c37946cce4b41af0436529b139fa3d23e61f73 (patch)
tree02129ebadb74e7d3f2430cf8221799ce186600e3 /ld/scripttempl
parent675b9d612cc59446e84e2c6d89b45500cb603a8d (diff)
downloadgdb-b5c37946cce4b41af0436529b139fa3d23e61f73.zip
gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.tar.gz
gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.tar.bz2
Revert "2.41 Release sources"
This reverts commit 675b9d612cc59446e84e2c6d89b45500cb603a8d. See https://sourceware.org/pipermail/binutils/2023-August/128761.html.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/arclinux.sc2
-rw-r--r--ld/scripttempl/elf.sc59
-rw-r--r--ld/scripttempl/elf32msp430.sc25
-rw-r--r--ld/scripttempl/elf64bpf.sc2
-rw-r--r--ld/scripttempl/elf64hppa.sc1
-rw-r--r--ld/scripttempl/elf_chaos.sc1
-rw-r--r--ld/scripttempl/elfarc.sc1
-rw-r--r--ld/scripttempl/elfd10v.sc1
-rw-r--r--ld/scripttempl/elfxtensa.sc1
-rw-r--r--ld/scripttempl/epiphany_4x4.sc2
-rw-r--r--ld/scripttempl/iq2000.sc1
-rw-r--r--ld/scripttempl/mep.sc1
-rw-r--r--ld/scripttempl/nds32elf.sc2
-rw-r--r--ld/scripttempl/xstormy16.sc1
14 files changed, 58 insertions, 42 deletions
diff --git a/ld/scripttempl/arclinux.sc b/ld/scripttempl/arclinux.sc
index 20429df..3c27625 100644
--- a/ld/scripttempl/arclinux.sc
+++ b/ld/scripttempl/arclinux.sc
@@ -613,7 +613,7 @@ cat <<EOF
${DATA_SDATA-${SDATA}}
${DATA_SDATA-${OTHER_SDATA_SECTIONS}}
${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
- ${RELOCATING+. = .;}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${DATA_SDATA-${SBSS}}
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 1e3c5aa..fe921cd 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -78,6 +78,8 @@
# 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.
+# SYMBOL_ABI_ALIGNMENT - minimum alignment in bytes which needs to be
+# applied to every symbol definition
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
@@ -165,19 +167,29 @@ if test -z "$GOT"; then
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi
fi
+
+def_symbol()
+{
+ if [ -z "${SYMBOL_ABI_ALIGNMENT}" ]; then
+ echo "${USER_LABEL_PREFIX}$1 = ."
+ else
+ echo "${USER_LABEL_PREFIX}$1 = ALIGN(${SYMBOL_ABI_ALIGNMENT})"
+ fi
+}
+
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }"
REL_IPLT=".rel.iplt ${RELOCATING-0} :
{
- ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}
+ ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rel_iplt_start"));}}
*(.rel.iplt)
- ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}
+ ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rel_iplt_end"));}}
}"
RELA_IPLT=".rela.iplt ${RELOCATING-0} :
{
- ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}
+ ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rela_iplt_start"));}}
*(.rela.iplt)
- ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}
+ ${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rela_iplt_end"));}}
}"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".${RODATA_NAME} ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .gnu.linkonce.r.*}) }"
@@ -267,23 +279,23 @@ else
fi
PREINIT_ARRAY=".preinit_array :
{
- ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__preinit_array_start"));}
KEEP (*(.preinit_array))
- ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__preinit_array_end"));}
}"
INIT_ARRAY=".init_array :
{
- ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__init_array_start"));}
${SORT_INIT_ARRAY}
KEEP (*(.init_array ${CTORS_IN_INIT_ARRAY}))
- ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__init_array_end"));}
}"
FINI_ARRAY=".fini_array :
{
- ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__fini_array_start"));}
${SORT_FINI_ARRAY}
KEEP (*(.fini_array ${DTORS_IN_FINI_ARRAY}))
- ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__fini_array_end"));}
}"
CTOR=".ctors ${CONSTRUCTING-0} :
{
@@ -323,16 +335,15 @@ DTOR=".dtors ${CONSTRUCTING-0} :
}"
STACK=".stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
{
- ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
+ ${RELOCATING+$(def_symbol "_stack");}
*(.stack)
${RELOCATING+${STACK_SENTINEL}}
}"
test "${HAVE_NOINIT}" = "yes" && NOINIT="
/* This section contains data that is not initialized during load,
or during the application's initialization sequence. */
- .noinit (NOLOAD) :
+ .noinit ${RELOCATING-0} (NOLOAD) : ${RELOCATING+ALIGN(${ALIGNMENT})}
{
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+PROVIDE (__noinit_start = .);}
*(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*})
${RELOCATING+. = ALIGN(${ALIGNMENT});}
@@ -341,9 +352,8 @@ test "${HAVE_NOINIT}" = "yes" && NOINIT="
test "${HAVE_PERSISTENT}" = "yes" && PERSISTENT="
/* This section contains data that is initialized during load,
but not during the application's initialization sequence. */
- .persistent :
+ .persistent ${RELOCATING-0} : ${RELOCATING+ALIGN(${ALIGNMENT})}
{
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+PROVIDE (__persistent_start = .);}
*(.persistent${RELOCATING+ .persistent.* .gnu.linkonce.p.*})
${RELOCATING+. = ALIGN(${ALIGNMENT});}
@@ -494,16 +504,16 @@ cat >> ldscripts/dyntmp.$$ <<EOF
.rel.plt ${RELOCATING-0} :
{
*(.rel.plt)
- ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}}
+ ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rel_iplt_start"));}}}
${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}}
- ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}}
+ ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rel_iplt_end"));}}}
}
.rela.plt ${RELOCATING-0} :
{
*(.rela.plt)
- ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}}
+ ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rela_iplt_start"));}}}
${IREL_IN_PLT+${RELOCATING+*(.rela.iplt)}}
- ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}}
+ ${IREL_IN_PLT+${RELOCATING+${CREATE_PIC-PROVIDE_HIDDEN ($(def_symbol "__rela_iplt_end"));}}}
}
${OTHER_PLT_RELOC_SECTIONS}
EOF
@@ -628,7 +638,7 @@ cat <<EOF
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} :
{
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__tdata_start = .);}}
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN ($(def_symbol "__tdata_start"));}}
*(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*})
}
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
@@ -676,10 +686,11 @@ cat <<EOF
${SDATA_GOT+${OTHER_GOT_SECTIONS}}
${DATA_SDATA-${SDATA}}
${DATA_SDATA-${OTHER_SDATA_SECTIONS}}
- ${RELOCATING+${DATA_END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}_edata = .${CREATE_SHLIB+)}; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
+ ${RELOCATING+${SYMBOL_ABI_ALIGNMENT+. = ALIGN(${SYMBOL_ABI_ALIGNMENT});}}
+ ${RELOCATING+${DATA_END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}$(def_symbol "_edata")${CREATE_SHLIB+)}; PROVIDE ($(def_symbol "edata"));}}
${PERSISTENT}
- ${RELOCATING+. = .;}
- ${RELOCATING+${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}__bss_start = .${CREATE_SHLIB+)};}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
+ ${RELOCATING+${CREATE_SHLIB+PROVIDE (}$(def_symbol "__bss_start")${CREATE_SHLIB+)};}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${DATA_SDATA-${SBSS}}
${BSS_PLT+${PLT}}
@@ -713,7 +724,7 @@ cat <<EOF
${LARGE_BSS_AFTER_BSS-${LARGE_BSS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+${OTHER_END_SYMBOLS}}
- ${RELOCATING+${END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}_end = .${CREATE_SHLIB+)}; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
+ ${RELOCATING+${END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}$(def_symbol "_end")${CREATE_SHLIB+)}; PROVIDE ($(def_symbol "end"));}}
${RELOCATING+${DATA_SEGMENT_END}}
${TINY_DATA_SECTION}
${TINY_BSS_SECTION}
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index 6edc908..7d5391d 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -137,9 +137,9 @@ SECTIONS
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
/* Internal text space. */
- .text ${RELOCATING-0} :
+ .text ${RELOCATING-0} : ${RELOCATING+ALIGN(2)}
{
- ${RELOCATING+. = ALIGN(2);
+ ${RELOCATING+
*(SORT_NONE(.init))
*(SORT_NONE(.init0)) /* Start here after reset. */
*(SORT_NONE(.init1))
@@ -189,9 +189,9 @@ SECTIONS
_etext = .;}
} ${RELOCATING+ > text}
- .rodata ${RELOCATING-0} :
+ .rodata ${RELOCATING-0} : ${RELOCATING+ALIGN(2)}
{
- ${RELOCATING+. = ALIGN(2);
+ ${RELOCATING+
*(.lower.rodata.* .lower.rodata)
. = ALIGN(2);
@@ -254,11 +254,11 @@ SECTIONS
${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors}
- .data ${RELOCATING-0} :
+ .data ${RELOCATING-0} : ${RELOCATING+ALIGN(2)}
{
- ${RELOCATING+ PROVIDE (__data_start = .) ; }
- ${RELOCATING+ PROVIDE (__datastart = .) ; }
- ${RELOCATING+. = ALIGN(2);
+ ${RELOCATING+
+ PROVIDE (__data_start = .) ;
+ PROVIDE (__datastart = .) ;
KEEP (*(.jcr))
*(.data.rel.ro.local) *(.data.rel.ro*)
@@ -287,9 +287,8 @@ SECTIONS
${RELOCATING+__romdatastart = LOADADDR(.data);
__romdatacopysize = SIZEOF(.data);}
- .bss ${RELOCATING-0}${RELOCATING+SIZEOF(.data) + ADDR(.data)} :
+ .bss ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.data) + ADDR(.data), 2)} :
{
- ${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__bss_start = .); }
${RELOCATING+ PROVIDE (__bssstart = .);
*(.lower.bss.* .lower.bss)
@@ -304,9 +303,8 @@ SECTIONS
/* This section contains data that is not initialized during load,
or during the application's initialization sequence. */
- .noinit ${RELOCATING-0}${RELOCATING+SIZEOF(.bss) + ADDR(.bss)} :
+ .noinit ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.bss) + ADDR(.bss), 2)} :
{
- ${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__noinit_start = .) ; }
*(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*})
${RELOCATING+. = ALIGN(2);}
@@ -315,9 +313,8 @@ SECTIONS
/* This section contains data that is initialized during load,
but not during the application's initialization sequence. */
- .persistent ${RELOCATING-0}${RELOCATING+SIZEOF(.noinit) + ADDR(.noinit)} :
+ .persistent ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.noinit) + ADDR(.noinit), 2)} :
{
- ${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__persistent_start = .) ; }
*(.persistent${RELOCATING+ .persistent.* .gnu.linkonce.p.*})
${RELOCATING+. = ALIGN(2);}
diff --git a/ld/scripttempl/elf64bpf.sc b/ld/scripttempl/elf64bpf.sc
index 7415458..07a0726 100644
--- a/ld/scripttempl/elf64bpf.sc
+++ b/ld/scripttempl/elf64bpf.sc
@@ -636,7 +636,7 @@ cat <<EOF
${DATA_SDATA-${SDATA}}
${DATA_SDATA-${OTHER_SDATA_SECTIONS}}
${RELOCATING+${DATA_END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}_edata = .${CREATE_SHLIB+)}; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
- ${RELOCATING+. = .;}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}__bss_start = .${CREATE_SHLIB+)};}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${DATA_SDATA-${SBSS}}
diff --git a/ld/scripttempl/elf64hppa.sc b/ld/scripttempl/elf64hppa.sc
index e85dd39..b3be5a2 100644
--- a/ld/scripttempl/elf64hppa.sc
+++ b/ld/scripttempl/elf64hppa.sc
@@ -490,6 +490,7 @@ cat <<EOF
${SDATA}
${OTHER_SDATA_SECTIONS}
${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/elf_chaos.sc b/ld/scripttempl/elf_chaos.sc
index 72f91c9..88b573c 100644
--- a/ld/scripttempl/elf_chaos.sc
+++ b/ld/scripttempl/elf_chaos.sc
@@ -303,6 +303,7 @@ cat <<EOF
${OTHER_SDATA_SECTIONS}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/elfarc.sc b/ld/scripttempl/elfarc.sc
index 57cd0a5..1ae0248 100644
--- a/ld/scripttempl/elfarc.sc
+++ b/ld/scripttempl/elfarc.sc
@@ -365,6 +365,7 @@ cat <<EOF
${OTHER_SDATA_SECTIONS}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/elfd10v.sc b/ld/scripttempl/elfd10v.sc
index e52aaed..316fa89 100644
--- a/ld/scripttempl/elfd10v.sc
+++ b/ld/scripttempl/elfd10v.sc
@@ -156,6 +156,7 @@ SECTIONS
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
.sbss ${RELOCATING-0} : { *(.sbss)${RELOCATING+ *(.scommon)} } ${RELOCATING+ >DATA}
.bss ${RELOCATING-0} :
diff --git a/ld/scripttempl/elfxtensa.sc b/ld/scripttempl/elfxtensa.sc
index 7c71525..9c85d15 100644
--- a/ld/scripttempl/elfxtensa.sc
+++ b/ld/scripttempl/elfxtensa.sc
@@ -500,6 +500,7 @@ cat <<EOF
${SDATA}
${OTHER_SDATA_SECTIONS}
${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/epiphany_4x4.sc b/ld/scripttempl/epiphany_4x4.sc
index 0f4e74f..ee253af 100644
--- a/ld/scripttempl/epiphany_4x4.sc
+++ b/ld/scripttempl/epiphany_4x4.sc
@@ -578,7 +578,7 @@ cat <<EOF
/* Align ___bss_start and _end to a multiple of 8 so that we can use strd
to clear bss. N.B., without adding any extra alignment, we would have
to clear the bss byte by byte. */
- ${RELOCATING+. = ALIGN(8);}
+ ${RELOCATING+. = ALIGN(MAX(8,ALIGNOF(NEXT_SECTION)));}
${RELOCATING+___bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/iq2000.sc b/ld/scripttempl/iq2000.sc
index 47bd777..c3d3620 100644
--- a/ld/scripttempl/iq2000.sc
+++ b/ld/scripttempl/iq2000.sc
@@ -373,6 +373,7 @@ cat <<EOF
${RELOCATING+${OTHER_SDATA_SECTIONS}}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
.sbss ${RELOCATING-0} :
diff --git a/ld/scripttempl/mep.sc b/ld/scripttempl/mep.sc
index 6b80c36..d49f848 100644
--- a/ld/scripttempl/mep.sc
+++ b/ld/scripttempl/mep.sc
@@ -385,6 +385,7 @@ cat <<EOF
${OTHER_SDATA_SECTIONS}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/nds32elf.sc b/ld/scripttempl/nds32elf.sc
index 9645e80..36d04cd 100644
--- a/ld/scripttempl/nds32elf.sc
+++ b/ld/scripttempl/nds32elf.sc
@@ -557,7 +557,7 @@ cat <<EOF
${OTHER_SDATA_SECTIONS}
${RELOCATING+. = ALIGN(4);}
${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
- ${RELOCATING+. = .;}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
diff --git a/ld/scripttempl/xstormy16.sc b/ld/scripttempl/xstormy16.sc
index ccae0a2..b29f720 100644
--- a/ld/scripttempl/xstormy16.sc
+++ b/ld/scripttempl/xstormy16.sc
@@ -143,6 +143,7 @@ SECTIONS
${RELOCATING+${OTHER_GOT_SECTIONS}}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+. = ALIGN(ALIGNOF(NEXT_SECTION));}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
.bss ${RELOCATING-0} :