PR ld/12718
authorAlan Modra <amodra@gmail.com>
Sun, 1 May 2011 12:04:10 +0000 (12:04 +0000)
committerAlan Modra <amodra@gmail.com>
Sun, 1 May 2011 12:04:10 +0000 (12:04 +0000)
* 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
bfd/elf32-i386.c
bfd/elf64-x86-64.c

index 9cd81e6a054d964ffb2ec9b386546a9f377a945a..4d155cd88ce9f0504131b74c636181cb01e6901c 100644 (file)
@@ -1,3 +1,10 @@
+2011-05-01  Alan Modra  <amodra@gmail.com>
+
+       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  <hongjiu.lu@intel.com>
 
        * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter
index e32ec831c72b03bb5ca4221f282e155e823de244..ee1511f216b3c6aa2a7124c5b49925a0adc1747a 100644 (file)
@@ -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;
            }
index 3f725dbda3d89ee19b1e646bab8c19082d92c7db..ae175e14626c2f80796334fc9b2867f349e4b15b 100644 (file)
@@ -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;
            }