[patch] Compute name for xstormy16 global relocs
Nick Clifton
nickc@redhat.com
Mon Oct 18 08:06:00 GMT 2004
Hi Guys,
I am applying the patch below to fix another small problem with the
xstormy16 port. The problem was that for relocs against global
symbols the name of the symbol was not being computed. So any error
messages involving these relocs appeared to be against an anonymous
symbol.
Cheers
Nick
bfd/ChangeLog
2004-10-18 Nick Clifton <nickc@redhat.com>
* elf32-xstormy16.c (xstormy16_elf_relocate_section): Compute
'name' for relocs against both local and global symbols.
Index: elf32-xstormy16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xstormy16.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 elf32-xstormy16.c
*** elf32-xstormy16.c 29 Jun 2004 13:46:32 -0000 1.28
--- elf32-xstormy16.c 18 Oct 2004 08:02:46 -0000
*************** xstormy16_elf_relocate_section (output_b
*** 840,849 ****
sym = local_syms + r_symndx;
sec = local_sections [r_symndx];
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-
- name = bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
}
else
{
--- 840,845 ----
*************** xstormy16_elf_relocate_section (output_b
*** 855,860 ****
--- 851,866 ----
unresolved_reloc, warned);
}
+ if (h != NULL)
+ 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 || *name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
switch (ELF32_R_TYPE (rel->r_info))
{
case R_XSTORMY16_24:
More information about the Binutils
mailing list