llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

llvm-objdump does not accept combined args as GNU objdump does

Open emaste opened this issue 9 years ago • 7 comments

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'?

emaste avatar Jan 18 '17 21:01 emaste

Should be fixed now after commits r354375 and r356697.

rupprecht avatar Mar 22 '19 03:03 rupprecht

I've posted a potential fix for this: https://reviews.llvm.org/D57904

ormris avatar Feb 07 '19 17:02 ormris

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.

jh7370 avatar Jan 03 '19 17:01 jh7370

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.

jh7370 avatar Dec 18 '18 09:12 jh7370

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.

emaste avatar Oct 31 '18 17:10 emaste

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)

rupprecht avatar Oct 31 '18 17:10 rupprecht

Assigning to myself as I'm planning to rework argument handling for llvm-objdump entirely (as proposed on llvm-dev).

llvmbot avatar Oct 31 '18 10:10 llvmbot