public inbox for
 help / color / mirror / Atom feed
From: Mark Wielaard <>
To: "Martin Liška" <>,
Subject: Re: [PATCH] readelf: print warning for -sW
Date: Fri, 25 Nov 2022 18:27:00 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Marin,

On Fri, 2022-11-25 at 14:29 +0100, Martin Liška wrote:
> The option -s accepts in elfutils (compared to binutils) a positional
> argument that is name of a symbol table section which should be
> printed.
> Thus, print a reasonable warning if -sW is used:
> ./src/readelf -sW a.out
> WARNING: cannot find section: 'W'
> Ready for master?

Looks good. But one nitpick below.

> src/ChangeLog:
> 	* readelf.c (print_symtab): Change signature and return true if
> 	something is printed.
> 	(process_elf_file): Use it and print warning.

Aha, we are processing the symbol sections twice, once for 
SHT_DYNSYM, then for SHT_SYMTAB. And the named section should be one or
the other. Good.

> tests/ChangeLog:
> 	* Test -sW.

Plus a new testcase. Perfect..

> diff --git a/tests/ b/tests/
> index ee1c0e82..c150c165 100755
> --- a/tests/
> +++ b/tests/
> @@ -395,4 +395,7 @@ Symbol table [27] '.symtab' contains 42 entries:
>     41: 00000000004003a8      0 FUNC    GLOBAL DEFAULT       11 _init
>  EOF
> +${abs_top_builddir}/src/readelf --elf-section -sW testfilebaxmin 2>&1 \
> +  | grep "WARNING: cannot find section: 'W'" >/dev/null || exit 2
> +

You need to run a tests with testrun or testrun_compare so they
actually run against the just build libraries (and so they run under
valgrind when configured with --enable-valgrind).

So in this case just add a testrun in front.

-${abs_top_builddir}/src/readelf --elf-section -sW testfilebaxmin 2>&1 \
+testrun ${abs_top_builddir}/src/readelf --elf-section -sW testfilebaxmin 2>&1 \

OK with that change.



      reply	other threads:[~2022-11-25 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 13:29 Martin Liška
2022-11-25 17:27 ` Mark Wielaard [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:

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

  git send-email \ \ \ \ \

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