llvm-objdump does not accept combined args as GNU objdump does
| Bugzilla Link | 31679 |
| Resolution | FIXED |
| Resolved on | Mar 21, 2019 20:29 |
| Version | trunk |
| OS | FreeBSD |
| CC | @jh7370,@ormris,@rupprecht |
| Fixed by commit(s) | r354375 r356697 |
Extended Description
I am investigating using LLVM objdump in place of GNU objdump. One issue I encountered is that the latter allows multiple single-letter options to be specified together (e.g. objdump -rS) while LLVM objdump does not.
% .../llvm-objdump -rS ./twalk.pico llvm-objdump: Unknown command line argument '-rS'. Try: '.../llvm-objdump -help' llvm-objdump: Did you mean '-S'?
Should be fixed now after commits r354375 and r356697.
I've posted a potential fix for this: https://reviews.llvm.org/D57904
It looks like using the "cl::Grouping" attribute on all single-letter aliases might be enough to get this to work. I haven't tried though, but I did find an example of it in llvm-nm's code.
This issue isn't specific to llvm-objdump. Indeed, I expect it's a problem across most (all?) of the LLVM binary utilities. I filed bug 40064 for the same issue in llvm-readelf, and I expect the solution used for this bug is likely the same as for that one.
Assigning to myself as I'm planning to rework argument handling for llvm-objdump entirely (as proposed on llvm-dev).
Great, thank you!
When you have changes ready for testing (either in review or committed) I can merge them into a test version of FreeBSD and request an experimental build (exp-run) of our ~35000 third party ports.
We've also seen issues w/ switching to llvm-objdump (in various build scripts) for these two uses:
objdump -thr (i.e. --syms --headers --reloc) objdump -sj.foo (i.e. --full-contents --section=.foo)
Assigning to myself as I'm planning to rework argument handling for llvm-objdump entirely (as proposed on llvm-dev).