Browse Source

x86-64: Skip protected check on symbol defined by linker

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.
binutils-2_33-branch
H.J. Lu 8 years ago
parent
commit
5cfe428cd1
  1. 6
      bfd/ChangeLog
  2. 2
      bfd/elf64-x86-64.c
  3. 10
      ld/ChangeLog
  4. 9
      ld/testsuite/ld-i386/i386.exp
  5. 9
      ld/testsuite/ld-i386/pr24276.dso
  6. 1
      ld/testsuite/ld-i386/pr24276.warn
  7. 9
      ld/testsuite/ld-x86-64/pr24276.dso
  8. 1
      ld/testsuite/ld-x86-64/pr24276.warn
  9. 9
      ld/testsuite/ld-x86-64/x86-64.exp

6
bfd/ChangeLog

@ -1,3 +1,9 @@
2019-02-27 H.J. Lu <hongjiu.lu@intel.com>
PR ld/24276
* elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
by linker when checking copy reloc on protected symbol.
2019-02-24 Alan Modra <amodra@gmail.com>
PR 24144

2
bfd/elf64-x86-64.c

@ -2238,6 +2238,8 @@ check_pic:
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

10
ld/ChangeLog

@ -1,3 +1,13 @@
2019-02-27 H.J. Lu <hongjiu.lu@intel.com>
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.
2019-02-20 Eric Tsai <erictsai@cadence.com>
* testsuite/ld-xtensa/call_overflow.d: New test definition.

9
ld/testsuite/ld-i386/i386.exp

@ -804,6 +804,15 @@ if { [isnative]
{{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" \
"" \

9
ld/testsuite/ld-i386/pr24276.dso

@ -0,0 +1,9 @@
INPUT(pr19319.so)
SECTIONS {
my_section : {
__start_my_section = .;
*(my_section);
__stop_my_section = .;
}
}

1
ld/testsuite/ld-i386/pr24276.warn

@ -0,0 +1 @@
.*contains output sections.*

9
ld/testsuite/ld-x86-64/pr24276.dso

@ -0,0 +1,9 @@
INPUT(pr19319.so)
SECTIONS {
my_section : {
__start_my_section = .;
*(my_section);
__stop_my_section = .;
}
}

1
ld/testsuite/ld-x86-64/pr24276.warn

@ -0,0 +1 @@
.*contains output sections.*

9
ld/testsuite/ld-x86-64/x86-64.exp

@ -940,6 +940,15 @@ if { [isnative] && [which $CC] != 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" \
"" \

Loading…
Cancel
Save