summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* Finish templating MachObjectFile over endianness.Rafael Espindola2013-04-133-70/+128
| | | | | | | 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
* Revert broken pieces of r179373.Benjamin Kramer2013-04-121-9/+10
| | | | | | You can't copy an OwningPtr, and move semantics aren't available in C++98. llvm-svn: 179374
* Replace uses of the deprecated std::auto_ptr with OwningPtr.Andy Gibbs2013-04-128-19/+18
| | | | llvm-svn: 179373
* Teach llvm-readobj to print ELF program headersNico Rieck2013-04-123-5/+58
| | | | llvm-svn: 179363
* Add -expand-relocs to llvm-readobjNico Rieck2013-04-125-23/+59
| | | | | | | | | | | | | | 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
* Add 179294 back, but don't use bit fields so that it works on big endian hosts.Rafael Espindola2013-04-121-4/+12
| | | | | | | | | | | | | | 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
* Revert my last two commits while I debug what is wrong in a big endian host.Rafael Espindola2013-04-111-12/+4
| | | | llvm-svn: 179303
* Print more information about relocations.Rafael Espindola2013-04-111-4/+12
| | | | | | | | | | 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
* Simplify the code. No functionality change.Rafael Espindola2013-04-111-17/+1
| | | | llvm-svn: 179259
* Template MachOObjectFile over endianness too.Rafael Espindola2013-04-101-8/+8
| | | | llvm-svn: 179179
* Template the MachO types over endianness.Rafael Espindola2013-04-101-5/+6
| | | | | | For now they are still only used as little endian. llvm-svn: 179147
* Convert MachOObjectFile to a template.Rafael Espindola2013-04-094-20/+22
| | | | | | | For now it is templated only on being 64 or 32 bits. I will add little/big endian next. llvm-svn: 179097
* Template the MachO types over the word size.Rafael Espindola2013-04-081-5/+6
| | | | llvm-svn: 179051
* Remove a global 'endl' variable from the other file as well.Chandler Carruth2013-04-081-25/+22
| | | | llvm-svn: 179010
* Clean up namespaces in obj2yaml.cpp.Chandler Carruth2013-04-081-11/+12
| | | | llvm-svn: 179009
* Cleanup the formatting of obj2yaml.cpp.Chandler Carruth2013-04-081-22/+23
| | | | | | | | I couldn't touch this file and not clean it up some. These reformattings brought to you by clang-format, with some minor adjustments by me. More spring cleaning to follow here. llvm-svn: 179004
* Don't define our own global 'endl' variable. While technically it hadChandler Carruth2013-04-081-5/+3
| | | | | | | | | | | | | | | | | | internal linkage and so wasn't a patent bug, it doesn't make any sense here. We can avoid even calling operator<< by just embedding the newline in the string literals that were already being streamed out. It also gives the impression of some line-ending agnosticisms which is not present, and that flushing happens when it doesn't. If we want to use std::endl, we could do that, but honestly it doesn't seem remotely worth it. Using '\n' directly is much more clear when working with raw_ostream. It also happens to fix builds with old crufty GCC STL implementations that include std::endl into the global namespace (or headers written to be compatible with such atrocities). llvm-svn: 179003
* Implement MachOObjectFile::getHeader directly.Rafael Espindola2013-04-071-4/+4
| | | | llvm-svn: 178994
* Remove LoadCommandInfo now that we always have a pointer to the command.Rafael Espindola2013-04-071-3/+3
| | | | | | | LoadCommandInfo was needed to keep a command and its offset in the file. Now that we always have a pointer to the command, we don't need the offset. llvm-svn: 178991
* Add MachOObjectFile::LoadCommandInfo.Rafael Espindola2013-04-071-2/+2
| | | | | | This avoids using MachOObject::getLoadCommandInfo. llvm-svn: 178990
* Remove MachOObjectFile::getObject.Rafael Espindola2013-04-071-10/+8
| | | | llvm-svn: 178986
* Remove two uses of getObject.Rafael Espindola2013-04-071-13/+2
| | | | llvm-svn: 178985
* Remove usage of InMemoryStruct in getSymbol.Rafael Espindola2013-04-071-26/+6
| | | | llvm-svn: 178984
* Remove a use of InMemoryStruct in llvm-readobj.Rafael Espindola2013-04-071-9/+6
| | | | llvm-svn: 178981
* Make getObject const. Remove a const_cast.Rafael Espindola2013-04-072-3/+3
| | | | llvm-svn: 178980
* Remove last use of InMemoryStruct in llvm-objdump.Rafael Espindola2013-04-071-2/+2
| | | | llvm-svn: 178979
* Remove dead code.Rafael Espindola2013-04-071-17/+0
| | | | llvm-svn: 178977
* Remove unused argument.Rafael Espindola2013-04-071-3/+1
| | | | llvm-svn: 178976
* Move yaml2obj to tools too.Rafael Espindola2013-04-055-1/+734
| | | | llvm-svn: 178904
* Fix include guards to match new location.Rafael Espindola2013-04-051-2/+2
| | | | llvm-svn: 178877
* Don't fetch pointers from a InMemoryStruct.Rafael Espindola2013-04-053-23/+12
| | | | | | | | 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
* llvm-symbolizer: correctly parse filenames given in quotesAlexey Samsonov2013-04-051-5/+18
| | | | llvm-svn: 178859
* Move obj2yaml to tools to sort out make's dependencies.Rafael Espindola2013-04-057-1/+511
| | | | llvm-svn: 178835
* Don't export symbols in every binary on linux.Rafael Espindola2013-04-042-0/+2
| | | | | | | | | | | | On freebsd this makes sure that symbols are exported on the binaries that need them. The net result is that we should get symbols in the binaries that need them on every platform. On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB. Patch by Stephen Checkoway. llvm-svn: 178725
* Implements low-level object file format specific output for COFF andEric Christopher2013-04-0315-426/+3073
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't disassemble symbols with an unknown address or size.Eric Christopher2013-04-031-0/+1
| | | | | | Patch by Nico Rieck! llvm-svn: 178678
* Run the ObjCARCContract pass for LTO. <rdar://problem/13538084>Bob Wilson2013-03-291-0/+5
| | | | llvm-svn: 178385
* Manually update the dependencies in the Makefiles. It turns out that allChandler Carruth2013-03-269-9/+9
| | | | | | | | | | | that work on the LLVMBuild based dependency specification didn't actually work, we just now maintain dependencies in *3* places instead of 2. Yay. There may still be some missing dependencies, I'm still sifting through the bots and my builds, but this is a step in the right direction. llvm-svn: 177988
* Split out the IRReader header and the utility functions it provides intoChandler Carruth2013-03-2624-23/+29
| | | | | | | | | | | | | | | | | | | | | | | | its own library. These functions are bridging between the bitcode reader and the ll parser which are in different libraries. Previously we didn't have any good library to do this, and instead played fast and loose with a "header only" set of interfaces in the Support library. This really doesn't work well as evidenced by the recent attempt to add timing logic to the these routines. As part of this, make them normal functions rather than weird inline functions, and sink the implementation into the library. Also clean up the header to be nice and minimal. This requires updating lots of build system dependencies to specify that the IRReader library is needed, and several source files to not implicitly rely upon the header file to transitively include all manner of other headers. If you are using IRReader.h, this commit will break you (the header moved) and you'll need to also update your library usage to include 'irreader'. I will commit the corresponding change to Clang momentarily. llvm-svn: 177971
* [tools][llvm-readobj] print the name of the section when iterating the ↵Shankar Easwaran2013-03-251-12/+19
| | | | | | symbol table / dynamic symbol table llvm-svn: 177873
* Remove stale commentEli Bendersky2013-03-191-3/+0
| | | | llvm-svn: 177410
* Fix for r177390: map values are pointers, use DeleteContainerSeconds() ↵Alexey Samsonov2013-03-191-1/+2
| | | | | | instead of .clear() llvm-svn: 177409
* llvm-symbolizer: flush internal caches functionalityDmitry Vyukov2013-03-192-0/+5
| | | | llvm-svn: 177390
* Build LLVMgold.so on FreeBSD using cmake.Rafael Espindola2013-03-171-1/+2
| | | | | | Patch by Stephen Checkoway. llvm-svn: 177233
* Make LTO codegen use a PassManager, rather than a FunctionPassManager, for theLang Hames2013-03-131-13/+5
| | | | | | | | | | | | | codegen passes. This brings it in to line with clang and llc's codegen setup, and tidies up the code. If I understand correctly, adding ModulePasses to a FunctionPassManager is bogus. It only seems to explode if an added ModulePass depends on a FunctionPass though, which might be why this code has survived so long. Fixes <rdar://problem/13386816>. llvm-svn: 176977
* Connect LLVM CMake build scripts to LLDB's CMake scripts:Daniel Malea2013-02-281-0/+1
| | | | | | | | - if you have LLDB checked out in $llvm/tools, CMake will build it now! - LLDB is known to build on Linux with libstdc++ and GCC 4.6/4.7 or Clang 3.3 - to run lldb tests, do "make check-lldb" after a build llvm-svn: 176307
* Add the -disable-opt option to LTO. This adds:Bill Wendling2013-02-281-1/+7
| | | | | | | | | | | | | | - Consistency with opt (which supports the same option with the same meaning and description). - Debugging gold plugin-based linking without optimizations getting in the way. - Debugging programs linked with the gold plugin while preserving the original debug info. - Fine-grained control over LTO passes using the gold plugin in combination with opt (or clang/dragonegg). Patch by Cristiano Giuffrida! llvm-svn: 176257
* print TLS segmentShankar Easwaran2013-02-271-0/+3
| | | | llvm-svn: 176192
* Try to get rid of a -wunitialized warning: explicitly initialize the pointerEli Bendersky2013-02-261-1/+3
| | | | | | to NULL and use asserts to check in relevant places. llvm-svn: 176134
* Fix auto_ptr is deprecated warningsMatt Arsenault2013-02-261-11/+11
| | | | llvm-svn: 176123
OpenPOWER on IntegriCloud