mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
2a5684011e
"lea foo@GOT, %reg" is OK in PIC since it only loads the GOT offset into register, which can be used later with a GOT base register to get the value in the GOT entry. bfd/ PR ld/21168 * elf32-i386.c (elf_i386_relocate_section): Allow "lea foo@GOT, %reg" in PIC. ld/ PR ld/21168 * testsuite/ld-i386/i386.exp: Run pr21168. * testsuite/ld-i386/pr21168a.c: New file. * testsuite/ld-i386/pr21168b.S: Likewise.
15 lines
194 B
C
15 lines
194 B
C
#include <stdio.h>
|
|
|
|
int foo = 1;
|
|
|
|
extern int *bar (void);
|
|
extern int bar_ifunc (void);
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
if (bar () == &foo && bar_ifunc () == 0xbadbeef)
|
|
printf ("PASS\n");
|
|
return 0;
|
|
}
|