diff options
author | Jeff Law <law@redhat.com> | 1999-09-02 23:44:54 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1999-09-02 23:44:54 +0000 |
commit | 20e29382fd8835fc5fb13ad0e501e52f53f2932d (patch) | |
tree | de2adb2e7aaf4f3ef6b23404cd9355b010c6c128 /bfd/elflink.h | |
parent | f6e143a1993a216698804357c3b4e59ad5ea63d9 (diff) | |
download | gdb-20e29382fd8835fc5fb13ad0e501e52f53f2932d.zip gdb-20e29382fd8835fc5fb13ad0e501e52f53f2932d.tar.gz gdb-20e29382fd8835fc5fb13ad0e501e52f53f2932d.tar.bz2 |
* elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK
field in hpux11 shared libraries.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 35bf885..b7b5b23 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -954,6 +954,23 @@ elf_link_add_object_symbols (abfd, info) goto error_return; link = elf_elfsections (abfd)[elfsec]->sh_link; + { + /* The shared libraries distributed with hpux11 have a bogus + sh_link field for the ".dynamic" section. This code detects + when LINK refers to a section that is not a string table and + tries to find the string table for the ".dynsym" section + instead. */ + Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[link]; + if (hdr->sh_type != SHT_STRTAB) + { + asection *s = bfd_get_section_by_name (abfd, ".dynsym"); + int elfsec = _bfd_elf_section_from_bfd_section (abfd, s); + if (elfsec == -1) + goto error_return; + link = elf_elfsections (abfd)[elfsec]->sh_link; + } + } + extdyn = dynbuf; extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn); for (; extdyn < extdynend; extdyn++) |