[llvm-bugs] [Bug 50085] New: Erroneous warning: section 'X' mentioned in a -j/--section option, but not found in any input file

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 22 19:51:54 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50085

            Bug ID: 50085
           Summary: Erroneous warning: section 'X' mentioned in a
                    -j/--section option, but not found in any input file
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-objdump
          Assignee: unassignedbugs at nondot.org
          Reporter: rupprecht at google.com
                CC: llvm-bugs at lists.llvm.org

Found in https://github.com/ClangBuiltLinux/linux/issues/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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210423/03136575/attachment.html>


More information about the llvm-bugs mailing list