public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elflint: Allow SHF_EXCLUDE as generic section flag when --gnu is given.
@ 2020-04-16 16:53 Mark Wielaard
  2020-04-21 21:01 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2020-04-16 16:53 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

Strictly speaking SHF_EXCLUDE is a processor specific section flag,
but it is used generically in the GNU toolchain. For example when
adding .gnu.lto_ sections.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 src/ChangeLog | 5 +++++
 src/elflint.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/src/ChangeLog b/src/ChangeLog
index e11fe79a..dc345a04 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-16  Mark Wielaard  <mark@klomp.org>
+
+	* elflint.c (check_sections): Mask out SHF_EXCLUDE from processor
+	specific section flags when --gnu is given.
+
 2020-02-08  Mark Wielaard  <mark@klomp.org>
 
 	* elflint.c (check_program_header): Handle PT_GNU_PROPERTY.
diff --git a/src/elflint.c b/src/elflint.c
index 480d84ba..0ef43236 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3921,6 +3921,11 @@ section [%2zu] '%s': size not multiple of entry size\n"),
 	  GElf_Xword sh_flags = shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS;
 	  if (sh_flags & SHF_MASKPROC)
 	    {
+	      /* Strictly speaking SHF_EXCLUDE is a processor specific
+		 section flag, but it is used generically in the GNU
+		 toolchain.  */
+	      if (gnuld)
+		sh_flags &= ~(GElf_Xword) SHF_EXCLUDE;
 	      if (!ebl_machine_section_flag_check (ebl,
 						   sh_flags & SHF_MASKPROC))
 		ERROR (gettext ("section [%2zu] '%s'"
-- 
2.18.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] elflint: Allow SHF_EXCLUDE as generic section flag when --gnu is given.
  2020-04-16 16:53 [PATCH] elflint: Allow SHF_EXCLUDE as generic section flag when --gnu is given Mark Wielaard
@ 2020-04-21 21:01 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2020-04-21 21:01 UTC (permalink / raw)
  To: elfutils-devel

On Thu, Apr 16, 2020 at 06:53:41PM +0200, Mark Wielaard wrote:
> Strictly speaking SHF_EXCLUDE is a processor specific section flag,
> but it is used generically in the GNU toolchain. For example when
> adding .gnu.lto_ sections.

I pushed this to master.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-21 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 16:53 [PATCH] elflint: Allow SHF_EXCLUDE as generic section flag when --gnu is given Mark Wielaard
2020-04-21 21:01 ` Mark Wielaard

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).