llvm-6502/include/llvm/Support
Eric Christopher 76e70f340c 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178679 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03 18:31:38 +00:00
..
AIXDataTypesFix.h
AlignOf.h Incrase the number of parameters for AlignedCharArrayUnion. 2013-01-09 10:39:16 +00:00
Allocator.h
ArrayRecycler.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Atomic.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
BlockFrequency.h
BranchProbability.h
CallSite.h Remove unneeded #includes. 2013-03-18 23:33:44 +00:00
Capacity.h
Casting.h Cleanup the simplify_type implementation. 2013-03-27 16:43:11 +00:00
CFG.h Seciton 24.2.2 of the C++ standard, [iterator.iterators], Table 106 2013-03-28 15:47:50 +00:00
circular_raw_ostream.h
CodeGen.h
COFF.h Implements low-level object file format specific output for COFF and 2013-04-03 18:31:38 +00:00
CommandLine.h Generalize my previous fix for -print-options. 2013-03-06 19:04:56 +00:00
Compiler.h Introduce LLVM_STATIC_ASSERT macro, which expands to C/C++'s static_assert on compilers which support it. 2013-03-22 03:10:51 +00:00
ConstantFolder.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
ConstantRange.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
ConvertUTF.h llvm-gcc -pedantic warns about C++ comments in C90 mode even if they're 2013-02-13 22:45:52 +00:00
CrashRecoveryContext.h
DataExtractor.h Be consistent about the field name - AddressSize, not PointerSize. Add 2013-02-05 23:26:02 +00:00
DataFlow.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
DataStream.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
DataTypes.h.cmake
DataTypes.h.in
Debug.h
DebugLoc.h Remove trailing spaces. 2013-03-18 23:04:30 +00:00
Disassembler.h
DOTGraphTraits.h ScheduleDAG: colorize the DOT graph and improve formatting. 2013-01-25 07:45:25 +00:00
Dwarf.h Initial support for DWARF CFI parsing and dumping in LLVM 2013-02-05 23:30:58 +00:00
DynamicLibrary.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
ELF.h PowerPC: Simplify handling of fixups. 2013-03-26 10:56:47 +00:00
Endian.h [Support][Endian] Add support for specifying the alignment and native unaligned types. 2013-01-02 20:14:11 +00:00
Errno.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
ErrorHandling.h Add a boolean parameter to the llvm::report_fatal_error() function to indicated 2013-03-27 18:27:54 +00:00
ErrorOr.h [Support][ErrorOr] Add support for implicit conversion from error code/condition enums. 2013-02-28 01:44:26 +00:00
FEnv.h Refine fenv.h handling: check if the desired macros exist, before using 2013-03-25 13:13:33 +00:00
FileOutputBuffer.h
FileSystem.h [Support] Fix lifetime of file descriptors when using MemoryBuffer. 2013-03-14 00:20:10 +00:00
FileUtilities.h
Format.h
FormattedStream.h unindent the file to follow coding standards, change class doc comment 2013-04-01 23:00:01 +00:00
GCOV.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
GetElementPtrTypeIterator.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
GraphWriter.h ScheduleDAG: colorize the DOT graph and improve formatting. 2013-01-25 07:45:25 +00:00
Host.h Introduce llvm::sys::getProcessTriple() function. 2013-01-16 17:27:22 +00:00
IncludeFile.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
InstIterator.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
IntegersSubset.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
IntegersSubsetMapping.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
LeakDetector.h
LEB128.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
LICENSE.TXT
Locale.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
LockFileManager.h Fix a race condition in the lock-file manager: once the lock file is 2013-01-10 02:01:35 +00:00
MachO.h
ManagedStatic.h
MathExtras.h Suppressing MSVC warnings; patch thanks to Peng Cheng! 2013-02-27 18:25:41 +00:00
Memory.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
MemoryBuffer.h
MemoryObject.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Mutex.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
MutexGuard.h
NoFolder.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
OutputBuffer.h
PassNameParser.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Path.h
PathV1.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
PathV2.h
PatternMatch.h When code size is the priority (Oz, MinSize attribute), help llvm 2013-01-07 18:37:41 +00:00
PluginLoader.h
PointerLikeTypeTraits.h
PredIteratorCache.h
PrettyStackTrace.h
Process.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Program.h Add a boolean parameter to the ExecuteAndWait static function to indicated 2013-03-26 23:35:00 +00:00
raw_os_ostream.h
raw_ostream.h Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments. 2013-02-18 23:11:17 +00:00
Recycler.h Special case Recycler::clear(BumpPtrAllocator). 2013-01-04 22:35:45 +00:00
RecyclingAllocator.h
Regex.h
Registry.h
RegistryParser.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
RWMutex.h
SaveAndRestore.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Signals.h Signal.h: Add <cstdio> for FILE*, since r171989. 2013-01-10 05:23:59 +00:00
SMLoc.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Solaris.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
SourceMgr.h Add basic fix-its to SMDiagnostic. 2013-01-10 18:50:15 +00:00
StreamableMemoryObject.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
StringPool.h
SwapByteOrder.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
system_error.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
SystemUtils.h
TargetFolder.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
TargetRegistry.h
TargetSelect.h
Threading.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
ThreadLocal.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Timer.h Slight cosmetic fixes 2013-02-26 18:05:31 +00:00
TimeValue.h Fix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() is explicitly called during module initialization of lib/Support/Process.cpp. It reads the field of global object PosixZeroTime, which is not guaranteed to be initialized at this point. Found by AddressSanitizer with -fsanitize=init-order option. 2013-02-19 11:35:39 +00:00
ToolOutputFile.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
type_traits.h Cleanup the simplify_type implementation. 2013-03-27 16:43:11 +00:00
Valgrind.h
ValueHandle.h Cleanup the simplify_type implementation. 2013-03-27 16:43:11 +00:00
Watchdog.h Add a new watchdog timer interface. The interface does not permit handling timeouts, so 2013-03-26 01:27:52 +00:00
Win64EH.h Implements low-level object file format specific output for COFF and 2013-04-03 18:31:38 +00:00
YAMLParser.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
YAMLTraits.h Remove redundant 'llvm::' qualifications 2013-01-13 16:01:15 +00:00