From ee75fd9567be17c012f4e85508bd2cafb7859aa5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 7 Sep 2004 13:40:37 +0000 Subject: * elf64-ppc.c (struct ppc_link_hash_table): Add stub_globals. (is_ppc64_elf_target): Rename from is_ppc64_target. Update all callers. (ppc_stub_name): Remove trailing "+0" on stub name. (create_linkage_sections): Create relocations for branch lookup table when --emit-relocs as well as when --shared. (ppc_build_one_stub): Emit relocs for long branch stubs. Adjust relbrlt test. For --emit-stub-syms, always output a sym even when one already exists on a plt call stub. Put stub type in the stub symbol name. (ppc_size_one_stub): Size long branch stub relocs. Adjust relbrlt test. (ppc64_elf_size_stubs): Count global sym stubs added. Zero reloc_count in stub sections. Adjust relbrlt test. (ppc64_elf_build_stubs): Adjust relbrlt test. Tweak stats output. * elflink.c (bfd_elf_size_dynamic_sections): Fix comment typo. (elf_link_input_bfd): Ignore symbol index zero relocs when checking for relocs against discarded symbols. Fix comments. --- bfd/elflink.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bfd/elflink.c') diff --git a/bfd/elflink.c b/bfd/elflink.c index e82a8e3..e4e8dcc 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4914,7 +4914,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, return FALSE; /* Add some entries to the .dynamic section. We fill in some of the - values later, in elf_bfd_final_link, but we must add the entries + values later, in bfd_elf_final_link, but we must add the entries now so that we know the final size of the .dynamic section. */ /* If there are initialization and/or finalization functions to @@ -6648,6 +6648,9 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) struct elf_link_hash_entry *h = NULL; const char *sym_name; + if (r_symndx == STN_UNDEF) + continue; + if (r_symndx >= locsymcount || (elf_bad_symtab (input_bfd) && finfo->sections[r_symndx] == NULL)) @@ -6840,7 +6843,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) symbol. We set the rel_hash entry for this reloc to point to the global hash table entry for this symbol. The symbol index is then - set at the end of elf_bfd_final_link. */ + set at the end of bfd_elf_final_link. */ indx = r_symndx - extsymoff; rh = elf_sym_hashes (input_bfd)[indx]; while (rh->root.type == bfd_link_hash_indirect @@ -7580,8 +7583,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (! _bfd_elf_compute_section_file_positions (abfd, info)) goto error_return; - /* That created the reloc sections. Set their sizes, and assign - them file positions, and allocate some buffers. */ + /* Set sizes, and assign file positions for reloc sections. */ for (o = abfd->sections; o != NULL; o = o->next) { if ((o->flags & SEC_RELOC) != 0) -- cgit v1.1