mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-24 09:43:36 +08:00
4b627c1844
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.
24 lines
319 B
ArmAsm
24 lines
319 B
ArmAsm
.text
|
|
.globl g
|
|
.type g, @function
|
|
g:
|
|
calll .Lfoo
|
|
.Lfoo:
|
|
popl %eax
|
|
.Lbar:
|
|
addl $_GLOBAL_OFFSET_TABLE_+(.Lbar-.Lfoo), %eax
|
|
movl f@GOT(%eax), %eax
|
|
ret
|
|
|
|
.globl h
|
|
.type h, @function
|
|
h:
|
|
leal zed, %eax
|
|
movl zed, %ebx
|
|
addl %ebx, %eax
|
|
ret
|
|
|
|
.data
|
|
zed:
|
|
.long f - .
|