diff options
author | Alan Modra <amodra@gmail.com> | 2008-07-21 07:36:25 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2008-07-21 07:36:25 +0000 |
commit | dc1859a6efe9122ab93383ff256aeff62d41e7cb (patch) | |
tree | 88f6f1f940a2abf017021c2d4d95e263676dc60d /bfd/elf32-spu.c | |
parent | 1d1f116d7e3d2a6ed2410f538b0843453a13a3d1 (diff) | |
download | gdb-dc1859a6efe9122ab93383ff256aeff62d41e7cb.zip gdb-dc1859a6efe9122ab93383ff256aeff62d41e7cb.tar.gz gdb-dc1859a6efe9122ab93383ff256aeff62d41e7cb.tar.bz2 |
* elf32-spu.c (spu_elf_relocate_section): Expand
RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for
R_SPU_PPU32 and R_SPU_PPU64 relocations.
Diffstat (limited to 'bfd/elf32-spu.c')
-rw-r--r-- | bfd/elf32-spu.c | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index b41d35f..71fa925 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -3966,10 +3966,51 @@ spu_elf_relocate_section (bfd *output_bfd, } else { - RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, - r_symndx, symtab_hdr, sym_hashes, - h, sec, relocation, - unresolved_reloc, warned); + if (sym_hashes == NULL) + return FALSE; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + relocation = 0; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + if (sec == NULL + || sec->output_section == NULL) + /* Set a flag that will be cleared later if we find a + relocation value for this symbol. output_section + is typically NULL for symbols satisfied by a shared + library. */ + unresolved_reloc = TRUE; + else + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + ; + else if (info->unresolved_syms_in_objects == RM_IGNORE + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + ; + else if (!info->relocatable + && !(r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64)) + { + bfd_boolean err; + err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR + || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); + if (!info->callbacks->undefined_symbol (info, + h->root.root.string, + input_bfd, + input_section, + rel->r_offset, err)) + return FALSE; + warned = TRUE; + } sym_name = h->root.root.string; } |