[lld] r301515 - Recommend users use readelf instead of objdump to dump .comment contents.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 21:50:08 PDT 2017


Author: ruiu
Date: Wed Apr 26 23:50:08 2017
New Revision: 301515

URL: http://llvm.org/viewvc/llvm-project?rev=301515&view=rev
Log:
Recommend users use readelf instead of objdump to dump .comment contents.

readelf's output is much easier to read than objdump's as you can see below.

  $ readelf --string-dump .comment foo
  String dump of section '.comment':
    [     1]  GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
    [    2c]  clang version 5.0.0
    [    41]  Linker: LLD 5.0.0

  $ objdump -j .comment -s foo
  Contents of section .comment:
   0000 00474343 3a202855 62756e74 7520342e  .GCC: (Ubuntu 4.
   0010 382e342d 32756275 6e747531 7e31342e  8.4-2ubuntu1~14.
   0020 30342e33 2920342e 382e3400 636c616e  04.3) 4.8.4.clan
   0030 67207665 7273696f 6e20352e 302e3020  g version 5.0.0
   0040 004c696e 6b65723a 204c4c44 20352e30  .Linker: LLD 5.0
   0050 2e3000                               .0.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp
    lld/trunk/docs/index.rst

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=301515&r1=301514&r2=301515&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Apr 26 23:50:08 2017
@@ -97,7 +97,7 @@ static ArrayRef<uint8_t> getVersion() {
 
 // Creates a .comment section containing LLD version info.
 // With this feature, you can identify LLD-generated binaries easily
-// by "objdump -s -j .comment <file>".
+// by "readelf --string-dump .comment <file>".
 // The returned object is a mergeable string section.
 template <class ELFT> MergeInputSection *elf::createCommentSection() {
   typename ELFT::Shdr Hdr = {};

Modified: lld/trunk/docs/index.rst
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/docs/index.rst?rev=301515&r1=301514&r2=301515&view=diff
==============================================================================
--- lld/trunk/docs/index.rst (original)
+++ lld/trunk/docs/index.rst Wed Apr 26 23:50:08 2017
@@ -135,7 +135,7 @@ LDFLAGS when building your programs.
 
 LLD leaves its name and version number to a ``.comment`` section in an
 output. If you are in doubt whether you are successfully using LLD or
-not, run ``objdump -s -j .comment <output-file>`` and examine the
+not, run ``readelf --string-dump .comment <output-file>`` and examine the
 output. If the string "Linker: LLD" is included in the output, you are
 using LLD.
 




More information about the llvm-commits mailing list