summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/COFFImportFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [COFF] Use symbolic constants instead of hardcoded numbers. NFCI.Martin Storsjo2018-07-201-1/+6
| | | | | | Patch by Martell Malone. llvm-svn: 337614
* [COFF] Improve correctness of def parsing for GNU featuresMartin Storsjo2018-05-091-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | The operator == used for exporting a function with a different name in the DLL compared to the name in the import library (which is useful for adding linker level aliases for function in the import library) is a feature distinct and different from the operator = used for exporting a function with a different name (both in import library and DLL) than in the implementation producing the DLL. When creating an import library using dlltool, from a def file that contains forwards (Func = OtherDll.Func), this shouldn't affect the produced import library, which should still behave just as if it was a normal exported function. This clears a lot of confusion and subtle misunderstandings, and avoids a parameter that was used to avoid creating weak aliases when invoked from lld. (This parameter was added previously due to the existing conflation of the two features.) Differential Revision: https://reviews.llvm.org/D46245 llvm-svn: 331859
* [COFF] Keep the underscore on exported decorated stdcall functions in MSVC modeMartin Storsjo2018-01-201-3/+12
| | | | | | | | | This (together with the corresponding LLD commit, that contains the testcase updates) fixes PR35733. Differential Revision: https://reviews.llvm.org/D41631 llvm-svn: 323035
* Fixed the gcc 'enumeral and non-enumeral type in conditional expression ↵Galina Kistanova2017-12-151-3/+3
| | | | | | [-Werror=extra]' warning introduced by r320750 llvm-svn: 320868
* Remove redundant includes from lib/Object.Michael Zolotukhin2017-12-131-2/+0
| | | | llvm-svn: 320625
* Convert the archive writer to use Error.Rafael Espindola2017-09-211-6/+5
| | | | | | This found one place in lld that was not checking the error. llvm-svn: 313937
* Simplify writeArchive return type.Rui Ueyama2017-08-301-5/+3
| | | | | | | | | | writeArchive returned a pair, but the first element of the pair is always its first argument on failure, so it doesn't make sense to return it from the function. This patch change the return type so that it does't return it. Differential Revision: https://reviews.llvm.org/D37313 llvm-svn: 312177
* [COFF] Make the weak aliases optionalMartin Storsjo2017-08-161-2/+2
| | | | | | | | | | | | | | | | When creating an import library from lld, the cases with Name != ExtName shouldn't end up as a weak alias, but as a real export of the new name, which is what actually is exported from the DLL. This restores the behaviour of renamed exports to what it was in 4.0. The other half of this commit, including test, goes into lld. Differential Revision: https://reviews.llvm.org/D36633 llvm-svn: 310991
* [COFF] Add SymbolName as a distinct field in COFFImportFileMartin Storsjo2017-08-161-1/+1
| | | | | | | | | | | The previous Name and ExtName aren't enough to convey all the nuances between weak aliases and stdcall decorated function names. A test for this will be added in LLD. Differential Revision: https://reviews.llvm.org/D36544 llvm-svn: 310988
* [llvm-dlltool] Write correct weak externalsMartin Storsjo2017-07-311-8/+5
| | | | | | | | | | | | | Previously, the created object files for the import library were broken. Write the symbol table before the string table. Simplify the code by using a separate variable Prefix instead of duplicating a few lines. Also update the coff-weak-exports to actually check that the generated weak symbols can be found as intended. Differential Revision: https://reviews.llvm.org/D36065 llvm-svn: 309555
* [COFF] ARM64 support for COFFImportFileMartin Storsjo2017-07-251-0/+3
| | | | | | | | A test will be committed separately in the lld repo. Differential Revision: https://reviews.llvm.org/D35766 llvm-svn: 308951
* Object: rename parameter from DLLName to ImportNameSaleem Abdulrasool2017-07-181-16/+16
| | | | | | | | | | When I originally wrote this code, I neglected the fact that the import library may be created for executables. This name is not the name of the DLL, but rather the name for the imported module. It will be embedded into the IAT/ILT reference. Rename it to make it more obvious. NFC. llvm-svn: 308384
* llvm: add llvm-dlltool support to the archiverMartell Malone2017-07-181-13/+101
| | | | | | | | | | | | | | | | A PE COFF spec compliant import library generator. Intended to be used with mingw-w64. Supports: PE COFF spec (section 8, Import Library Format) PE COFF spec (Aux Format 3: Weak Externals) Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D29892 This reapplies rL308329, which was reverted in rL308374 llvm-svn: 308379
* Revert r308329: llvm: add llvm-dlltool support to the archiverRui Ueyama2017-07-181-101/+13
| | | | | | This reverts commit r308329 because it broke buildbots. llvm-svn: 308374
* llvm: fix -Wcast gcc warn error from rL308329Martell Malone2017-07-181-6/+3
| | | | llvm-svn: 308360
* llvm: add llvm-dlltool support to the archiverMartell Malone2017-07-181-13/+104
| | | | | | | | | | | | | | | A PE COFF spec compliant import library generator. Intended to be used with mingw-w64. Supports: PE COFF spec (section 8, Import Library Format) PE COFF spec (Aux Format 3: Weak Externals) Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D29892 llvm-svn: 308329
* Fixed warning: dereferencing type-punned pointer will break strict-aliasing ↵Galina Kistanova2017-06-081-7/+7
| | | | | | | | | rules. No need in reinterpret_cast<StringTableOffset &> here, as struct coff_symbol Name is a unin with the member StringTableOffset Offset. This union member could be accessed directly. llvm-svn: 305029
* Re-land "COFF: migrate def parser from LLD to LLVM"Reid Kleckner2017-06-021-0/+527
| | | | | | | | | | | | | | | | | | | | | | 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-021-527/+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
* 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-201-0/+527
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
OpenPOWER on IntegriCloud