aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1999-07-13 18:21:29 +0000
committerRichard Henderson <rth@redhat.com>1999-07-13 18:21:29 +0000
commit30b30c21815a6f23b0db7b135926f988ddff22a3 (patch)
tree3a29e627f94610eba3a177b83acd0ed54f8913d7 /bfd/elf32-mips.c
parente1ee1229a2384e923b73ef5943141fa39d51fdff (diff)
downloadgdb-30b30c21815a6f23b0db7b135926f988ddff22a3.zip
gdb-30b30c21815a6f23b0db7b135926f988ddff22a3.tar.gz
gdb-30b30c21815a6f23b0db7b135926f988ddff22a3.tar.bz2
* elf-bfd.h (struct elf_link_local_dynamic_entry): New.
(struct elf_link_hash_table): Add dynlocal. (_bfd_elf_link_lookup_local_dynindx): Prototype. (_bfd_elf_link_adjust_dynindx): Delete. (_bfd_elf_link_renumber_dynsyms): Prototype. (_bfd_elf,link_record_local_dynamic_symbol): Prototype. * elfcode.h (elf_link_record_local_dynamic_symbol): New alias. * elflink.c (_bfd_elf_link_adjust_dynindx): Delete. (_bfd_elf_link_lookup_local_dynindx): New function. (elf_link_renumber_hash_table_dynsyms): New function. (_bfd_elf_link_renumber_dynsyms): New function. * elflink.h (elf_link_record_local_dynamic_symbol): New function. (struct elf_assign_sym_version_info): Delete removed_dynamic. (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output instead of elf_link_remove_section_and_adjust_dynindices. Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms. (elf_link_assign_sym_version): Remove removed_dynamic code. (elf_link_renumber_dynsyms): Delete. (elf_bfd_final_link): Install section and local symbols into .dynsym. * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete. (elf_m68k_size_dynamic_sections): Don't set section dynindicies. (elf_m68k_finish_dynamic_sections): Don't write section dynsyms. * elf32-mips.c: Similarly. * elf32-ppc.c: Similarly. * elf32-sparc.c: Similarly. * elf64-alpha.c: Similarly. * elf64-sparc.c: Similarly.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r--bfd/elf32-mips.c73
1 files changed, 10 insertions, 63 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 03d7f3f..5f04726 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -7693,32 +7693,6 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
return false;
}
- /* If we use dynamic linking, we generate a section symbol for each
- output section. These are local symbols, which means that they
- must come first in the dynamic symbol table.
- That means we must increment the dynamic symbol index of every
- other dynamic symbol. */
- {
- unsigned int c, i;
-
- c = 0;
- if (elf_hash_table (info)->dynamic_sections_created)
- {
- c = bfd_count_sections (output_bfd);
- elf_link_hash_traverse (elf_hash_table (info),
- _bfd_elf_link_adjust_dynindx,
- (PTR) &c);
- elf_hash_table (info)->dynsymcount += c;
-
- for (i = 1, s = output_bfd->sections; s != NULL; s = s->next, i++)
- {
- elf_section_data (s)->dynindx = i;
- /* These symbols will have no names, so we don't need to
- fiddle with dynstr_index. */
- }
- }
- }
-
return true;
}
@@ -8163,59 +8137,32 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info)
= MIPS_ELF_GOT_SIZE (output_bfd);
{
- asection *sdynsym;
asection *smsym;
asection *s;
- Elf_Internal_Sym sym;
Elf32_compact_rel cpt;
- /* Set up the section symbols for the output sections. SGI sets
- the STT_NOTYPE attribute for these symbols. Should we do so? */
+ /* ??? The section symbols for the output sections were set up in
+ _bfd_elf_final_link. SGI sets the STT_NOTYPE attribute for these
+ symbols. Should we do so? */
- sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
smsym = bfd_get_section_by_name (dynobj,
MIPS_ELF_MSYM_SECTION_NAME (dynobj));
- if (sdynsym != NULL)
+ if (smsym != NULL)
{
Elf32_Internal_Msym msym;
- sym.st_size = 0;
- sym.st_name = 0;
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
- sym.st_other = 0;
-
msym.ms_hash_value = 0;
msym.ms_info = ELF32_MS_INFO (0, 1);
for (s = output_bfd->sections; s != NULL; s = s->next)
{
- int indx;
- long dynindx;
-
- sym.st_value = s->vma;
-
- indx = elf_section_data (s)->this_idx;
- BFD_ASSERT (indx > 0);
- sym.st_shndx = indx;
-
- dynindx = elf_section_data (s)->dynindx;
-
- (*get_elf_backend_data (output_bfd)->s->swap_symbol_out)
- (output_bfd, &sym,
- sdynsym->contents
- + (dynindx * MIPS_ELF_SYM_SIZE (output_bfd)));
-
- if (smsym)
- bfd_mips_elf_swap_msym_out
- (output_bfd, &msym,
- (((Elf32_External_Msym *) smsym->contents)
- + dynindx));
- }
+ long dynindx = elf_section_data (s)->dynindx;
- /* Set the sh_info field of the output .dynsym section to
- the index of the first global symbol. */
- elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
- bfd_count_sections (output_bfd) + 1;
+ bfd_mips_elf_swap_msym_out
+ (output_bfd, &msym,
+ (((Elf32_External_Msym *) smsym->contents)
+ + dynindx));
+ }
}
if (SGI_COMPAT (output_bfd))