unsigned int *r_type, int tls_type,
const Elf_Internal_Rela *rel,
const Elf_Internal_Rela *relend,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h,
+ unsigned long r_symndx)
{
unsigned int from_type = *r_type;
unsigned int to_type = from_type;
from_type, rel, relend))
{
reloc_howto_type *from, *to;
+ const char *name;
from = elf_i386_rtype_to_howto (abfd, from_type);
to = elf_i386_rtype_to_howto (abfd, to_type);
+ if (h)
+ name = h->root.root.string;
+ else
+ {
+ Elf_Internal_Sym *isym;
+ struct elf_i386_link_hash_table *htab;
+ htab = elf_i386_hash_table (info);
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
+ }
+
(*_bfd_error_handler)
(_("%B: TLS transition from %s to %s against `%s' at 0x%lx "
"in section `%A' failed"),
- abfd, sec, from->name, to->name,
- h ? h->root.root.string : "a local symbol",
+ abfd, sec, from->name, to->name, name,
(unsigned long) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
unsigned int r_type;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *isym;
+ const char *name;
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
{
/* A local symbol. */
- Elf_Internal_Sym *isym;
-
isym = bfd_sym_from_r_symndx (&htab->sym_cache,
abfd, r_symndx);
if (isym == NULL)
}
else
{
+ isym = NULL;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
switch (r_type)
{
default:
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym,
+ NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against STT_GNU_IFUNC "
"symbol `%s' isn't handled by %s"), abfd,
elf_howto_table[r_type].name,
- (h->root.root.string
- ? h->root.root.string : "a local symbol"),
- __FUNCTION__);
+ name, __FUNCTION__);
bfd_set_error (bfd_error_bad_value);
return FALSE;
if (! elf_i386_tls_transition (info, abfd, sec, NULL,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
- rel, rel_end, h))
+ rel, rel_end, h, r_symndx))
return FALSE;
switch (r_type)
tls_type |= old_tls_type;
else
{
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym,
+ NULL);
(*_bfd_error_handler)
(_("%B: `%s' accessed both as normal and "
"thread local symbol"),
- abfd,
- h ? h->root.root.string : "<local>");
+ abfd, name);
return FALSE;
}
}
if (! elf_i386_tls_transition (info, abfd, sec, NULL,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
- rel, relend, h))
+ rel, relend, h, r_symndx))
return FALSE;
switch (r_type)
{
asection *plt, *gotplt, *base_got;
bfd_vma plt_index;
+ const char *name;
if ((input_section->flags & SEC_ALLOC) == 0
|| h->plt.offset == (bfd_vma) -1)
switch (r_type)
{
default:
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+ NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against STT_GNU_IFUNC "
"symbol `%s' isn't handled by %s"), input_bfd,
elf_howto_table[r_type].name,
- (h->root.root.string
- ? h->root.root.string : "a local symbol"),
- __FUNCTION__);
+ name, __FUNCTION__);
bfd_set_error (bfd_error_bad_value);
return FALSE;
input_section, contents,
symtab_hdr, sym_hashes,
&r_type, tls_type, rel,
- relend, h))
+ relend, h, r_symndx))
return FALSE;
if (r_type == R_386_TLS_LE_32)
input_section, contents,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN, rel,
- relend, h))
+ relend, h, r_symndx))
return FALSE;
if (r_type != R_386_TLS_LDM)
unsigned int *r_type, int tls_type,
const Elf_Internal_Rela *rel,
const Elf_Internal_Rela *relend,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h,
+ unsigned long r_symndx)
{
unsigned int from_type = *r_type;
unsigned int to_type = from_type;
from_type, rel, relend))
{
reloc_howto_type *from, *to;
+ const char *name;
from = elf64_x86_64_rtype_to_howto (abfd, from_type);
to = elf64_x86_64_rtype_to_howto (abfd, to_type);
+ if (h)
+ name = h->root.root.string;
+ else
+ {
+ Elf_Internal_Sym *isym;
+ struct elf64_x86_64_link_hash_table *htab;
+ htab = elf64_x86_64_hash_table (info);
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
+ }
+
(*_bfd_error_handler)
(_("%B: TLS transition from %s to %s against `%s' at 0x%lx "
"in section `%A' failed"),
- abfd, sec, from->name, to->name,
- h ? h->root.root.string : "a local symbol",
+ abfd, sec, from->name, to->name, name,
(unsigned long) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
unsigned int r_type;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *isym;
+ const char *name;
r_symndx = ELF64_R_SYM (rel->r_info);
r_type = ELF64_R_TYPE (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
{
/* A local symbol. */
- Elf_Internal_Sym *isym;
-
isym = bfd_sym_from_r_symndx (&htab->sym_cache,
abfd, r_symndx);
if (isym == NULL)
}
else
{
+ isym = NULL;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
switch (r_type)
{
default:
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym,
+ NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against STT_GNU_IFUNC "
"symbol `%s' isn't handled by %s"), abfd,
x86_64_elf_howto_table[r_type].name,
- (h->root.root.string
- ? h->root.root.string : "a local symbol"),
- __FUNCTION__);
+ name, __FUNCTION__);
bfd_set_error (bfd_error_bad_value);
return FALSE;
if (! elf64_x86_64_tls_transition (info, abfd, sec, NULL,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
- rel, rel_end, h))
+ rel, rel_end, h, r_symndx))
return FALSE;
switch (r_type)
case R_X86_64_TPOFF32:
if (info->shared)
{
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym,
+ NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
abfd,
- x86_64_elf_howto_table[r_type].name,
- (h) ? h->root.root.string : "a local symbol");
+ x86_64_elf_howto_table[r_type].name, name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
tls_type |= old_tls_type;
else
{
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr,
+ isym, NULL);
(*_bfd_error_handler)
(_("%B: '%s' accessed both as normal and thread local symbol"),
- abfd, h ? h->root.root.string : "<local>");
+ abfd, name);
return FALSE;
}
}
&& (sec->flags & SEC_ALLOC) != 0
&& (sec->flags & SEC_READONLY) != 0)
{
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
- abfd,
- x86_64_elf_howto_table[r_type].name,
- (h) ? h->root.root.string : "a local symbol");
+ abfd, x86_64_elf_howto_table[r_type].name, name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (! elf64_x86_64_tls_transition (info, abfd, sec, NULL,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
- rel, relend, h))
+ rel, relend, h, r_symndx))
return FALSE;
switch (r_type)
{
asection *plt;
bfd_vma plt_index;
+ const char *name;
if ((input_section->flags & SEC_ALLOC) == 0
|| h->plt.offset == (bfd_vma) -1)
switch (r_type)
{
default:
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+ NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against STT_GNU_IFUNC "
"symbol `%s' isn't handled by %s"), input_bfd,
x86_64_elf_howto_table[r_type].name,
- (h->root.root.string
- ? h->root.root.string : "a local symbol"),
- __FUNCTION__);
+ name, __FUNCTION__);
bfd_set_error (bfd_error_bad_value);
return FALSE;
case R_X86_64_64:
if (rel->r_addend != 0)
{
+ if (h->root.root.string)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr,
+ sym, NULL);
(*_bfd_error_handler)
(_("%B: relocation %s against STT_GNU_IFUNC "
"symbol `%s' has non-zero addend: %d"),
input_bfd, x86_64_elf_howto_table[r_type].name,
- (h->root.root.string
- ? h->root.root.string : "a local symbol"),
- rel->r_addend);
+ name, rel->r_addend);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
input_section, contents,
symtab_hdr, sym_hashes,
&r_type, tls_type, rel,
- relend, h))
+ relend, h, r_symndx))
return FALSE;
if (r_type == R_X86_64_TPOFF32)
input_section, contents,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
- rel, relend, h))
+ rel, relend, h, r_symndx))
return FALSE;
if (r_type != R_X86_64_TLSLD)