[llvm] [Object] Beginnings of SFrame parser and dumper (PR #147294)

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 03:23:08 PDT 2025


================
@@ -62,6 +62,8 @@ def memtag : FF<"memtag", "Display memory tagging metadata (modes, Android notes
 def needed_libs : FF<"needed-libs", "Display the needed libraries">, Group<grp_elf>;
 def notes : FF<"notes", "Display notes">, Group<grp_elf>;
 def program_headers : FF<"program-headers", "Display program headers">, Group<grp_elf>;
+def sframe_EQ : Joined<["--"], "sframe=">, HelpText<"Display SFrame section <name>">, MetaVarName<"<name>">, Group<grp_elf>;
+def sframe: FF<"sframe", "Alias for --sframe=.sframe">, Alias<sframe_EQ>, AliasArgs<[".sframe"]>, Group<grp_elf>;
----------------
labath wrote:

I think that would make sense, but it seems that the GNU version still uses (even at HEAD) the name based mechanism:
```
$ binutils/readelf /tmp/a2.o -e | grep sframe
  [ 9] .sframe2          GNU_SFRAME       0000000000000000  000000f8
  [10] .rela.sframe2     RELA             0000000000000000  000001c0
$ binutils/readelf /tmp/a2.o --sframe
readelf: Warning: Section '.sframe' was not dumped because it does not exist
```

@ibhagatgnu, any thoughts on this?

I'm also not sure how much we care about compatibility here -- I'd be fine with changing this even if gnu readelf doesn't do that.

https://github.com/llvm/llvm-project/pull/147294


More information about the llvm-commits mailing list