public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "jpalus at fastmail dot com" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug tools/29498] Is it expected that eu-strip strips .note.GNU-stack
Date: Fri, 28 Oct 2022 23:06:04 +0000	[thread overview]
Message-ID: <bug-29498-10460-zZtdCFk2Os@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29498-10460@http.sourceware.org/bugzilla/>

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.

      parent reply	other threads:[~2022-10-28 23:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 21:23 [Bug tools/29498] New: " jpalus at fastmail dot com
2022-08-17  7:16 ` [Bug tools/29498] " mliska at suse dot cz
2022-10-27 20:34 ` mark at klomp dot org
2022-10-28 23:06 ` jpalus at fastmail dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29498-10460-zZtdCFk2Os@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).