summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-land "COFF: migrate def parser from LLD to LLVM"Reid Kleckner2017-06-023-0/+848
| | | | | | | | | | | | | | | | | | | | | | This reverts commit r304561 and re-lands r303490 & co. The fix was to use "SymbolName" when translating LLD's internal export list to lib/Object's short export struct. The SymbolName reflects the actual symbol name, which may include fastcall and stdcall mangling bits not included in the /EXPORT or .def file EXPORTS name: @@ -434,8 +434,7 @@ std::vector<COFFShortExport> createCOFFShortExportFromConfig() { std::vector<COFFShortExport> Exports; for (Export &E1 : Config->Exports) { COFFShortExport E2; - E2.Name = E1.Name; + // Use SymbolName, which will have any stdcall or fastcall qualifiers. + E2.Name = E1.SymbolName; E2.ExtName = E1.ExtName; E2.Ordinal = E1.Ordinal; E2.Noname = E1.Noname; llvm-svn: 304573
* Revert "COFF: migrate def parser from LLD to LLVM"Reid Kleckner2017-06-023-848/+0
| | | | | | | | | | This reverts commits r303490, r303491, r303493, and r303494. This caused http://crbug.com/728726. Essentially, exporting stdcall functions doesn't appear to work after this change. Reduced test case soon. llvm-svn: 304561
* [MachOObject] Fix bind opcode parser error on valid opcode sequenceSteven Wu2017-05-311-1/+1
| | | | | | | BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(0) is a valid way to setp library ordinal. MachOObject should set LibraryOrdinalSet even when IMM is zero. llvm-svn: 304362
* Fix bug on Big-Endian system, due to reference to vector out of scope.Eric Beckmann2017-05-301-1/+1
| | | | llvm-svn: 304255
* This patch should fix various clang warnings and a use of to_stringEric Beckmann2017-05-301-1/+2
| | | | | | which isn't support before c++11. llvm-svn: 304252
* [Object] Remove unused field + constructor.Benjamin Kramer2017-05-301-2/+0
| | | | llvm-svn: 304233
* [Object] Fix pessimizing move.Benjamin Kramer2017-05-301-1/+1
| | | | | | | Returning the Error by value triggers copy elision, the move is more expensive. Clang rightfully warns about it. llvm-svn: 304232
* Adding parsing ability for .res file.Eric Beckmann2017-05-301-12/+145
| | | | | | | | Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33566 llvm-svn: 304225
* Recommit "[DWARF] - Make collectAddressRanges() return section index in ↵George Rimar2017-05-273-0/+12
| | | | | | | | | | | | | | | | | | | | | | addition to Low/High PC" With fix of uninitialized variable. Original commit message: This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 304078
* Revert r304002 "[DWARF] - Make collectAddressRanges() return section index ↵George Rimar2017-05-263-12/+0
| | | | | | | | in addition to Low/High PC" Revert it again. Now another bot unhappy: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/8750 llvm-svn: 304011
* [DWARF] - Make collectAddressRanges() return section index in addition to ↵George Rimar2017-05-263-0/+12
| | | | | | | | | | | | | | | | | | Low/High PC This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 304002
* Revert "[DWARF] - Make collectAddressRanges() return section index in ↵George Rimar2017-05-263-12/+0
| | | | | | | | | | | | addition to Low/High PC" Broked BB again: TEST 'LLVM :: DebugInfo/X86/dbg-value-regmask-clobber.ll' FAILED ... LLVM ERROR: Section was outside of section table. llvm-svn: 303984
* Recommit r303978 "[DWARF] - Make collectAddressRanges() return section index ↵George Rimar2017-05-263-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | in addition to Low/High PC" With fix of test compilation. Initial commit message: This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 303983
* Revert r303978 "[DWARF] - Make collectAddressRanges() return section index ↵George Rimar2017-05-263-12/+0
| | | | | | | | in addition to Low/High PC" It failed BB. llvm-svn: 303981
* [DWARF] - Make collectAddressRanges() return section index in addition to ↵George Rimar2017-05-263-0/+12
| | | | | | | | | | | | | | | | | | | | | | Low/High PC This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 303978
* COFF: Fix another StringRef return errorMartell Malone2017-05-201-1/+1
| | | | | | | This should appease the lld build bot regression Following up on rL303493 llvm-svn: 303494
* COFF: Fix single StringRef return errorMartell Malone2017-05-201-2/+2
| | | | | | | This should appease the lld build bot regression Intrroduced by rL303490 llvm-svn: 303493
* COFF: migrate def parser from LLD to LLVM [1/2]Martell Malone2017-05-203-0/+848
| | | | | | | | | | | | This is split up into two commits. The will create the DEF parser in LLVM. Check the following commit to see the removal from LLD Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D32689 llvm-svn: 303490
* Fix -Wunneeded-internal-declaration by removing constant arrays only used in ↵David Blaikie2017-05-201-6/+4
| | | | | | sizeof expressions, in favor of constants containing the size directly llvm-svn: 303483
* Add functionality to cvtres to parse all entries in res file.Eric Beckmann2017-05-203-1/+96
| | | | | | | | | | | Summary: Added the new modules in the Object/ folder. Updated the llvm-cvtres interface as well, and added additional tests. Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D33180 llvm-svn: 303480
* [lib/Object] - Minor API update for llvm::Decompressor.George Rimar2017-05-181-5/+0
| | | | | | | | | | | | | | | | | I revisited Decompressor API (issue with it was triggered during D32865 review) and found it is probably provides more then we really need. Issue was about next method's signature: Error decompress(SmallString<32> &Out); It is too strict. At first I wanted to change it to decompress(SmallVectorImpl<char> &Out), but then found it is still not flexible because sticks to SmallVector. During reviews was suggested to use templating to simplify code. Patch do that. Differential revision: https://reviews.llvm.org/D33200 llvm-svn: 303331
* [COFF] Gracefully handle empty .drectve sectionsShoaib Meenai2017-05-141-1/+1
| | | | | | | | | | | | | | | | | | Running `llvm-readobj -coff-directives msvcrt.lib` resulted in this error: Invalid data was encountered while parsing the file This happened because some of the object files in the archive have empty `.drectve` sections. These empty sections result in a `parse_failed` error being returned from `COFFObjectFile::getSectionContents()`, which in turn caused `llvm-readobj` to stop. With this change, `getSectionContents` now returns success, and like before the resulting array is empty. Patch by Dave Lee. Differential Revision: https://reviews.llvm.org/D32652 llvm-svn: 303014
* [WebAssembly] Improve libObject support for wasm imports and exportsSam Clegg2017-05-091-10/+29
| | | | | | | | | | | | Previously we had only supported the importing and exporting of functions and globals. Also, add usefull overload of getWasmSymbol() and getNumberOfSymbols() in support of lld port. Differential Revision: https://reviews.llvm.org/D33011 llvm-svn: 302601
* Fix the Endianness bug by adding the little endian UTF marker.Eric Beckmann2017-05-091-2/+0
| | | | | | | | | | | | Summary: Quick fix Reviewers: zturner, uweigand Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33014 llvm-svn: 302573
* [WebAssembly] Fix validation of start functionSam Clegg2017-05-091-1/+1
| | | | | | | | | | The check for valid start function was inverted. Added a new test in test/Object to check this case and fixed the existing tests in for ObjectYAML. Differential Revision: https://reviews.llvm.org/D32986 llvm-svn: 302560
* Hopefully one last commit to fix this patch, addresses string referenceEric Beckmann2017-05-081-7/+3
| | | | | | issues. llvm-svn: 302401
* Update llvm-readobj -coff-resources to display tree structure.Eric Beckmann2017-05-081-2/+47
| | | | | | | | | | | | Summary: Continue making updates to llvm-readobj to display resource sections. This is necessary for testing the up and coming cvtres tool. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32609 llvm-svn: 302399
* Revert "Hopefully one last commit to fix this patch, addresses string reference"Eric Beckmann2017-05-081-43/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This reverts commit 56beec1b1cfc6d263e5eddb7efff06117c0724d2. Revert "Quick fix to D32609, it seems .o files are not transferred in all cases." This reverts commit 7652eecd29cfdeeab7f76f687586607a99ff4e36. Revert "Update llvm-readobj -coff-resources to display tree structure." This reverts commit 422b62c4d302cfc92401418c2acd165056081ed7. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32958 llvm-svn: 302397
* Hopefully one last commit to fix this patch, addresses string referenceEric Beckmann2017-05-081-7/+3
| | | | | | issues. llvm-svn: 302395
* Update llvm-readobj -coff-resources to display tree structure.Eric Beckmann2017-05-071-2/+47
| | | | | | | | | | | | Summary: Continue making updates to llvm-readobj to display resource sections. This is necessary for testing the up and coming cvtres tool. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32609 llvm-svn: 302386
* [WebAssembly] Add wasm symbol table support to llvm-objdumpSam Clegg2017-05-041-21/+47
| | | | | | Differential Revision: https://reviews.llvm.org/D32760 llvm-svn: 302185
* Add llvm::object::getELFSectionTypeName().Rafael Espindola2017-05-021-3/+63
| | | | | | | | | | | This is motivated by https://reviews.llvm.org/D32488 where I am trying to add printing of the section type for incompatible sections to LLD error messages. This patch allows us to use the same code in llvm-readobj and LLD instead of duplicating the function inside LLD. Patch by Alexander Richardson! llvm-svn: 301921
* Object: Remove ModuleSummaryIndexObjectFile class.Peter Collingbourne2017-05-012-130/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D32195 llvm-svn: 301832
* LTO: Mark undefined module asm symbols as used.Peter Collingbourne2017-04-261-0/+3
| | | | | | | | | | | | | | | | Marking them as used causes them to be considered visible outside of LTO. This prevents the symbols from being internalized or discarded, either by GlobalDCE or by summary-based dead stripping in ThinLTO. This change makes it unnecessary to add these symbols to llvm.compiler.used in the backend, as the symbols are kept alive by virtue of being external, so remove the backend code that handles that. Fixes PR32798. Differential Revision: https://reviews.llvm.org/D32544 llvm-svn: 301438
* revert debuggingSam Clegg2017-04-261-1/+1
| | | | llvm-svn: 301370
* [WebAssembly] Allow for signed relocation addendsSam Clegg2017-04-261-2/+3
| | | | | | | | | | | | | | Summary: Addends are used as offsets to addresses of globals and can be both positive and negative. This change prints libObject in line with the spec and the MC layer. Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32507 llvm-svn: 301369
* [WebAssembly] Read global index in init expression as LEBSam Clegg2017-04-251-1/+1
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32462 llvm-svn: 301330
* [Object] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-04-246-28/+94
| | | | | | other minor fixes (NFC). llvm-svn: 301275
* [Object] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-04-213-114/+135
| | | | | | other minor fixes (NFC). llvm-svn: 301049
* [Object] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-04-195-41/+90
| | | | | | other minor fixes (NFC). llvm-svn: 300779
* Object: Shrink the size of irsymtab::Symbol by a word. NFCI.Peter Collingbourne2017-04-171-14/+18
| | | | | | | | | | Instead of storing an UncommonIndex on the Symbol, use a flag bit to store whether the Symbol has an Uncommon. This shrinks Chromium's .bc files (after D32061) by about 1%. Differential Revision: https://reviews.llvm.org/D32070 llvm-svn: 300514
* Object: Use offset+size as the irsymtab string representation.Peter Collingbourne2017-04-171-1/+2
| | | | | | | | This is consistent with the bitcode string table. Differential Revision: https://reviews.llvm.org/D31922 llvm-svn: 300465
* This patch closes PR#32216: Better testing of schedule model instruction ↵Andrew V. Tischenko2017-04-142-2/+3
| | | | | | | | latencies/throughputs. The details are here: https://reviews.llvm.org/D30941 llvm-svn: 300311
* Object, LTO: Add target triple to irsymtab and LTO API.Peter Collingbourne2017-04-141-0/+1
| | | | | | | | | | Start using it in LLD to avoid needing to read bitcode again just to get the target triple, and in llvm-lto2 to avoid printing symbol table information that is inappropriate for the target. Differential Revision: https://reviews.llvm.org/D32038 llvm-svn: 300300
* LTO: Pass SF_Executable flag through to InputFile::SymbolTobias Edler von Koch2017-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The linker needs to be able to determine whether a symbol is text or data to handle the case of a common being overridden by a strong definition in an archive. If the archive contains a text member of the same name as the common, that function is discarded. However, if the archive contains a data member of the same name, that strong definition overrides the common. This is a behavior of ld.bfd, which the Qualcomm linker also supports in LTO. Here's a test case to illustrate: #### cat > 1.c << \! int blah; ! cat > 2.c << \! int blah() { return 0; } ! cat > 3.c << \! int blah = 20; ! clang -c 1.c clang -c 2.c clang -c 3.c ar cr lib.a 2.o 3.o ld 1.o lib.a -t #### The correct output is: 1.o (lib.a)3.o Thanks to Shankar Easwaran and Hemant Kulkarni for the test case! Reviewers: mehdi_amini, rafael, pcc, davide Reviewed By: pcc Subscribers: davide, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D31901 llvm-svn: 300205
* Remove unused functions. Remove static qualifier from functions in header ↵Vassil Vassilev2017-04-111-7/+0
| | | | | | files. NFC. llvm-svn: 299947
* [WASM] Remove other comparison of unsigned expression >= 0.Davide Italiano2017-04-011-3/+3
| | | | | | This should finally fix the GCC 7 build with -Werror. llvm-svn: 299313
* [WASM] Remove a set but never used variable.Davide Italiano2017-04-011-4/+1
| | | | llvm-svn: 299312
* [WASM] Remove an assertion that can never fire.Davide Italiano2017-04-011-2/+2
| | | | | | uint* is by definition always >=0. llvm-svn: 299311
* Fix MSVC 'not all control paths return a value' warningSimon Pilgrim2017-03-311-0/+1
| | | | llvm-svn: 299195
OpenPOWER on IntegriCloud