summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* tools: address possible non-null terminated filenamesSaleem Abdulrasool2014-04-141-1/+4
| | | | | | | | | If a filename is a multiple of 18 characters, there will be no null-terminator. This will result in an invalid access by the constructed StringRef. Add a test case to exercise this and fix that handling. Address this same vulnerability in llvm-readobj as well. llvm-svn: 206145
* tools: remove duplication of coff_aux_fileSaleem Abdulrasool2014-04-131-9/+1
| | | | | | | Now that COFF::coff_aux_file is defined, use that rather than redefining the type locally. llvm-svn: 206140
* tools: remove unnecessary copy of array_lengthofSaleem Abdulrasool2014-04-122-46/+67
| | | | llvm-svn: 206115
* Create .symtab_shndxr only when needed.Rafael Espindola2014-03-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | We need .symtab_shndxr if and only if a symbol references a section with an index >= 0xff00. The old code was trying to figure out if the section was needed ahead of time, making it a fairly dependent on the code actually writing the table. It was also somewhat conservative and would create the section in cases where it was not needed. If I remember correctly, the old structure was there so that the sections were created in the same order gas creates them. That was valuable when MC's support for ELF was new and we tested with elf-dump.py. This patch refactors the symbol table creation to another class and makes it obvious that .symtab_shndxr is really only created when we are about to output a reference to a section index >= 0xff00. While here, also improve the tests to use macros. One file is one section short of needing .symtab_shndxr, the second one has just the right number. llvm-svn: 204769
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-241-2/+22
| | | | llvm-svn: 204584
* Object: Provide a richer means of describing auxiliary symbolsDavid Majnemer2014-03-191-18/+5
| | | | | | | | | | | | | | | | The current state of affairs has auxiliary symbols described as a big bag of bytes. This is less than satisfying, it detracts from the YAML file as being human readable. Instead, allow for symbols to optionally contain their auxiliary data. This allows us to have a much higher level way of describing things like weak symbols, function definitions and section definitions. This depends on D3105. Differential Revision: http://llvm-reviews.chandlerc.com/D3092 llvm-svn: 204214
* Object: Move auxiliary symbol definitions from llvm-readobjDavid Majnemer2014-03-191-26/+7
| | | | | | | | | | | | Summary: These definitions are useful to other aspects of LLVM, move them out. Reviewers: rafael, nrieck, ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3105 llvm-svn: 204213
* Object/COFF: Add function to check if section number is reserved one.Rui Ueyama2014-03-181-1/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D3103 llvm-svn: 204199
* [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make ↵Alexey Samsonov2014-03-181-51/+40
| | | | | | | | | | | | | | it work with range-based for loops. Reviewers: ruiu Reviewed By: ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3097 llvm-svn: 204120
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-171-27/+24
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 llvm-svn: 204031
* llvm-readobj: Print referred symbol name for CLR token definitionNico Rieck2014-03-171-1/+10
| | | | llvm-svn: 204024
* llvm-readobj: Add test for COFF auxiliary symbols as used by C++/CLINico Rieck2014-03-171-1/+3
| | | | llvm-svn: 204023
* Support: Make error_category's constructor publicJustin Bogner2014-03-151-1/+1
| | | | | | | | Since our error_category is based on the std one, we should have the same visibility for the constructor. This also allows us to avoid using the _do_message implementation detail in our own categories. llvm-svn: 203998
* [C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-142-41/+36
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
* [C++11] Use ObjectFile::sections() in commandline llvm toolsAlexey Samsonov2014-03-131-41/+34
| | | | llvm-svn: 203802
* Object: rename ARMV7 to ARMNTSaleem Abdulrasool2014-03-111-1/+1
| | | | | | | The official specifications state the name to be ARMNT (as per the Microsoft Portable Executable and Common Object Format Specification v8.3). llvm-svn: 203530
OpenPOWER on IntegriCloud