diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-08-12 15:51:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-08-12 15:51:09 +0000 |
commit | 1c640609d8f6e4ceb83653a3112d8aa293085fdf (patch) | |
tree | 6fe76593b000ba715a74527ee5d84372a046d0c2 /bfd/elfcode.h | |
parent | 098e8a89ec1c114bbc3863537fdd80677aa5e321 (diff) | |
download | gdb-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/elfcode.h')
-rw-r--r-- | bfd/elfcode.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 |