|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| | Object/MachOFormat.h over to Support/MachO.h."
This reverts commits r189319 and r189315. r189315 broke some tests on what I
believe are big-endian platforms.
llvm-svn: 189321 | 
| | 
| 
| 
| | llvm-svn: 189315 | 
| | 
| 
| 
| | llvm-svn: 188066 | 
| | 
| 
| 
| 
| 
| 
| 
| | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.
llvm-svn: 188022 | 
| | 
| 
| 
| 
| 
| | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html
llvm-svn: 187145 | 
| | 
| 
| 
| 
| 
| 
| 
| | The original change was rolled back in r186627 because of test
failures on the big endian machine. I believe I fixed the issue
so re-submitting.
llvm-svn: 186734 | 
| | 
| 
| 
| 
| 
| | Because it broke s390x and ppc64-linux buildbots. This reverts commit r186623.
llvm-svn: 186627 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Summary:
Dump optional data directory entries in the PE/COFF header, so that
we can test the output of LLD linker. This patch updates the test binary
file, but the source of the binary is the same. I just re-linked the file.
I don't know how the previous file was linked, but the previous file did
not have any data directory entries for some reason.
Reviewers: rafael
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1148
llvm-svn: 186623 | 
| | 
| 
| 
| 
| 
| | I wish we could typecheck llvm::format.
llvm-svn: 185766 | 
| | 
| 
| 
| | llvm-svn: 184081 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | These records are mandatory for executables and are used by the loader.
Reviewers: rafael
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D939
llvm-svn: 183852 | 
| | 
| 
| 
| 
| 
| 
| 
| | In ELF (as in MachO), not all relocations point to symbols. Represent this
properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj
ELF's dumper to handle relocatios without symbols.
llvm-svn: 183284 | 
| | 
| 
| 
| | llvm-svn: 181509 | 
| | 
| 
| 
| 
| 
| 
| | It was only implemented for ELF where it collected the Addend, so this
patch also renames it to getRelocationAddend.
llvm-svn: 181502 | 
| | 
| 
| 
| | llvm-svn: 181079 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Build attribute sections can now be read if they exist via ELFObjectFile, and
the llvm-readobj tool has been extended with an option to dump this information
if requested. Regression tests are also included which exercise these features.
Also update the docs with a fixed ARM ABI link and a new link to the Addenda
which provides the build attributes specification.
llvm-svn: 181009 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | getRelocationAddress is for dynamic libraries and executables,
getRelocationOffset for relocatable objects.
Mark the getRelocationAddress of COFF and MachO as not implemented yet. Add a
test of ELF's. llvm-readobj -r now prints the same values as readelf -r.
llvm-svn: 180259 | 
| | 
| 
| 
| 
| 
| 
| 
| | While here, don't report a dummy symbol for relocations that don't have symbols.
We used to says such relocations were for the first defined symbol, but now we
return end_symbols(). The llvm-readobj output change agrees with otool.
llvm-svn: 180214 | 
| | 
| 
| 
| | llvm-svn: 180007 | 
| | 
| 
| 
| | llvm-svn: 180006 | 
| | 
| 
| 
| | llvm-svn: 180005 | 
| | 
| 
| 
| 
| 
| 
| | We are still able to handle mixed endian objects by swapping one struct at a
time.
llvm-svn: 179778 | 
| | 
| 
| 
| | llvm-svn: 179534 | 
| | 
| 
| 
| 
| 
| 
| | We are now able to handle big endian macho files in llvm-readobject. Thanks to
David Fang for providing the object files.
llvm-svn: 179440 | 
| | 
| 
| 
| | llvm-svn: 179363 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This option expands shown relocations from single line to a dictionary
format:
  Relocation {
    Offset: 0x4
    Type: R_386_32 (1)
    Symbol: sym
    Info: 0x0
  }
llvm-svn: 179359 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Original message:
Print more information about relocations.
With this patch llvm-readobj now prints if a relocation is pcrel, its length,
if it is extern and if it is scattered.
It also refactors the code a bit to use bit fields instead of shifts and
masks all over the place.
llvm-svn: 179345 | 
| | 
| 
| 
| | llvm-svn: 179303 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | With this patch llvm-readobj now prints if a relocation is pcrel, its length,
if it is extern and if it is scattered.
It also refactors the code a bit to use bit fields instead of shifts and
masks all over the place.
llvm-svn: 179294 | 
| | 
| 
| 
| | llvm-svn: 179179 | 
| | 
| 
| 
| 
| 
| 
| | For now it is templated only on being 64 or 32 bits. I will add little/big
endian next.
llvm-svn: 179097 | 
| | 
| 
| 
| | llvm-svn: 179051 | 
| | 
| 
| 
| | llvm-svn: 178985 | 
| | 
| 
| 
| | llvm-svn: 178984 | 
| | 
| 
| 
| | llvm-svn: 178981 | 
| | 
| 
| 
| | llvm-svn: 178980 | 
| | 
| 
| 
| 
| 
| 
| 
| | InMemoryStruct is extremely dangerous as it returns data from an internal
buffer when the endiannes doesn't match. This should fix the tests on big
endian hosts.
llvm-svn: 178875 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | symbol table / dynamic symbol table
llvm-svn: 177873 | 
| | 
| 
| 
| | llvm-svn: 175592 | 
| | 
| 
| 
| | llvm-svn: 174687 | 
| | 
| 
| 
| | llvm-svn: 174439 | 
| | 
| 
| 
| | llvm-svn: 171305 | 
| | 
| 
| 
| | llvm-svn: 171304 | 
| | 
| 
| 
| | llvm-svn: 171302 | 
| | 
| 
| 
| | llvm-svn: 171301 | 
| | 
| 
| 
| | llvm-svn: 171300 | 
| | 
| 
| 
| | llvm-svn: 171299 | 
| | 
| 
| 
| 
| 
| 
| 
| | Again, tools are trickier to pick the main module header for than
library source files. I've started to follow the pattern of using
LLVMContext.h when it is included as a stub for program source files.
llvm-svn: 169252 | 
| | 
| 
| 
| | llvm-svn: 152474 |