aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-08-12 15:51:09 +0000
committerIan Lance Taylor <ian@airs.com>1994-08-12 15:51:09 +0000
commit1c640609d8f6e4ceb83653a3112d8aa293085fdf (patch)
tree6fe76593b000ba715a74527ee5d84372a046d0c2 /bfd
parent098e8a89ec1c114bbc3863537fdd80677aa5e321 (diff)
downloadgdb-1c640609d8f6e4ceb83653a3112d8aa293085fdf.zip
gdb-1c640609d8f6e4ceb83653a3112d8aa293085fdf.tar.gz
gdb-1c640609d8f6e4ceb83653a3112d8aa293085fdf.tar.bz2
* 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>.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog11
-rw-r--r--bfd/elfcode.h17
2 files changed, 28 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9b60e1d..88c1a02 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
+ <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
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 3b70b07..4cad55d 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