Replace SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 11 Apr 2015 14:34:49 +0000 (07:34 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 11 Apr 2015 14:56:48 +0000 (07:56 -0700)
commite3c0e327923e27c7d96e6e44e22e10998ff158d7
treed4dfd7ed0875d03e7b6c8f1cd51b855fe07d80fb
parentfbed9c2759d43ea6991264c2e963660b5e9202d1
Replace SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL

When checking R_386_GOTOFF/R_X86_64_GOTOFF64 for building shared library,
we should check SYMBOL_REFERENCES_LOCAL instead of SYMBOLIC_BIND to cover
more cases.

bfd/

* elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
protected data symbol when building shared library.
* elf64-x86-64.c (elf_x86_64_relocate_section): Check
R_X86_64_GOTOFF64 against undefined symbol and replace
SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
R_X86_64_GOTOFF64 against protected data symbol when building
shared library.

ld/testsuite/

* ld-i386/i386.exp: Run protected6a.
* ld-i386/protected6.d: Renamed to ...
* ld-i386/protected6a.d: This.
* ld-x86-64/hidden4.d: New file.
* ld-x86-64/hidden4.s: Likewise.
* ld-x86-64/hidden5.d: Likewise.
* ld-x86-64/hidden5.s: Likewise.
* ld-x86-64/protected6.d: Renamed to ...
* ld-x86-64/protected6a.d: This.
* ld-x86-64/x86-64.exp: Run hidden4, hidden5, protected6a,
protected7a and protected7b.
12 files changed:
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c
ld/testsuite/ChangeLog
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/protected6a.d [moved from ld/testsuite/ld-i386/protected6.d with 86% similarity]
ld/testsuite/ld-x86-64/hidden4.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/hidden4.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/hidden5.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/hidden5.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/protected6a.d [moved from ld/testsuite/ld-x86-64/protected6.d with 87% similarity]
ld/testsuite/ld-x86-64/x86-64.exp