bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/23611] objcopy is not removing the sections like .rela.plt


From: andrew.burgess at embecosm dot com
Subject: [Bug binutils/23611] objcopy is not removing the sections like .rela.plt and rela.dyn.
Date: Thu, 06 Sep 2018 21:07:15 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23611

--- Comment #1 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
I think that you are correct, these two sections don't behave like other
relocation sections.  The answer, I suspect is this code in elf.c:

    /* 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.  We also
       can't use it as a reloc section if it points to the null
       section, an invalid section, another reloc section, or its
       sh_link points to the null section.  */
    if (hdr->sh_link != elf_onesymtab (abfd)
        || hdr->sh_link == SHN_UNDEF
        || hdr->sh_info == SHN_UNDEF
        || hdr->sh_info >= num_sec
        || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL
        || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA)
      {
        ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name,
                                           shindex);
        goto success;
      }

The upshot is that some relocation sections are actually going to appear as
normal sections within the bfd's section list.

I think your patch is probably the right solution.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]