public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: elfutils-devel@sourceware.org
Subject: [PATCH] readelf: Handle SHT_RISCV_ATTRIBUTES like SHT_GNU_ATTRIBUTES
Date: Wed, 10 Aug 2022 10:52:42 +0200	[thread overview]
Message-ID: <mvmiln0jx9h.fsf@suse.de> (raw)

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 src/ChangeLog | 4 ++++
 src/readelf.c | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index fbcef29e..88db4051 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-10  Andreas Schwab  <schwab@suse.de>
+
+	* readelf.c (print_attributes): Also handle SHT_RISCV_ATTRIBUTES.
+
 2022-08-09  Andreas Schwab  <schwab@suse.de>
 
 	* elflint.c (check_program_header): Don't complain about p_filesz
diff --git a/src/readelf.c b/src/readelf.c
index f1f77ce8..1a10fd01 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -3672,7 +3672,9 @@ print_attributes (Ebl *ebl, const GElf_Ehdr *ehdr)
 			   && (shdr->sh_type != SHT_ARM_ATTRIBUTES
 			       || ehdr->e_machine != EM_ARM)
 			   && (shdr->sh_type != SHT_CSKY_ATTRIBUTES
-			       || ehdr->e_machine != EM_CSKY)))
+			       || ehdr->e_machine != EM_CSKY)
+			   && (shdr->sh_type != SHT_RISCV_ATTRIBUTES
+			       || ehdr->e_machine != EM_RISCV)))
 	continue;
 
       printf (_("\
-- 
2.37.1


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

             reply	other threads:[~2022-08-10  8:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  8:52 Andreas Schwab [this message]
2022-08-13 19:12 ` Mark Wielaard

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=mvmiln0jx9h.fsf@suse.de \
    --to=schwab@suse.de \
    --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).