From: Mark Wielaard Date: Thu, 16 Apr 2020 16:48:58 +0000 (+0200) Subject: elflint: Allow SHF_EXCLUDE as generic section flag when --gnu is given. X-Git-Tag: elfutils-0.180~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2fc0b737c1d55becda1f13dceec315a5589820a;p=thirdparty%2Felfutils.git elflint: Allow SHF_EXCLUDE as generic section flag when --gnu is given. 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 --- diff --git a/src/ChangeLog b/src/ChangeLog index e11fe79a5..dc345a04f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2020-04-16 Mark Wielaard + + * elflint.c (check_sections): Mask out SHF_EXCLUDE from processor + specific section flags when --gnu is given. + 2020-02-08 Mark Wielaard * elflint.c (check_program_header): Handle PT_GNU_PROPERTY. diff --git a/src/elflint.c b/src/elflint.c index 480d84ba9..0ef432366 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'"