Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous warning: section 'X' mentioned in a -j/--section option, but not found in any input file #49429

Open
rupprecht opened this issue Apr 23, 2021 · 0 comments
Labels
bugzilla Issues migrated from bugzilla tools:llvm-objdump

Comments

@rupprecht
Copy link
Collaborator

Bugzilla Link 50085
Version trunk
OS Linux

Extended Description

Found in ClangBuiltLinux/linux#859.

$ bin/clang -xc -c /dev/null -o /tmp/null.o
$ bin/llvm-objdump -j .text -h /tmp/null.o # -j and -h work fine

/tmp/null.o: file format elf64-x86-64

Sections:
Idx Name Size VMA Type
2 .text 00000000 0000000000000000 TEXT
$ bin/llvm-objdump -j .text -t /tmp/null.o # -j and -t don't work fine

/tmp/null.o: file format elf64-x86-64

SYMBOL TABLE:
0000000000000000 l df ABS 0000000000000000 null
bin/llvm-objdump: warning: section '.text' mentioned in a -j/--section option, but not found in any input file

The warning for -j should only fire for options (like -h) that iterate over sections. For -t (printing the symbol table), we shouldn't print the warning, even though we never "saw" the section we're looking for (... because we didn't iterate over any sections).

The error is misleading -- either we should omit it, or we should notify the user more directly that -j is not applicable for flags like -t.

GNU objdump prints the same warning for the repro above, but I think they would consider it a bug too.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla tools:llvm-objdump
Projects
None yet
Development

No branches or pull requests

1 participant