llvm-project/llvm/tools
Eric Christopher 9cad53cfec Implements low-level object file format specific output for COFF and
ELF with support for:

- File headers
- Section headers + data
- Relocations
- Symbols
- Unwind data (only COFF/Win64)

The output format follows a few rules:
- Values are almost always output one per line (as elf-dump/coff-dump already do). - Many values are translated to something readable (like enum names), with the raw value in parentheses.
- Hex numbers are output in uppercase, prefixed with "0x".
- Flags are sorted alphabetically.
- Lists and groups are always delimited.

Example output:
---------- snip ----------
Sections [
  Section {
    Index: 1
    Name: .text (5)
    Type: SHT_PROGBITS (0x1)
    Flags [ (0x6)
      SHF_ALLOC (0x2)
      SHF_EXECINSTR (0x4)
    ]
    Address: 0x0
    Offset: 0x40
    Size: 33
    Link: 0
    Info: 0
    AddressAlignment: 16
    EntrySize: 0
    Relocations [
      0x6 R_386_32 .rodata.str1.1 0x0
      0xB R_386_PC32 puts 0x0
      0x12 R_386_32 .rodata.str1.1 0x0
      0x17 R_386_PC32 puts 0x0
    ]
    SectionData (
      0000: 83EC04C7 04240000 0000E8FC FFFFFFC7  |.....$..........|
      0010: 04240600 0000E8FC FFFFFF31 C083C404  |.$.........1....|
      0020: C3                                   |.|
    )
  }
]
---------- snip ----------

Relocations and symbols can be output standalone or together with the section header as displayed in the example.
This feature set supports all tests in test/MC/COFF and test/MC/ELF (and I suspect all additional tests using elf-dump), making elf-dump and coff-dump deprecated.

Patch by Nico Rieck!

llvm-svn: 178679
2013-04-03 18:31:38 +00:00
..
bugpoint Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
bugpoint-passes [CMake] bugpoint-passes should not be built in "all", when LLVM_BUILD_TOOLS is OFF. 2013-01-22 01:44:00 +00:00
gold Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llc Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
lli Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-ar Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-as Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-bcanalyzer Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. 2013-02-12 21:21:59 +00:00
llvm-config Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
llvm-cov Remove accidental commit. 2012-11-07 18:39:32 +00:00
llvm-diff Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-dis Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-dwarfdump Add support for the pubnames section to llvm-dwarfdump. 2013-02-12 16:20:28 +00:00
llvm-extract Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-jitlistener Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-link Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-mc Try to get rid of a -wunitialized warning: explicitly initialize the pointer 2013-02-26 23:04:17 +00:00
llvm-mcmarkup MC: Simple example parser for MC assembly markup. 2012-10-31 23:24:13 +00:00
llvm-nm [Object][Archive] Improve performance. 2013-02-03 10:48:50 +00:00
llvm-objdump Don't disassemble symbols with an unknown address or size. 2013-04-03 18:31:23 +00:00
llvm-prof Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-ranlib Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-readobj Implements low-level object file format specific output for COFF and 2013-04-03 18:31:38 +00:00
llvm-rtdyld Add DIContext::getLineInfoForAddressRange() function and test. This function allows a caller to obtain a table of line information for a function using the function's address and size. 2013-01-26 00:28:05 +00:00
llvm-shlib Add support for the OpenBSD for Bitrig. 2012-08-06 20:52:18 +00:00
llvm-size Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llvm-stress Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-symbolizer Fix for r177390: map values are pointers, use DeleteContainerSeconds() instead of .clear() 2013-03-19 15:33:18 +00:00
lto Run the ObjCARCContract pass for LTO. <rdar://problem/13538084> 2013-03-29 23:28:55 +00:00
macho-dump [MC/Mach-O] Add support for linker options in Mach-O files. 2013-01-18 01:26:07 +00:00
opt Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
CMakeLists.txt Build LLVMgold.so on FreeBSD using cmake. 2013-03-17 12:01:05 +00:00
LLVMBuild.txt Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
Makefile Make building of llvm-jitlistener conditional on the USE_INTEL_JITEVENTS setting. 2012-11-27 01:24:25 +00:00