From d273049e140ef324be2b018e235ae0ba8021a769 Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Thu, 23 Feb 2023 10:48:16 +0000 Subject: bfd: xtensa: fix __stop_SECTION literal drop --- bfd/elf32-xtensa.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bfd') 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) -- cgit v1.1