(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)
--- /dev/null
+#as:
+#ld:
+#objdump: -h
+#...
+.*TEST_SECTION\.literal[ ]*00000008.*
+#...
--- /dev/null
+#as:
+#ld:
+#objdump: -h
+#...
+.*TEST_SECTION\.literal[ ]*00000008.*
+#...
--- /dev/null
+ .file "startstop.s"
+ .text
+ .section .rodata
+ .align 4
+.LC0:
+ .section TEST_SECTION,"aw"
+ .align 4
+ .literal_position
+ .literal .LC1, __start_TEST_SECTION
+ .literal .LC2, __stop_TEST_SECTION
+ .align 4
+ .global _start
+ .type _start, @function
+_start:
+ l32r a2, .LC1
+ l32r a3, .LC2
run_dump_test "relax-undef-weak-local-pie"
run_dump_test "relax-undef-weak-shared"
run_dump_test "relax-undef-weak-local-shared"
+
+run_dump_test "startstop"