aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlexey Lapshin <alexey.lapshin@espressif.com>2023-02-23 10:48:16 +0000
committerNick Clifton <nickc@redhat.com>2023-02-23 10:48:16 +0000
commitd273049e140ef324be2b018e235ae0ba8021a769 (patch)
treeccc28b159a04a0615ed33f217d4fe141fd6f4571 /bfd
parente0b74a85b879354d2aa1a6b5026d5de58c78ec45 (diff)
downloadbinutils-d273049e140ef324be2b018e235ae0ba8021a769.zip
binutils-d273049e140ef324be2b018e235ae0ba8021a769.tar.gz
binutils-d273049e140ef324be2b018e235ae0ba8021a769.tar.bz2
bfd: xtensa: fix __stop_SECTION literal drop
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf32-xtensa.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 84ff900..7772e2a 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -5230,6 +5230,13 @@ literal_value_equal (const literal_value *src1,
(if undefined or weak). */
h1 = r_reloc_get_hash_entry (&src1->r_rel);
h2 = r_reloc_get_hash_entry (&src2->r_rel);
+
+ /* Keep start_stop literals always unique to avoid dropping it due to them
+ having late initialization.
+ Now they are equal because initialized with zeroed values. */
+ if (h2 && h2->start_stop)
+ return false;
+
if (r_reloc_is_defined (&src1->r_rel)
&& (final_static_link
|| ((!h1 || h1->root.type != bfd_link_hash_defweak)