[Toybox] [PATCH] readelf: Fix the section flags handling.

enh enh at google.com
Fri Dec 1 14:20:31 PST 2023


On Fri, Dec 1, 2023 at 2:06 PM Rob Landley <rob at landley.net> wrote:
>
> On 12/1/23 09:41, enh wrote:
> >> Does it have any sort of stat -c syntax where I can at least REQUEST what I want
> >> out of it? No it does not. Because gnu. (Don't suggest it to them, they'll fsck
> >> it up 100% guaranteed.)
> >
> > (i don't really use the gnu one any more anyway. there's an
> > llvm-readelf too, and -- like all the other llvm tools -- it "just
> > works" regardless of what architecture the ELF file is for. it's worth
> > switching for that alone. and they _do_ have a proper machine-readable
> > format if you ask for it.)
>
> How do I ask?

`--elf-output-style=` and GNU, LLVM, or JSON (annoyingly all in
caps!). there's also llvm-readobj which defaults to json.

> If we factor out the appropriate generation functions so it's the same code
> producing the fields for both formats, I'm happy testing the machine readable
> output format and calling the LLVM version the one that TEST_HOST passes on.
>
> The gnu/dammit guys can catch up. (Or not, their call.)
>
> >> Rob
>
> Rob


More information about the Toybox mailing list