[Bug tools/29498] Is it expected that eu-strip strips .note.GNU-stack

jpalus at fastmail dot com sourceware-bugzilla@sourceware.org
Fri Oct 28 23:06:04 GMT 2022


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

--- Comment #3 from Jan Palus <jpalus at fastmail dot com> ---
If I understand it correctly in binutils primary criteria for removing section
is whether it is marked with SEC_DEBUGGING flag:

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/objcopy.c;h=d20aaef9f4f2e2a910bd7bf666dab6e3c158fc1b;hb=HEAD#l1366

and the flag for ELF seems to be set here:

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elf.c;h=81825b748d75f2b68a6cca1c54b126df53c36dc2;hb=HEAD#l1093

          if (startswith (name, ".debug")
              || startswith (name, ".gnu.debuglto_.debug_")
              || startswith (name, ".gnu.linkonce.wi.")
              || startswith (name, ".zdebug"))
            flags |= SEC_DEBUGGING | SEC_ELF_OCTETS;
          else if (startswith (name, GNU_BUILD_ATTRS_SECTION_NAME)
                   || startswith (name, ".note.gnu"))
            {
              flags |= SEC_ELF_OCTETS;
              opb = 1;
            }
          else if (startswith (name, ".line")
                   || startswith (name, ".stab")
                   || strcmp (name, ".gdb_index") == 0)
            flags |= SEC_DEBUGGING;

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


More information about the Elfutils-devel mailing list