const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
asection *sreloc;
- Elf_Internal_Sym *isymbuf;
if (info->relocatable)
return TRUE;
htab = elf_i386_hash_table (info);
symtab_hdr = &elf_symtab_hdr (abfd);
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
sym_hashes = elf_sym_hashes (abfd);
sreloc = NULL;
/* A local symbol. */
Elf_Internal_Sym *isym;
- /* Read this BFD's local symbols. */
- if (isymbuf == NULL)
- {
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- return FALSE;
- }
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
/* Check relocation against local STT_GNU_IFUNC symbol. */
- isym = isymbuf + r_symndx;
if (ELF32_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
{
h = elf_i386_get_local_sym_hash (htab, abfd, rel,
TRUE);
if (h == NULL)
- goto error_return;
+ return FALSE;
/* Fake a STT_GNU_IFUNC symbol. */
h->type = STT_GNU_IFUNC;
case R_386_GOT32:
case R_386_GOTOFF:
if (!_bfd_elf_create_ifunc_sections (abfd, info))
- goto error_return;
+ return FALSE;
break;
}
? h->root.root.string : "a local symbol"),
__FUNCTION__);
bfd_set_error (bfd_error_bad_value);
- goto error_return;
+ return FALSE;
case R_386_32:
h->non_got_ref = 1;
(abfd, info, sec, sreloc,
&((struct elf_i386_link_hash_entry *) h)->dyn_relocs);
if (sreloc == NULL)
- goto error_return;
+ return FALSE;
}
break;
if (htab->elf.sgot == NULL
&& !_bfd_elf_create_got_section (htab->elf.dynobj,
info))
- goto error_return;
+ return FALSE;
break;
}
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
rel, rel_end, h))
- goto error_return;
+ return FALSE;
switch (r_type)
{
+ sizeof (bfd_vma) + sizeof(char));
local_got_refcounts = bfd_zalloc (abfd, size);
if (local_got_refcounts == NULL)
- goto error_return;
+ return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
elf_i386_local_tlsdesc_gotent (abfd)
= (bfd_vma *) (local_got_refcounts + symtab_hdr->sh_info);
"thread local symbol"),
abfd,
h ? h->root.root.string : "<local>");
- goto error_return;
+ return FALSE;
}
}
if (htab->elf.dynobj == NULL)
htab->elf.dynobj = abfd;
if (!_bfd_elf_create_got_section (htab->elf.dynobj, info))
- goto error_return;
+ return FALSE;
}
if (r_type != R_386_TLS_IE)
break;
(sec, htab->elf.dynobj, 2, abfd, /*rela?*/ FALSE);
if (sreloc == NULL)
- goto error_return;
+ return FALSE;
}
/* If this is a global symbol, we count the number of
bfd_size_type amt = sizeof *p;
p = bfd_alloc (htab->elf.dynobj, amt);
if (p == NULL)
- goto error_return;
+ return FALSE;
p->next = *head;
*head = p;
p->sec = sec;
Reconstruct it for later use during GC. */
case R_386_GNU_VTINHERIT:
if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- goto error_return;
+ return FALSE;
break;
/* This relocation describes which C++ vtable entries are actually
BFD_ASSERT (h != NULL);
if (h != NULL
&& !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
- goto error_return;
+ return FALSE;
break;
default:
}
}
- if (isymbuf != NULL
- && (unsigned char *) isymbuf != symtab_hdr->contents)
- {
- if (!info->keep_memory)
- free (isymbuf);
- else
- {
- /* Cache the symbols for elf_link_input_bfd. */
- symtab_hdr->contents = (unsigned char *) isymbuf;
- }
- }
-
return TRUE;
-
-error_return:
- if (isymbuf != NULL
- && (unsigned char *) isymbuf != symtab_hdr->contents)
- free (isymbuf);
- return FALSE;
}
/* Return the section that should be marked against GC for a given
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
asection *sreloc;
- Elf_Internal_Sym *isymbuf;
if (info->relocatable)
return TRUE;
htab = elf64_x86_64_hash_table (info);
symtab_hdr = &elf_symtab_hdr (abfd);
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
sym_hashes = elf_sym_hashes (abfd);
sreloc = NULL;
/* A local symbol. */
Elf_Internal_Sym *isym;
- /* Read this BFD's local symbols. */
- if (isymbuf == NULL)
- {
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- return FALSE;
- }
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
/* Check relocation against local STT_GNU_IFUNC symbol. */
- isym = isymbuf + r_symndx;
if (ELF64_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
{
h = elf64_x86_64_get_local_sym_hash (htab, abfd, rel,
TRUE);
if (h == NULL)
- goto error_return;
+ return FALSE;
/* Fake a STT_GNU_IFUNC symbol. */
h->type = STT_GNU_IFUNC;
case R_X86_64_GOTPCREL:
case R_X86_64_GOTPCREL64:
if (!_bfd_elf_create_ifunc_sections (abfd, info))
- goto error_return;
+ return FALSE;
break;
}
? h->root.root.string : "a local symbol"),
__FUNCTION__);
bfd_set_error (bfd_error_bad_value);
- goto error_return;
+ return FALSE;
case R_X86_64_64:
h->non_got_ref = 1;
(abfd, info, sec, sreloc,
&((struct elf64_x86_64_link_hash_entry *) h)->dyn_relocs);
if (sreloc == NULL)
- goto error_return;
+ return FALSE;
}
break;
if (htab->elf.sgot == NULL
&& !_bfd_elf_create_got_section (htab->elf.dynobj,
info))
- goto error_return;
+ return FALSE;
break;
}
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
rel, rel_end, h))
- goto error_return;
+ return FALSE;
switch (r_type)
{
x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value);
- goto error_return;
+ return FALSE;
}
break;
local_got_refcounts = ((bfd_signed_vma *)
bfd_zalloc (abfd, size));
if (local_got_refcounts == NULL)
- goto error_return;
+ return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
elf64_x86_64_local_tlsdesc_gotent (abfd)
= (bfd_vma *) (local_got_refcounts + symtab_hdr->sh_info);
(*_bfd_error_handler)
(_("%B: '%s' accessed both as normal and thread local symbol"),
abfd, h ? h->root.root.string : "<local>");
- goto error_return;
+ return FALSE;
}
}
htab->elf.dynobj = abfd;
if (!_bfd_elf_create_got_section (htab->elf.dynobj,
info))
- goto error_return;
+ return FALSE;
}
break;
x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value);
- goto error_return;
+ return FALSE;
}
/* Fall through. */
(sec, htab->elf.dynobj, 3, abfd, /*rela?*/ TRUE);
if (sreloc == NULL)
- goto error_return;
+ return FALSE;
}
/* If this is a global symbol, we count the number of
p = ((struct elf_dyn_relocs *)
bfd_alloc (htab->elf.dynobj, amt));
if (p == NULL)
- goto error_return;
+ return FALSE;
p->next = *head;
*head = p;
p->sec = sec;
Reconstruct it for later use during GC. */
case R_X86_64_GNU_VTINHERIT:
if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- goto error_return;
+ return FALSE;
break;
/* This relocation describes which C++ vtable entries are actually
BFD_ASSERT (h != NULL);
if (h != NULL
&& !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- goto error_return;
+ return FALSE;
break;
default:
}
}
- if (isymbuf != NULL
- && (unsigned char *) isymbuf != symtab_hdr->contents)
- {
- if (!info->keep_memory)
- free (isymbuf);
- else
- {
- /* Cache the symbols for elf_link_input_bfd. */
- symtab_hdr->contents = (unsigned char *) isymbuf;
- }
- }
-
return TRUE;
-
-error_return:
- if (isymbuf != NULL
- && (unsigned char *) isymbuf != symtab_hdr->contents)
- free (isymbuf);
- return FALSE;
}
/* Return the section that should be marked against GC for a given