This is a GNU-style implementation of the --stack-sizes option. It dumps the stack sizes sections in the format
StackSizes:
Size Function
<Stacksize> <FunctionName>
... ...
LLVM style dumping is not implemented yet.
Differential D65313
[llvm-readelf] Dump the stack sizes sections with --stack-sizes wolfgangp on Jul 25 2019, 6:43 PM. Authored by
Details This is a GNU-style implementation of the --stack-sizes option. It dumps the stack sizes sections in the format Size Function <Stacksize> <FunctionName> ... ... LLVM style dumping is not implemented yet.
Diff Detail
Event TimelineComment Actions The first comments are below.
Comment Actions
Comment Actions I'm not familiar with the .stack_sizes functionality in general, but it seems useful & could have saved me countless hours of debugging (large stack frames => stack overflows in recursive parsers) if I knew more about how it worked.
Comment Actions Addressed review comments:
Not resolved: Comment Actions Do you have a discussion going on somewhere you can link to? Personally, I think it's neat & wouldn't mind it being included as part of --all for personal use, but generally we want to make llvm-readelf as close to GNU readelf as possible. (This has been feedback given at llvm dev meetings too). Maybe it could be part of --all only when invoked as llvm-readobj? Though it doesn't make much since *now* because this only has the GNU-style dumper implemented, and in fact prints a warning for the LLVM style -- but in the future, we could do that. Comment Actions Not really. I'd like to ask @jhenderson for input on this, but your argument below about being as close to GNU readelf as possible sounds convincing.
Comment Actions I've only done a fairly brief review, so don't wait for me for an LGTM if anybody else gives it. I'm happy to defer to others judgment on the --all behaviour. My instinct there is that the --all behaviour change is a wider issue beyond --stack-sizes. For example, --addrsig, --hash-symbols etc are switches that don't exist in GNU readelf, but might be printed if they did.
Comment Actions Addressed review comments: --all does not imply --stack-sizes any more Changed some comments to use third person instead of first person plural. Some formatting adjustments in the test.
Comment Actions I am OK with this. I'd like to refactor how the warnings are reported. We can do it separatelly indeed. Comment Actions Sorry, I had some draft comments yesterday but had to leave early, here are post-commit comments now:
Comment Actions (Also just want to say the print*RelocatableStackSizes methods look much better now, thanks for cleaning that up!) |