From: Ian Lance Taylor Date: Mon, 6 Jun 1994 23:59:27 +0000 (+0000) Subject: * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6667b2bc37c1df46d1f208abadedd01f3e56143;p=binutils-gdb.git * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section into a BFD section just because SHF_ALLOC is set; require that it not use the normal symbol table. (elf_section_from_bfd_section): Corresponding change. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0969b768343..18cbb0c1fd5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ Mon Jun 6 10:57:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section + into a BFD section just because SHF_ALLOC is set; require that it + not use the normal symbol table. + (elf_section_from_bfd_section): Corresponding change. + Better indirect and warning symbol handling inspired by Stuart Quick . * linker.c (enum link_action): Add REF, MIND, CWARN, REFC. diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 28befbdf205..0181a559390 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -616,13 +616,11 @@ bfd_section_from_shdr (abfd, shindex) if (! bfd_section_from_shdr (abfd, hdr->sh_link)) return false; - /* If this reloc section does not use the main symbol table, - or if it is in the process image, we don't treat it as a - reloc section. BFD can't adequately represent such a - section, so at least for now, we don't try. We just - present it as a normal section. */ - if ((hdr->sh_flags & SHF_ALLOC) != 0 - || hdr->sh_link != elf_onesymtab (abfd)) + /* If this reloc section does not use the main symbol table we + don't treat it as a reloc section. BFD can't adequately + represent such a section, so at least for now, we don't + try. We just present it as a normal section. */ + if (hdr->sh_link != elf_onesymtab (abfd)) return _bfd_elf_make_section_from_shdr (abfd, hdr, name); /* Don't allow REL relocations on a machine that uses RELA and @@ -1267,8 +1265,7 @@ elf_fake_sections (abfd, asect, ignore) /* Assign all ELF section numbers. The dummy first section is handled here too. The link/info pointers for the standard section types are filled - in here too, while we're at it. (Link pointers for .stab sections are - not filled in here.) */ + in here too, while we're at it. */ static boolean assign_section_numbers (abfd) @@ -2581,8 +2578,7 @@ elf_section_from_bfd_section (abfd, asect) case SHT_REL: case SHT_RELA: /* We sometimes map a reloc section to a BFD section. */ - if (((hdr->sh_flags & SHF_ALLOC) != 0 - || hdr->sh_link != elf_onesymtab (abfd)) + if (hdr->sh_link != elf_onesymtab (abfd) && (asection *) hdr->rawdata == asect) return index; break;