From 9d4057ee3bda54d4df12f2a2a795e8c6b3dc45b4 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 1 May 2011 12:04:10 +0000 Subject: [PATCH] PR ld/12718 * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before creating ifunc sections. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. --- bfd/ChangeLog | 7 +++++++ bfd/elf32-i386.c | 4 +++- bfd/elf64-x86-64.c | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9cd81e6a054..4d155cd88ce 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2011-05-01 Alan Modra + + PR ld/12718 + * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before + creating ifunc sections. + * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. + 2011-04-30 H.J. Lu * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index e32ec831c72..ee1511f216b 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1376,7 +1376,9 @@ elf_i386_check_relocs (bfd *abfd, case R_386_PLT32: case R_386_GOT32: case R_386_GOTOFF: - if (!_bfd_elf_create_ifunc_sections (abfd, info)) + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!_bfd_elf_create_ifunc_sections (htab->elf.dynobj, info)) return FALSE; break; } diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 3f725dbda3d..ae175e14626 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1261,7 +1261,9 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_X86_64_PLT32: case R_X86_64_GOTPCREL: case R_X86_64_GOTPCREL64: - if (!_bfd_elf_create_ifunc_sections (abfd, info)) + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!_bfd_elf_create_ifunc_sections (htab->elf.dynobj, info)) return FALSE; break; } -- 2.30.2