aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-04-27 20:16:08 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-04-27 20:16:08 +0000
commit26c61ae50be6d702a8d40bf3c968048a1801057a (patch)
tree4400e57d620b45863bbf39aa77acb03ae13e8719 /bfd/elfxx-ia64.c
parentdce669a1fd56f2017d9af535d05694a41d1f9398 (diff)
downloadgdb-26c61ae50be6d702a8d40bf3c968048a1801057a.zip
gdb-26c61ae50be6d702a8d40bf3c968048a1801057a.tar.gz
gdb-26c61ae50be6d702a8d40bf3c968048a1801057a.tar.bz2
2005-04-27 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (bfd_elf_sym_name): Also take "asection *". * elf.c (bfd_elf_sym_name): Updated. (group_signature): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_edit_opd): Likewise. (ppc64_elf_edit_toc): Likewise. (ppc64_elf_relocate_section): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.c (elf_link_input_bfd): Likewise. * elfxx-ia64.c (elfNN_ia64_relocate_section): Call bfd_elf_sym_name to get local symbol name when reporting errors.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 01e4d9f..de5793c 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -4014,7 +4014,9 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
(*_bfd_error_handler)
(_("%B: non-pic code with imm relocation against dynamic symbol `%s'"),
input_bfd,
- h->root.root.string);
+ h ? h->root.root.string
+ : bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+ sym_sec));
ret_val = FALSE;
continue;
@@ -4078,7 +4080,10 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
{
(*_bfd_error_handler)
(_("%B: @gprel relocation against dynamic symbol %s"),
- input_bfd, h->root.root.string);
+ input_bfd,
+ h ? h->root.root.string
+ : bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+ sym_sec));
ret_val = FALSE;
continue;
}
@@ -4279,7 +4284,12 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
msg = _("%B: speculation fixup to dynamic symbol %s");
else
msg = _("%B: @pcrel relocation against dynamic symbol %s");
- (*_bfd_error_handler) (msg, input_bfd, h->root.root.string);
+ (*_bfd_error_handler) (msg, input_bfd,
+ h ? h->root.root.string
+ : bfd_elf_sym_name (input_bfd,
+ symtab_hdr,
+ sym,
+ sym_sec));
ret_val = FALSE;
continue;
}
@@ -4476,15 +4486,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
if (h)
name = h->root.root.string;
else
- {
- name = bfd_elf_string_from_elf_section (input_bfd,
- symtab_hdr->sh_link,
- sym->st_name);
- if (name == NULL)
- return FALSE;
- if (*name == '\0')
- name = bfd_section_name (input_bfd, input_section);
- }
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+ sym_sec);
if (!(*info->callbacks->warning) (info, _("unsupported reloc"),
name, input_bfd,
input_section, rel->r_offset))
@@ -4503,15 +4506,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
if (h)
name = h->root.root.string;
else
- {
- name = bfd_elf_string_from_elf_section (input_bfd,
- symtab_hdr->sh_link,
- sym->st_name);
- if (name == NULL)
- return FALSE;
- if (*name == '\0')
- name = bfd_section_name (input_bfd, sym_sec);
- }
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
+ sym_sec);
switch (r_type)
{