Create a PLT entry for R_386_PC32 in non-code sections
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Sep 2015 15:32:45 +0000 (08:32 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Sep 2015 15:45:13 +0000 (08:45 -0700)
commit4b627c18440f51077f8fd4c18adaa3919c3a373e
tree1bab6b77eaec81d3909f55ed8ac94b162a884549
parentede5f15146ae45f4c017f5701629a4fa04ef2beb
Create a PLT entry for R_386_PC32 in non-code sections

Since something like ".long foo - ." may be used as pointer, we make
sure that PLT is used if foo is a function defined in a shared library.

bfd/

PR ld/19031
* elf32-i386.c (elf_i386_check_relocs): Set
pointer_equality_needed for R_386_PC32 reloc in non-code
sections.

ld/testsuite/

PR ld/19031
* ld-i386/i386.exp: Run PR ld/19031 test.
* ld/testsuite/ld-i386/pr19031.out: New file.
* ld/testsuite/ld-i386/pr19031a.c: Likewise.
* ld/testsuite/ld-i386/pr19031b.S: Likewise.
* ld/testsuite/ld-i386/pr19031c.c: Likewise.
bfd/ChangeLog
bfd/elf32-i386.c
ld/testsuite/ChangeLog
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/pr19031.out [new file with mode: 0644]
ld/testsuite/ld-i386/pr19031a.c [new file with mode: 0644]
ld/testsuite/ld-i386/pr19031b.S [new file with mode: 0644]
ld/testsuite/ld-i386/pr19031c.c [new file with mode: 0644]