summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-138-16/+16
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* getLoadName is only implemented for ELF, make it ELF only.Rafael Espindola2014-08-081-1/+13
| | | | llvm-svn: 215219
* Remove some calls to std::move.Rafael Espindola2014-08-011-3/+3
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-2/+2
| | | | llvm-svn: 214377
* [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,Simon Atanasyan2014-07-131-0/+1
| | | | | | obj2yaml and yaml2obj tools. llvm-svn: 212908
* [llvm-readobj] Fix output of MIPS GOT without local and global entries.Simon Atanasyan2014-07-051-1/+1
| | | | llvm-svn: 212374
* llvm-readobj: fix MachO relocatoin printing a bit.Tim Northover2014-07-041-6/+18
| | | | | | | | | | | | | | | | There were two issues here: 1. At the very least, scattered relocations cannot use the same code to determine the corresponding symbol being referred to. For some reason we pretend there is no symbol, even when one actually exists in the symtab, so to match this behaviour getRelocationSymbol should simply return symbols_end for scattered relocations. 2. Printing "-" when we can't get a symbol (including the scattered case, but not exclusively), isn't that helpful. In both cases there *is* interesting information in that field, so we should print it. As hex will do. Small part of rdar://problem/17553104 llvm-svn: 212332
* Rephrase loop so it doesn't leave unused bools around in Release mode.Benjamin Kramer2014-07-011-4/+2
| | | | llvm-svn: 212102
* Support: update DLLCharacteristics enumerationSaleem Abdulrasool2014-06-271-0/+2
| | | | | | | | Add the new AppContainer characteristic which is import for Windows Store (Metro) compatible applications. Add the new Control Flow Guard flag to bring the enumeration up to date with the current values as of Windows 8.1. llvm-svn: 211855
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-262-3/+4
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-262-4/+3
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* [llvm-readobj] Fix member functions name style.Simon Atanasyan2014-06-181-13/+13
| | | | llvm-svn: 211152
* [llvm-readobj] Fix compile error.Simon Atanasyan2014-06-181-1/+1
| | | | llvm-svn: 211151
* [llvm-readobj][ELF] New `-mips-plt-got` command line option to outputSimon Atanasyan2014-06-184-0/+241
| | | | | | | | MIPS GOT section. Patch reviewed by Rafael Espindola. llvm-svn: 211150
* Convert the Archive API to use ErrorOr.Rafael Espindola2014-06-161-3/+3
| | | | | | | | | Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are easy to use. No intended functionality change. llvm-svn: 211033
* Remove unused and odd code.Rafael Espindola2014-06-131-9/+0
| | | | | | | | This code was never being used and any use of it would look fairly strange. For example, it would try to map a object_error::parse_failed to std::errc::invalid_argument. llvm-svn: 210912
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-135-56/+55
| | | | llvm-svn: 210876
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-1311-27/+28
| | | | llvm-svn: 210866
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-125-0/+5
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove system_error.h.Rafael Espindola2014-06-124-8/+7
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* Don't import error_category into the llvm namespace.Rafael Espindola2014-06-122-3/+3
| | | | llvm-svn: 210733
* Don't import error_condition into the llvm namespace.Rafael Espindola2014-06-121-3/+5
| | | | llvm-svn: 210731
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-114-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* Use an enum class.Rafael Espindola2014-06-112-22/+13
| | | | llvm-svn: 210623
* Mark a few functions noexcept.Rafael Espindola2014-06-101-2/+2
| | | | | | This reduces the difference between std::error_code and llvm::error_code. llvm-svn: 210591
* [llvm-readobj][ELF] Factor out the code retrieve ELF symbol informationSimon Atanasyan2014-06-101-35/+50
| | | | | | | | (section name, section index, full name) into the separate functions. No functional changes. llvm-svn: 210509
* tools: add a high level explanation for WoA EH dataSaleem Abdulrasool2014-06-071-21/+81
| | | | | | | | | | | | Add a brief explanation of the data section layout for the unwind data that the Windows on ARM EH models. This is simply to provide a rough idea of the layout of the code involved in the decoding of the unwinding. Details on the involved data structures are available in the associated support header. The bulk of it is related to printing out the byte-code to help validate generation of WoA EH. No functional change. llvm-svn: 210397
* tools: fix parenthesis warning from GCCSaleem Abdulrasool2014-06-041-1/+1
| | | | | | Add parenthesis as suggested by GCC. llvm-svn: 210194
* tools: fix silly typo in llvm-readobjSaleem Abdulrasool2014-06-041-1/+1
| | | | | | | Case insensitive case preserving file systems are not a good choice for development. llvm-svn: 210193
* tools: initial implementation of WoA EH decodingSaleem Abdulrasool2014-06-044-0/+812
| | | | | | | | | | | | | Add support to llvm-readobj to decode Windows ARM Exception Handling data. This uses the previously added datastructures to decode the information into a format that can be used by tests. This is a necessary step to add support for emitting Windows on ARM exception handling information. A fair amount of formatting inspiration is drawn from the Win64 EH printer as well as the ARM EHABI printer. This allows for a reasonably thorough look into the encoded data. llvm-svn: 210192
* tools: introduce StreamWriter::printBooleanSaleem Abdulrasool2014-06-041-0/+4
| | | | | | | Add a helper print method to print a boolean value as "Yes" or "No". This is intended to be used by the Windows ARM EH printer. llvm-svn: 210191
* [Object][ELF] Range-based loop simplification.Simon Atanasyan2014-06-041-13/+10
| | | | | | No functional changes. llvm-svn: 210164
* There is no std::errc::success, remove the llvm one.Rafael Espindola2014-05-311-1/+1
| | | | llvm-svn: 209960
* tools: avoid use of std::functionSaleem Abdulrasool2014-05-253-12/+14
| | | | | | | | | | | Remove the use of the std::function and replace the capturing lambda with a non-capturing one, opting to pass the user data down to the context. This is needed as std::function is not yet available on all hosted platforms (it requires RTTI, which breaks on Windows). Thanks to Nico Rieck for pointing this out! llvm-svn: 209607
* tools: split out Win64EHDumper from COFFDumperSaleem Abdulrasool2014-05-254-328/+406
| | | | | | | | | | Move the implementation of the Win64 EH printer from the COFFDumper into its own class. This is in preparation for adding support to print ARM EH information. The only real change here is in printUnwindInfo where we now lambda lift the implicit this parameter for the resolveFunction. Also setup the printing to handle ARM. This now has set the stage to introduce ARM EH printing. llvm-svn: 209606
* tools: inline simple single-use functionSaleem Abdulrasool2014-05-251-18/+6
| | | | | | | This inlines the single use function in preparation for splitting the Win64EH printing out of the COFFDumper into its own entity. llvm-svn: 209605
* tools: refactor COFFDumper symbol resolution logicSaleem Abdulrasool2014-05-251-61/+69
| | | | | | | | | | Make the use of the cache more transparent to the users. There is no reason that the cached entries really need to be passed along. The overhead for doing so is minimal: a single extra parameter. This requires that some standalone functions be brought into the COFFDumper class so that they may access the cache. llvm-svn: 209604
* tools: use references rather than out pointers in COFFDumperSaleem Abdulrasool2014-05-251-18/+8
| | | | | | | Switch to use references for parameters that are guaranteed to be non-null. Simplifies the code a slight bit in preparation for another change. llvm-svn: 209603
* build: sort llvm-readobj sourcesSaleem Abdulrasool2014-05-241-4/+4
| | | | | | Sort the source files. NFC. llvm-svn: 209587
* llvm-readobj: remove some dead codeSaleem Abdulrasool2014-05-241-28/+0
| | | | llvm-svn: 209586
* [Mips] Add more relocation types and MIPS specific e_flags constants.Simon Atanasyan2014-05-201-1/+3
| | | | llvm-svn: 209201
* llvm-readobj: use range-based for loopSaleem Abdulrasool2014-05-201-5/+3
| | | | | | Convert an additional site to a range based for loop. NFC. llvm-svn: 209194
* [llvm-readobj] Print values of FLAGS and MIPS_FLAGS dynamic table tagsSimon Atanasyan2014-05-111-1/+61
| | | | | | in a human readable form. llvm-svn: 208489
* [llvm-readobj] Transform 'switch' with the only 'case' statementSimon Atanasyan2014-05-011-5/+2
| | | | | | | | to 'if' statement. No functional changes, llvm-svn: 207748
* [llvm-readobj] Add support for Mips specific ELF header e_flags.Simon Atanasyan2014-05-011-1/+29
| | | | llvm-svn: 207744
* [C++] Use 'nullptr'.Craig Topper2014-04-281-1/+1
| | | | llvm-svn: 207394
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-253-37/+39
| | | | llvm-svn: 207176
* [C++11] Range-based loop simplification.Simon Atanasyan2014-04-201-16/+13
| | | | llvm-svn: 206715
* tools: fix invalid printing, buffer overrun in llvm-readobjSaleem Abdulrasool2014-04-161-0/+1
| | | | | | All auxiliary records are consumed when accessing a File record. llvm-svn: 206354
OpenPOWER on IntegriCloud