[PATCH] D75713: [llvm-objdump] -d: print `00000000 <foo>:` instead of `00000000 foo:`

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 15:54:53 PST 2020


MaskRay created this revision.
MaskRay added reviewers: adalava, Bdragon28, rupprecht.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The new behavior matches GNU objdump. A pair of angle brackets makes tests slightly easier.

`.foo:` is not unique and thus cannot be in a `CHECK-LABEL:` directive.
Without `-LABEL`, the CHECK line can match the `Disassembly of section`
line and causes the next `CHECK-NEXT:` to fail.

  Disassembly of section .foo:
  
  0000000000001634 .foo:

Bdragon: <> has metalinguistic connotation


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75713

Files:
  llvm/tools/llvm-objdump/llvm-objdump.cpp


Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1372,7 +1372,7 @@
         outs() << format(Is64Bits ? "%016" PRIx64 " " : "%08" PRIx64 " ",
                          SectionAddr + Start + VMAAdjustment);
 
-      outs() << SymbolName << ":\n";
+      outs() << '<' << SymbolName << ">:\n";
 
       // Don't print raw contents of a virtual section. A virtual section
       // doesn't have any contents in the file.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75713.248622.patch
Type: text/x-patch
Size: 579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200305/6dedec9d/attachment.bin>


More information about the llvm-commits mailing list