diff options
author | Alan Modra <amodra@gmail.com> | 2021-12-09 19:44:07 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-12-11 11:09:47 +1030 |
commit | 1563e7179a7e7f06ae9b44725f191163ccf0975c (patch) | |
tree | 33dab81e334fcc4aad04bc2aeccdd55aec82a14e /bfd/elf.c | |
parent | edce4d8c6aea4854bde4120437357f0d20e88186 (diff) | |
download | gdb-1563e7179a7e7f06ae9b44725f191163ccf0975c.zip gdb-1563e7179a7e7f06ae9b44725f191163ccf0975c.tar.gz gdb-1563e7179a7e7f06ae9b44725f191163ccf0975c.tar.bz2 |
Don't edit bogus sh_link on reading relocatable objects (Oracle fix)
This reverts a 1995 fix to handle bogus object files. Presumably such
object files have long gone.
* elf.c (bfd_section_from_shdr): Remove old hack for Oracle
libraries.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 34 |
1 files changed, 0 insertions, 34 deletions
@@ -2389,40 +2389,6 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) goto success; } - /* For some incomprehensible reason Oracle distributes - libraries for Solaris in which some of the objects have - bogus sh_link fields. It would be nice if we could just - reject them, but, unfortunately, some people need to use - them. We scan through the section headers; if we find only - one suitable symbol table, we clobber the sh_link to point - to it. I hope this doesn't break anything. - - Don't do it on executable nor shared library. */ - if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0 - && elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_SYMTAB - && elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_DYNSYM) - { - unsigned int scan; - int found; - - found = 0; - for (scan = 1; scan < num_sec; scan++) - { - if (elf_elfsections (abfd)[scan]->sh_type == SHT_SYMTAB - || elf_elfsections (abfd)[scan]->sh_type == SHT_DYNSYM) - { - if (found != 0) - { - found = 0; - break; - } - found = scan; - } - } - if (found != 0) - hdr->sh_link = found; - } - /* Get the symbol table. */ if ((elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_SYMTAB || elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_DYNSYM) |