diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-08-15 18:08:13 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-08-15 18:08:13 +0000 |
commit | 823609fe90b939d993e31e342637812abee9676e (patch) | |
tree | fc666faf6f50631414b3695b0a6107f695d5d1ed | |
parent | e8fbe6d9249ba4c01d42e7c1d20bd5b9e7091e66 (diff) | |
download | gdb-823609fe90b939d993e31e342637812abee9676e.zip gdb-823609fe90b939d993e31e342637812abee9676e.tar.gz gdb-823609fe90b939d993e31e342637812abee9676e.tar.bz2 |
* elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a
shared object has SHF_ALLOC set, create a BFD section for it.
(elf_section_from_bfd_section): There may be a BFD section for a
SHT_SYMTAB section.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfcode.h | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e49850b..74c58e8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ Mon Aug 15 12:16:56 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a + shared object has SHF_ALLOC set, create a BFD section for it. + (elf_section_from_bfd_section): There may be a BFD section for a + SHT_SYMTAB section. + * coffcode.h (styp_to_sec_flags): Add name argument. If no flags are recognized, chose section flags based on the name. (bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add diff --git a/bfd/elfcode.h b/bfd/elfcode.h index f6e14fa..5a2ef54 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -546,6 +546,18 @@ bfd_section_from_shdr (abfd, shindex) elf_tdata (abfd)->symtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->symtab_hdr; abfd->flags |= HAS_SYMS; + + /* Sometimes a shared object will map in the symbol table. If + SHF_ALLOC is set, and this is a shared object, then we also + treat this section as a BFD section. We can not base the + decision purely on SHF_ALLOC, because that flag is sometimes + set in a relocateable object file, which would confuse the + linker. */ + if ((hdr->sh_flags & SHF_ALLOC) != 0 + && (abfd->flags & DYNAMIC) != 0 + && ! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + return true; case SHT_DYNSYM: /* A dynamic symbol table */ @@ -2586,6 +2598,7 @@ elf_section_from_bfd_section (abfd, asect) case SHT_HASH: case SHT_DYNAMIC: case SHT_DYNSYM: + case SHT_SYMTAB: if (hdr->rawdata) { if (((struct sec *) (hdr->rawdata)) == asect) |