Index: test/tools/llvm-objdump/full-contents.test =================================================================== --- test/tools/llvm-objdump/full-contents.test +++ test/tools/llvm-objdump/full-contents.test @@ -0,0 +1,17 @@ +// This test checks that --full-contents (-s) works correctly +// RUN: llvm-objdump --full-contents %p/Inputs/section-filter.obj +// RUN: llvm-objdump -s %p/Inputs/section-filter.obj + +CHECK: Inputs/section-filter.obj: file format ELF32-hexagon +CHECK: +CHECK: Contents of section .shstrtab: +CHECK: 0000 002e7465 7874002e 62737300 2e736873 ..text..bss..shs +CHECK: 0010 74727461 62002e73 74727461 62002e73 trtab..strtab..s +CHECK: 0020 796d7461 62002e64 61746100 ymtab..data. +CHECK: Contents of section .symtab: +CHECK: 0000 00000000 00000000 00000000 00000000 ................ +CHECK: 0010 00000000 00000000 00000000 03000100 ................ +CHECK: 0020 00000000 00000000 00000000 03000200 ................ +CHECK: 0030 00000000 00000000 00000000 03000300 ................ +CHECK: Contents of section .strtab: +CHECK: 0000 00 . Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -116,7 +116,11 @@ cl::aliasopt(DynamicRelocations)); cl::opt -llvm::SectionContents("s", cl::desc("Display the content of each section")); +llvm::SectionContents("full-contents", + cl::desc("Display the content of each section")); +static cl::alias +SectionContentsShort("s", cl::desc("Alias for --full-contents"), + cl::aliasopt(SectionContents)); cl::opt llvm::SymbolTable("t", cl::desc("Display the symbol table"));