summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-readobj: teach it how to dump COFF base relocation tableRui Ueyama2014-11-193-1/+40
| | | | llvm-svn: 222289
* llvm-readobj: Don't print the Characteristics field as the SubsystemDavid Majnemer2014-11-181-1/+1
| | | | | | | We claimed that we were printing the Subystem field when we were actually printing the Characteristics field. llvm-svn: 222216
* Object, COFF: Tighten the object file parserDavid Majnemer2014-11-172-16/+23
| | | | | | | | | | | | We were a little lax in a few areas: - We pretended that import libraries were like any old COFF file, they are not. In fact, they aren't really COFF files at all, we should probably grow some specialized functionality to handle them smarter. - Our symbol iterators were more than happy to attempt to go past the end of the symbol table if you had a symbol with a bad list of auxiliary symbols. llvm-svn: 222124
* Implement MachODumper::printFileHeadersFrederic Riss2014-11-171-1/+175
| | | | | | | | Patch by Chilledheart. Differential Revision: http://reviews.llvm.org/D6163 llvm-svn: 222115
* yaml2obj, COFF: Consider the DOS stub when laying out section headersDavid Majnemer2014-11-151-2/+12
| | | | | | | | While this program worked correctly with small example programs, larger ones tickled this bug. I'm working on a reduction because my program is quite large. llvm-svn: 222078
* Add the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O ↵Kevin Enderby2014-11-141-23/+185
| | | | | | | | | symbolizer. FYI, removed the unused MCInstrAnalysis as it does not exist for 64-bit ARM and was causing a “couldn't initialize disassembler for target” error. llvm-svn: 222045
* yaml2obj, COFF: Correctly calculate SizeOfImage and SizeOfHeadersDavid Majnemer2014-11-141-9/+16
| | | | | | | | SizeOfHeaders must be aligned to the FileAlignment. SizeOfImage must be at least the SizeOfHeaders aligned to the SectionAlignment. llvm-svn: 222030
* Reapply "[dwarfdump] Add support for dumping accelerator tables."Frederic Riss2014-11-141-0/+4
| | | | | | | | | | | | | This reverts commit r221842 which was a revert of r221836 and of the test parts of r221837. This new version fixes an UB bug pointed out by David (along with addressing some other review comments), makes some dumping more resilient to broken input data and forces the accelerator tables to be dumped in the tests where we use them (this decision is platform specific otherwise). llvm-svn: 222003
* obj2yaml, yaml2obj: Add support for COFF executablesDavid Majnemer2014-11-142-44/+237
| | | | | | | | | | | | | | | | In support of serializing executables, obj2yaml now records the virtual address and size of sections. It also serializes whatever we strictly need from the PE header, it expects that it can reconstitute everything else via inference. yaml2obj can reconstitute a fully linked executable. In order to get executables correctly serialized/deserialized, other bugs were fixed as a circumstance. We now properly respect file and section alignments. We also avoid writing out string tables unless they are strictly necessary. llvm-svn: 221975
* llvm-cov: Sink some reporting logic into CoverageMappingJustin Bogner2014-11-143-39/+11
| | | | | | | | This teaches CoverageMapping::getCoveredFunctions to filter to a particular file and uses that to replace most of the logic found in llvm-cov report. llvm-svn: 221962
* Object, Mach-O: Refactor and clean code upDavid Majnemer2014-11-131-6/+7
| | | | | | | Don't assert if we can return an error code, reuse existing functionality like is64Bit(). llvm-svn: 221915
* llvm-readobj: relocAddressLess could potentially lieDavid Majnemer2014-11-131-2/+2
| | | | | | | | On error conditions, relocAddressLess might claim that a value is less than itself. Instead, abort llvm-readobj. No functionality change intended. llvm-svn: 221872
* llvm-readobj, COFF: Remove an unused variableDavid Majnemer2014-11-131-3/+0
| | | | | | | printRelocation doesn't use the section contents. No functionality change intended. llvm-svn: 221871
* Object, COFF: getRelocationSymbol shouldn't assertDavid Majnemer2014-11-131-3/+3
| | | | | | | | lib/Object is supposed to be robust to malformed object files. Don't assert if we don't have a symbol table. I'll try to come up with a test case later. llvm-svn: 221870
* llvm-readobj: Print out address table when dumping COFF delay-import tableRui Ueyama2014-11-131-1/+21
| | | | llvm-svn: 221855
* Revert "[dwarfdump] Add support for dumping accelerator tables."Frederic Riss2014-11-131-4/+0
| | | | | | | | | | This reverts commit r221836. The tests are asserting on some buildbots. This also reverts the test part of r221837 as it relies on dwarfdump dumping the accelerator tables. llvm-svn: 221842
* [dwarfdump] Add support for dumping accelerator tables.Frederic Riss2014-11-121-0/+4
| | | | | | | The class used for the dump only allows to dump for the moment, but it can (and will) be easily extended to support search also. llvm-svn: 221836
* [COFF] Make it clearer that the symbols subsection holds function display ↵Timur Iskhodzhanov2014-11-121-2/+2
| | | | | | name rather than just name llvm-svn: 221812
* Fixing more -Wcast-qual warnings; NFC.Aaron Ballman2014-11-122-6/+14
| | | | llvm-svn: 221782
* Remove the now unused StringRefMemoryObject.h.Rafael Espindola2014-11-122-2/+0
| | | | llvm-svn: 221755
* Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2014-11-123-23/+20
| | | | | | | | | | | | With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
* libLTO: Allow linker to choose context of modules and codegenDuncan P. N. Exon Smith2014-11-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add API for specifying which `LLVMContext` each `lto_module_t` and `lto_code_gen_t` is in. In particular, this enables the following flow: for (auto &File : Files) { lto_module_t M = lto_module_create_in_local_context(File...); querySymbols(M); lto_module_dispose(M); } lto_code_gen_t CG = lto_codegen_create_in_local_context(); for (auto &File : FilesToLink) { lto_module_t M = lto_module_create_in_codegen_context(File..., CG); lto_codegen_add_module(CG, M); lto_module_dispose(M); } lto_codegen_compile(CG); lto_codegen_write_merged_modules(CG, ...); lto_codegen_dispose(CG); This flow has a few benefits. - Only one module (two if you count the combined module in the code generator) is in memory at a time. - Metadata (and constants) from files that are parsed to query symbols but not linked into the code generator don't pollute the global context. - The first for loop can be parallelized, since each module is in its own context. - When the code generator is disposed, the memory from LTO gets freed. rdar://problem/18767512 llvm-svn: 221733
* Revert "IR: MDNode => Value"Duncan P. N. Exon Smith2014-11-111-1/+1
| | | | | | | | | | | | | | | | | Instead, we're going to separate metadata from the Value hierarchy. See PR21532. This reverts commit r221375. This reverts commit r221373. This reverts commit r221359. This reverts commit r221167. This reverts commit r221027. This reverts commit r221024. This reverts commit r221023. This reverts commit r220995. This reverts commit r220994. llvm-svn: 221711
* [llvm-mc] Fixing case where if a file ended with non-newline whitespace or a ↵Colin LeMahieu2014-11-111-15/+9
| | | | | | | | comma it would access invalid memory. Cleaned up parse loop. llvm-svn: 221707
* Fix a warning about ‘r_type’ may be used uninitialized.Kevin Enderby2014-11-111-1/+1
| | | | | | Thanks to Aaron Ballman for noticing this! llvm-svn: 221696
* llvm-objdump: Skip empty sections when dumping contentsDavid Majnemer2014-11-111-3/+6
| | | | | | | Empty sections are just noise when using objdump. This is similar to what binutils does. llvm-svn: 221680
* [CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and ↵NAKAMURA Takumi2014-11-111-3/+0
| | | | | | SelectionDAG. llvm-svn: 221675
* [CMake] llvm-c-test: Use libLLVM.so if it is available.NAKAMURA Takumi2014-11-101-0/+9
| | | | llvm-svn: 221592
* [CMake] Let llvm-shlib work on Linux with --whole-archive.NAKAMURA Takumi2014-11-101-4/+10
| | | | | | | | | | | | | | | | | | | | | | FIXME: It should work on not only Linux but elf-targeting gnu ld. For example if LLVM_DYLIB_COMPONENTS is "BitWriter Support", CMake emits the command line like; -Wl,--whole-archive lib/libLLVMBitWriter.a lib/libLLVMSupport.a *1 -Wl,--no-whole-archive lib/libLLVMCore.a lib/libLLVMSupport.a *2 -lrt -ldl -ltinfo -lpthread -lm It works since symbols in LLVMCore is resolved with not *2 but *1. Unfortunately, --gc-sections is not powerful in this case to prune unused "visibility(default)" entries. I am still experimenting other way not to rely on --whole-archive. llvm-svn: 221591
* [CMake] Move llvm-shlib in prior to other tools.NAKAMURA Takumi2014-11-101-6/+6
| | | | llvm-svn: 221590
* [CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for ↵NAKAMURA Takumi2014-11-081-0/+2
| | | | | | | | | | | | llvm-c. FYI, 3 modules below are redundant in trunk; AsmPrinter MC SelectionDAG llvm-svn: 221579
* Remove unused variable.Rafael Espindola2014-11-071-2/+2
| | | | llvm-svn: 221549
* Transform: add SymbolRewriter passSaleem Abdulrasool2014-11-071-0/+1
| | | | | | | | | | | | | | | | This introduces the symbol rewriter. This is an IR->IR transformation that is implemented as a CodeGenPrepare pass. This allows for the transparent adjustment of the symbols during compilation. It provides a clean, simple, elegant solution for symbol inter-positioning. This technique is often used, such as in the various sanitizers and performance analysis. The control of this is via a custom YAML syntax map file that indicates source to destination mapping, so as to avoid having the compiler to know the exact details of the source to destination transformations. llvm-svn: 221548
* Fix style.Michael J. Spencer2014-11-071-8/+6
| | | | llvm-svn: 221547
* Use StringRefMemoryObject in llvm-mc. NFC.Rafael Espindola2014-11-071-29/+15
| | | | llvm-svn: 221536
* llvm-symbolizer: teach it about PowerPC64 ELF function descriptorsJay Foad2014-11-072-4/+40
| | | | | | | | | | | | | | | | | Summary: Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function. This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux. Reviewers: kcc, willschm, samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6110 llvm-svn: 221514
* Use StringRefMemoryObject. NFC.Rafael Espindola2014-11-071-34/+5
| | | | llvm-svn: 221502
* [ELF][yaml2obj] Handle additional MIPS specific st_other field flagsSimon Atanasyan2014-11-062-2/+2
| | | | | | | | The ELF symbol `st_other` field might contain additional flags besides visibility ones. This patch implements support for some MIPS specific flags. llvm-svn: 221491
* Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler andKevin Enderby2014-11-061-24/+235
| | | | | | | | | | | | add the code and test cases for 32-bit ARM symbolizer. Also fixed the printing of data in code as it was not using the table correctly and needed to fix one of the test cases too. This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak for that is made. Which I’ll be committing immediately after this commit. llvm-svn: 221470
* Add accessor to get 'visibility' part of st_other fieldSimon Atanasyan2014-11-051-1/+1
| | | | | | This new `getVisibility()` function will also be used in the LLD code. llvm-svn: 221392
* IR: MDNode => Value: NamedMDNode::getOperator()Duncan P. N. Exon Smith2014-11-051-1/+1
| | | | | | | | | | | | | Change `NamedMDNode::getOperator()` from returning `MDNode *` to returning `Value *`. To reduce boilerplate at some call sites, add a `getOperatorAsMDNode()` for named metadata that's expected to only return `MDNode` -- for now, that's everything, but debug node named metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change. This is part of PR21433. Note that there's a follow-up patch to clang for the API change. llvm-svn: 221375
* llvm-readobj: Add support for dumping the DOS header in PE filesDavid Majnemer2014-11-051-0/+25
| | | | llvm-svn: 221333
* llvm-objdump: Pass DiceTableEntry by referenceDavid Majnemer2014-11-041-2/+2
| | | | | | | | | DiceTableEntry is 24 bytes on my machine, it's probably better to pass them by reference. This fixes PR21464. llvm-svn: 221247
* Use findProgramByName.Michael J. Spencer2014-11-042-17/+41
| | | | llvm-svn: 221221
* Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O ↵Kevin Enderby2014-11-041-14/+94
| | | | | | symbolizer. llvm-svn: 221211
* MSVC requires redeclarations to repeat noexceptReid Kleckner2014-11-031-1/+1
| | | | llvm-svn: 221177
* llvm-vtabledump: Handle Itanium VTablesDavid Majnemer2014-11-031-47/+166
| | | | | | Add support in the vtable dumper for the Itanium ABI. llvm-svn: 221133
* Use ErrorOr for the ::create factory on instrumented and sample profilers.Diego Novillo2014-11-031-13/+16
| | | | | | | | | | | | | | | | | Summary: As discussed in http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141027/242445.html, the creation of reader and writer instances is better done using ErrorOr. There are no functional changes, but several callers needed to be adjusted. Reviewers: bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6076 llvm-svn: 221120
* Fix the build of the gold plugin.Rafael Espindola2014-11-011-1/+0
| | | | | | I did the previous patch on OS X and didn't noticed the issue. llvm-svn: 221070
* Remove redundant calls to isMaterializable.Rafael Espindola2014-11-012-12/+7
| | | | | | | | | | This removes calls to isMaterializable in the following cases: * It was redundant with a call to isDeclaration now that isDeclaration returns the correct answer for materializable functions. * It was followed by a call to Materialize. Just call Materialize and check EC. llvm-svn: 221050
OpenPOWER on IntegriCloud