proj/pax-utils:master commit in: /

"Sam James" <[email protected]> Sun, 02 Aug 2026 14:06:17 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785679449.f94f1c3a96479a0583cf456790331593e42f93ec.sam@gentoo>
commit:     f94f1c3a96479a0583cf456790331593e42f93ec
Author:     Lukas Schmelting <lschmelting <AT> posteo <DOT> com>
AuthorDate: Tue Jul 28 21:16:58 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug  2 14:04:09 2026 +0000
URL:        https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=f94f1c3a

scanelf: recognize .note.GNU-stack with SHT_NOTE type

binutils 2.47 changed the section type of .note.GNU-stack from
SHT_PROGBITS to SHT_NOTE. Allow scanelf to process both forms.

Bug: https://sourceware.org/PR33851
Closes: https://bugs.gentoo.org/980108
Signed-off-by: Lukas Schmelting <lschmelting <AT> posteo.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 scanelf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scanelf.c b/scanelf.c
index a3dd15c..eda1f5d 100644
--- a/scanelf.c
+++ b/scanelf.c
@@ -482,7 +482,8 @@ static const char *scanelf_file_phdr(elfobj *elf, char *found_phdr, char *found_
 		 */ \
 		check_flags = /*SHF_WRITE|*/SHF_EXECINSTR; \
 		for (i = 0; i < shnum; ++i) { \
-			if (EGET(shdr[i].sh_type) != SHT_PROGBITS) continue; \
+			if (EGET(shdr[i].sh_type) != SHT_PROGBITS && EGET(shdr[i].sh_type) != SHT_NOTE) \
+				continue; \
 			offset = EGET(strtbl->sh_offset) + EGET(shdr[i].sh_name); \
 			if (!VALID_RANGE(elf, offset, sizeof(NOTE_GNU_STACK))) \
 				continue; \