Skip symbol defined by linker when checking copy reloc on protected
symbol.
bfd/
PR ld/24276
* elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
by linker when checking copy reloc on protected symbol.
ld/
PR ld/24276
* testsuite/ld-i386/i386.exp: Run PR ld/24276 test.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr24276.dso: New file.
* testsuite/ld-i386/pr24276.warn: Likewise.
* testsuite/ld-x86-64/pr24276.dso: Likewise.
* testsuite/ld-x86-64/pr24276.warn: Likewise.
Gbp-Pq: Name pr24276.diff
bfd_boolean no_copyreloc_p
= (info->nocopyreloc
|| (h != NULL
+ && !h->root.linker_def
+ && !h->root.ldscript_def
&& eh->def_protected
&& elf_has_no_copy_on_protected (h->root.u.def.section->owner)));
if ((sec->flags & SEC_ALLOC) != 0
{{objdump {-dw} pr19319.dd}} \
"pr19319" \
] \
+ [list \
+ "Build pr24276.so" \
+ "-shared -nostdlib -nostartfiles \
+ -Ltmpdir $srcdir/$subdir/pr24276.dso" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr19319b.S } \
+ {{warning_output pr24276.warn}} \
+ "pr24276.so" \
+ ] \
[list \
"Build property 1" \
"" \
--- /dev/null
+INPUT(pr19319.so)
+SECTIONS {
+ my_section : {
+ __start_my_section = .;
+ *(my_section);
+ __stop_my_section = .;
+
+ }
+}
--- /dev/null
+.*contains output sections.*
--- /dev/null
+INPUT(pr19319.so)
+SECTIONS {
+ my_section : {
+ __start_my_section = .;
+ *(my_section);
+ __stop_my_section = .;
+
+ }
+}
--- /dev/null
+.*contains output sections.*
{{objdump {-dw} pr19319.dd}} \
"pr19319" \
] \
+ [list \
+ "Build pr24276.so" \
+ "-shared -nostdlib -nostartfiles \
+ -Ltmpdir $srcdir/$subdir/pr24276.dso" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr19319b.S } \
+ {{warning_output pr24276.warn}} \
+ "pr24276.so" \
+ ] \
[list \
"Build property 1" \
"" \