From: Ian Lance Taylor Date: Fri, 12 Aug 1994 15:51:09 +0000 (+0000) Subject: * elfcode.h (elf_link_add_object_symbols): If there is no symbol X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c640609d8f6e4ceb83653a3112d8aa293085fdf;p=binutils-gdb.git * elfcode.h (elf_link_add_object_symbols): If there is no symbol table, try using the dynamic symbol table. From Eric Youngdale . --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9b60e1d9740..88c1a024d73 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +Fri Aug 12 11:22:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (elf_link_add_object_symbols): If there is no symbol + table, try using the dynamic symbol table. From Eric Youngdale + . + + * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4. + The linker depends upon configuring for solaris2. + * hosts/solaris2.h: New file; include hosts/sysv4.h. + * config/solaris2.mh: New file; copy of config/sysv4.mh. + Wed Aug 10 13:09:38 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) * aoutx.h (adjust_z_magic): Make sure data section is padded to diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 3b70b0742bf..4cad55d40a4 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -3995,6 +3995,16 @@ elf_link_add_object_symbols (abfd, info) add_symbol_hook = get_elf_backend_data (abfd)->elf_add_symbol_hook; collect = get_elf_backend_data (abfd)->collect; + /* A stripped shared library might only have a dynamic symbol table, + not a regular symbol table. In that case we can still go ahead + and link using the dynamic symbol table. */ + if (elf_onesymtab (abfd) == 0 + && elf_dynsymtab (abfd) != 0) + { + elf_onesymtab (abfd) = elf_dynsymtab (abfd); + elf_tdata (abfd)->symtab_hdr = elf_tdata (abfd)->dynsymtab_hdr; + } + hdr = &elf_tdata (abfd)->symtab_hdr; symcount = hdr->sh_size / sizeof (Elf_External_Sym); @@ -5238,6 +5248,13 @@ elf_bfd_final_link (abfd, info) assign_section_numbers will create a reloc section. */ o->flags &=~ SEC_RELOC; } + + /* If the SEC_ALLOC flag is not set, force the section VMA to + zero. This is done in elf_fake_sections as well, but forcing + the VMA to 0 here will ensure that relocs against these + sections are handled correctly. */ + if ((o->flags & SEC_ALLOC) == 0) + o->vma = 0; } /* Figure out the file positions for everything but the symbol table