summaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-03-11 23:23:23 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-03-11 23:23:23 +0000
commit53801022b51a2489ebf7c12aceec0c35420e3031 (patch)
tree995553124a432a81f63e4c8b93777b6e7f2f8146 /bfd/elf64-ppc.c
parentf4ae7c05749821fa777202870cc090081634ebec (diff)
downloadgdb-53801022b51a2489ebf7c12aceec0c35420e3031.tar.gz
* elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
* elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int, SHN_BAD on error. (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from _bfd_elf_section_from_bfd_section, not -1. (swap_out_syms): Likewise. * elflink.c (elf_link_add_object_symbols): Likewise. (bfd_elf_get_bfd_needed_list): Likewise. (bfd_elf_match_symbols_in_sections): Likewise. (elf_link_add_object_symbols): Don't bother testing for symbols using normal sections before calling bfd_section_from_elf_index. (elf_link_input_bfd, bfd_elf_final_link): Likewise. (bfd_elf_reloc_symbol_deleted_p): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elf32-spu.c (get_sym_h): Likewise. * elf32-xtensa.c (get_elf_r_symndx_section): Likewise. * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index a1968245abf..8aabad741de 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5026,11 +5026,7 @@ opd_entry_value (asection *opd_sec,
sym += symndx;
val = sym->st_value;
- sec = NULL;
- if ((sym->st_shndx != SHN_UNDEF
- && sym->st_shndx < SHN_LORESERVE)
- || sym->st_shndx > SHN_HIRESERVE)
- sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx);
+ sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx);
BFD_ASSERT ((sec->flags & SEC_MERGE) == 0);
}
else
@@ -6060,14 +6056,7 @@ get_sym_h (struct elf_link_hash_entry **hp,
*symp = sym;
if (symsecp != NULL)
- {
- asection *symsec = NULL;
- if ((sym->st_shndx != SHN_UNDEF
- && sym->st_shndx < SHN_LORESERVE)
- || sym->st_shndx > SHN_HIRESERVE)
- symsec = bfd_section_from_elf_index (ibfd, sym->st_shndx);
- *symsecp = symsec;
- }
+ *symsecp = bfd_section_from_elf_index (ibfd, sym->st_shndx);
if (tls_maskp != NULL)
{
@@ -7577,10 +7566,7 @@ ppc64_elf_edit_toc (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
for (sym = local_syms;
sym < local_syms + symtab_hdr->sh_info;
++sym)
- if (sym->st_shndx != SHN_UNDEF
- && (sym->st_shndx < SHN_LORESERVE
- || sym->st_shndx > SHN_HIRESERVE)
- && sym->st_value != 0
+ if (sym->st_value != 0
&& bfd_section_from_elf_index (ibfd, sym->st_shndx) == toc)
{
if (skip[sym->st_value >> 3] != (unsigned long) -1)