From ca8c86efe7765262e25ebb08004012ba2fdadf52 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 13 Jun 2016 09:27:12 -0700 Subject: Add 2 i386 tests to call IFUNC functions via GOT bfd/ * elf32-i386.c (elf_i386_relocate_section): Simplify IFUNC GOT32 adjustment for static executables. ld/ 2016-06-13 H.J. Lu * testsuite/ld-i386/i386.exp: Run ifunc-1a and ifunc-1b. * testsuite/ld-i386/ifunc-1a.c: New file. * testsuite/ld-i386/ifunc-1b.S: Likewise. * testsuite/ld-i386/ifunc-1c.S: Likewise. * testsuite/ld-i386/ifunc-1d.S: Likewise. --- bfd/ChangeLog | 5 +++++ bfd/elf32-i386.c | 21 ++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8e9ad82..2a1ae13 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-06-13 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Simplify IFUNC + GOT32 adjustment for static executables. + 2016-06-13 Maciej W. Rozycki * elf32-mips.c (elf_mips_gnu_pcrel32): Update comment. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 7e2b2cb..fbbf4ab 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -4032,21 +4032,16 @@ elf_i386_relocate_section (bfd *output_bfd, } relocation = off; - - /* Adjust for static executables. */ - if (htab->elf.splt == NULL) - relocation += gotplt->output_offset; } else - { - relocation = (base_got->output_section->vma - + base_got->output_offset + off - - gotplt->output_section->vma - - gotplt->output_offset); - /* Adjust for static executables. */ - if (htab->elf.splt == NULL) - relocation += gotplt->output_offset; - } + relocation = (base_got->output_section->vma + + base_got->output_offset + off + - gotplt->output_section->vma + - gotplt->output_offset); + + /* Adjust for static executables. */ + if (htab->elf.splt == NULL) + relocation += gotplt->output_offset; goto do_relocation; -- cgit v1.1