* elfcode.h (elf_link_add_object_symbols): If there is no symbol
authorIan Lance Taylor <ian@airs.com>
Fri, 12 Aug 1994 15:51:09 +0000 (15:51 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 12 Aug 1994 15:51:09 +0000 (15:51 +0000)
table, try using the dynamic symbol table.  From Eric Youngdale
<ericy@cais.cais.com>.

bfd/ChangeLog
bfd/elfcode.h

index 9b60e1d..88c1a02 100644 (file)
@@ -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
+       <ericy@cais.cais.com>.
+
+       * 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
index 3b70b07..4cad55d 100644 (file)
@@ -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