summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] - Apply clang-format. NFC.George Rimar2018-03-221-10/+10
| | | | llvm-svn: 328195
* Make test a bit less strict. NFC.Rafael Espindola2018-03-211-5/+5
| | | | llvm-svn: 328168
* Replace a std::pair with a struct.Rafael Espindola2018-03-212-3/+7
| | | | | | This is more readable and should reduce the noise in a followup patch. llvm-svn: 328164
* [ELF][PPC64] Fix getRelExpr for R_PPC64_REL16_LO and R_PPC64_REL16_HAZaara Syeda2018-03-212-1/+37
| | | | | | | | | The relocations R_PPC64_REL16_LO and R_PPC64_REL16_HA should return R_PC for getRelExpr since they compute #lo(S + A – P) and #ha(S + A – P). Differential Revision: https://reviews.llvm.org/D44648 llvm-svn: 328103
* [ELF] - Teach LLD to hint about -fdebug-types-section.George Rimar2018-03-213-12/+37
| | | | | | | | | Patch teaches LLD to hint user about -fdebug-types-section flag if relocation overflow happens in debug section. Differential revision: https://reviews.llvm.org/D40954 llvm-svn: 328081
* Revert "Resubmit "Support embedding natvis files in PDBs.""Zachary Turner2018-03-2012-347/+5
| | | | | | | | This is still failing on a different bot this time due to some issue related to hashing absolute paths. Reverting until I can figure it out. llvm-svn: 328014
* Fix consitent -> consistent.Eric Christopher2018-03-202-2/+2
| | | | llvm-svn: 328010
* [ELF] Simplify compCtors and writeInt.Fangrui Song2018-03-201-6/+3
| | | | | | | | | | Reviewers: ruiu Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D44690 llvm-svn: 328009
* Resubmit "Support embedding natvis files in PDBs."Zachary Turner2018-03-2012-5/+347
| | | | | | | | | | | The issue causing this to fail in certain configurations should be fixed. It was due to the fact that DIA apparently expects there to be a null string at ID 1 in the string table. I'm not sure why this is important but it seems to make a difference, so set it. llvm-svn: 328002
* [ELF] - Make __start_/__stop_<section_name> symbols STV_PROTECTEDGeorge Rimar2018-03-203-15/+26
| | | | | | | | | There are no reasons for them to be STV_DEFAULT, recently bfd did the same change. Differential revision: https://reviews.llvm.org/D44566 llvm-svn: 327983
* Revert r327964 "lit: Make config.llvm_libxml2_enabled an int, not a string"Hans Wennborg2018-03-202-4/+4
| | | | | | | | | | | | | | It seems @LLVM_LIBXML2_ENABLED@ doesn't always get set to 0 when not available, but to nothing, which broke parsing of lit.site.cfg.py. > @LLVM_LIBXML2_ENABLED@ will be replaced with 0 or 1. Putting quotes > around that is unnecessary and just makes it harder to use the value. > This matches what have_zlib does below. > > This also puts the flag together with the feature-related ones instead > of the path-related flags. llvm-svn: 327966
* lit: Make config.llvm_libxml2_enabled an int, not a stringHans Wennborg2018-03-202-4/+4
| | | | | | | | | | | @LLVM_LIBXML2_ENABLED@ will be replaced with 0 or 1. Putting quotes around that is unnecessary and just makes it harder to use the value. This matches what have_zlib does below. This also puts the flag together with the feature-related ones instead of the path-related flags. llvm-svn: 327964
* [ELF] - Add test case for "unsupported relocation reference" error. NFCI.George Rimar2018-03-201-0/+30
| | | | | | | | | We do not have test showing we explicitly reject objects where relocation section goes before the target, i.e .rel[a].text is listed before .text, for example. The patch adds it. llvm-svn: 327963
* [ELF] Make SectionHeaderOffset less sensitive.Fangrui Song2018-03-201-1/+1
| | | | llvm-svn: 327931
* Remove GnuHashTableSection::getShift2().Rui Ueyama2018-03-193-6/+6
| | | | | | | | | | | Choosing a Shift2 value based on wordsize is cargo-culted from gold. Assuming that djb hash is a good hash function, choosing bits [4,9] shouldn't be any worse or better than choosing bits [5,10]. We shouldn't have copied that behavior that we can't justify in the first place. Differential Revision: https://reviews.llvm.org/D44547 llvm-svn: 327921
* allow-multiple-definitions should completely suppress errors instead of ↵Rui Ueyama2018-03-192-14/+11
| | | | | | | | | | | | | making them warnings. We found that when you pass --allow-multiple-definitions or `-z muldefs` to GNU linkers, they don't complain about duplicate symbols at all. They don't even print out warnings on it. We emit warnings in that case. If you pass --fatal-warnings, that difference results in a link failure. Differential Revision: https://reviews.llvm.org/D44549 llvm-svn: 327920
* Revert "Support embedding natvis files in PDBs."Zachary Turner2018-03-1911-337/+2
| | | | | | | This is causing a test failure on a certain bot, so I'm removing this temporarily until we can figure out the source of the error. llvm-svn: 327903
* Support embedding natvis files in PDBs.Zachary Turner2018-03-1911-2/+337
| | | | | | | | | | | | | | | | | | | | | | | | Natvis is a debug language supported by Visual Studio for specifying custom visualizers. The /NATVIS option is an undocumented link.exe flag which will take a .natvis file and "inject" it into the PDB. This way, you can ship the debug visualizers for a program along with the PDB, which is very useful for postmortem debugging. This is implemented by adding a new "named stream" to the PDB with a special name of /src/files/<natvis file name> and simply copying the contents of the xml into this file. Additionally, we need to emit a single stream named /src/headerblock which contains a hash table of embedded files to records describing them. This patch adds this functionality, including the /NATVIS option to lld-link. Differential Revision: https://reviews.llvm.org/D44328 llvm-svn: 327895
* [ELF] Add basic support for PPC LEZaara Syeda2018-03-197-6/+395
| | | | | | | | | | | | This patch adds changes to start supporting the Power 64-Bit ELF V2 ABI. This includes: - Changing the ElfSym::GlobalOffsetTable to be named .TOC. - Creating a GotHeader so the first entry in the .got is .TOC. - Setting the e_flags to be 1 for ELF V1 and 2 for ELF V2 Differential Revision: https://reviews.llvm.org/D44483 llvm-svn: 327871
* [ELF] Recommit 327248 with Arm using the .got for _GLOBAL_OFFSET_TABLE_Peter Smith2018-03-1916-34/+77
| | | | | | | | | | | | | | | | | | | | | | This is the same as 327248 except Arm defining _GLOBAL_OFFSET_TABLE_ to be the base of the .got section as some existing code is relying upon it. For most Targets the _GLOBAL_OFFSET_TABLE_ symbol is expected to be at the start of the .got.plt section so that _GLOBAL_OFFSET_TABLE_[0] = reserved value that is by convention the address of the dynamic section. Previously we had defined _GLOBAL_OFFSET_TABLE_ as either the start or end of the .got section with the intention that the .got.plt section would follow the .got. However this does not always hold with the current default section ordering so _GLOBAL_OFFSET_TABLE_[0] may not be consistent with the reserved first entry of the .got.plt. X86, X86_64 and AArch64 will use the .got.plt. Arm, Mips and Power use .got Fixes PR36555 Differential Revision: https://reviews.llvm.org/D44259 llvm-svn: 327823
* [COFF] Clarify comment. NFCShoaib Meenai2018-03-161-6/+8
| | | | | | | | | | | Reid pointed out the string table for supporting long section names is a BFD extension and the comments should reflect that. Explicitly spell out link.exe's and binutil's behavior around section names and the rationale for LLD's behavior. Differential Revision: https://reviews.llvm.org/D42659 llvm-svn: 327736
* Revert r327248, "For most Targets the _GLOBAL_OFFSET_TABLE_ symbol is ↵Peter Collingbourne2018-03-1617-85/+42
| | | | | | | | | | | expected to be at" This change broke ARM code that expects to be able to add _GLOBAL_OFFSET_TABLE_ to the result of an R_ARM_REL32. I will provide a reproducer on llvm-commits. llvm-svn: 327688
* Fix linker script operator precedence.Rui Ueyama2018-03-152-5/+10
| | | | | | | | | | | "&" should have higher priority than "|" [1]. Previously, they had the same priority. [1] https://sourceware.org/binutils/docs/ld/Operators.html Differential Revision: https://reviews.llvm.org/D43880 llvm-svn: 327684
* COFF: Implement string tail merging.Peter Collingbourne2018-03-157-5/+184
| | | | | | | | | | | | | | | | | | In COFF, duplicate string literals are merged by placing them in a comdat whose leader symbol name contains a specific prefix followed by the hash and partial contents of the string literal. This gives us an easy way to identify sections containing string literals in the linker: check for leader symbol names with the given prefix. Any sections that are identified in this way as containing string literals may be tail merged. We do so using the StringTableBuilder class, which is also used to tail merge string literals in the ELF linker. Tail merging is enabled only if ICF is enabled, as this provides a signal as to whether the user cares about binary size. Differential Revision: https://reviews.llvm.org/D44504 llvm-svn: 327668
* COFF: Move assignment of section RVAs to assignAddresses(). NFCI.Peter Collingbourne2018-03-154-43/+26
| | | | | | | | | | This makes the design a little more similar to the ELF linker and should allow for features such as ARM range extension thunks to be implemented more easily. Differential Revision: https://reviews.llvm.org/D44501 llvm-svn: 327667
* Add a comment about ELF spec and the symbol table's sh_info.Rui Ueyama2018-03-151-0/+4
| | | | llvm-svn: 327645
* [ELF] - Fix build bot after rL327612.George Rimar2018-03-151-1/+1
| | | | | | Missed this one. llvm-svn: 327616
* [ELF] - Simplify test case. NFCI.George Rimar2018-03-151-2/+1
| | | | llvm-svn: 327614
* [ELF] - Fix build bot after rL327612.George Rimar2018-03-151-2/+2
| | | | | | | Error was: error: field 'Size' will be initialized after field 'CommandString' [-Werror,-Wreorder] llvm-svn: 327613
* [ELF] - Show data and assignment commands in the map file.George Rimar2018-03-155-14/+100
| | | | | | | | | Patch teaches LLD to print BYTE/SHORT/LONG/QUAD and location move commands to the map file. Differential revision: https://reviews.llvm.org/D44004 llvm-svn: 327612
* Update Error MessageRumeet Dhindsa2018-03-1413-15/+16
| | | | | | | | | | | | | | Summary: Updates error message for dynamic relocation attempt for read only segments. Reviewers: ruiu Reviewed By: ruiu Subscribers: emaste, javed.absar, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D44453 llvm-svn: 327584
* [WebAssembly] Fix -Werror=extra failure due to enum in ternaryNicholas Wilson2018-03-141-1/+2
| | | | llvm-svn: 327579
* [ELF] Add .eh_frame pieces to map fileRui Ueyama2018-03-144-3/+52
| | | | | | | | | This patch is a simplified version of https://reviews.llvm.org/D42960 written by Andrew Ng. Differential Revision: https://reviews.llvm.org/D44168 llvm-svn: 327574
* [COFF] Fix LLD COFF tests as a follow-up to r327563Reid Kleckner2018-03-145-8/+11
| | | | | | | | | | | | I definitely didn't run the tests before committing :( Most of these tests failed because the LLD map file output changed, moving the functions from the main text section to a new per-function section. ICF also started to fire in a few cases, leading to new layouts. llvm-svn: 327571
* [test] Fix a temp filename in a test from SVN r327561. NFC.Martin Storsjo2018-03-141-1/+1
| | | | | | | An earlier file name accidentally slipped through into the committed version. llvm-svn: 327567
* Implement --cref.Rui Ueyama2018-03-148-3/+84
| | | | | | | | | | | | | | This is an option to print out a table of symbols and filenames. The output format of this option is the same as GNU, so that it can be processed by the same scripts as before after migrating from GNU to lld. This option is mildly useful; we can live without it. But it is pretty convenient sometimes, and it can be implemented in 50 lines of code, so I think lld should support this option. Differential Revision: https://reviews.llvm.org/D44336 llvm-svn: 327565
* [COFF] Enable per-function and data sections in LTOReid Kleckner2018-03-142-0/+32
| | | | | | | | | | | | Summary: This allows post-LTO symbol reordering and ICF. Reviewers: inglorion Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D44492 llvm-svn: 327563
* [MinGW] Add support for the GNU ld flag --kill-atMartin Storsjo2018-03-143-0/+7
| | | | llvm-svn: 327562
* [COFF] Add support for the GNU ld flag --kill-atMartin Storsjo2018-03-145-1/+67
| | | | | | | | | | | | | | | | | | | GNU ld has got a number of different flags for adjusting how to behave around stdcall functions. The --kill-at flag strips the trailing sdcall suffix from exported functions (which otherwise is included by default in MinGW setups). This also strips it from the corresponding import library though. That makes it hard to link to such an import library from code that calls the functions - but this matches what GNU ld does with this flag. Therefore, this flag is probably not sensibly used together with import libraries, but probably mostly when creating some sort of plugin, or if creating the import library separately with dlltool. Differential Revision: https://reviews.llvm.org/D44292 llvm-svn: 327561
* [wasm] Fix wasm lld test on Windows, where the executable name ends in .exeReid Kleckner2018-03-141-1/+1
| | | | llvm-svn: 327560
* [COFF] Add integration test for LTO + /guard:cfReid Kleckner2018-03-142-0/+50
| | | | | | | | | This tests that LLVM emits the relocations that /guard:cf needs to identify address taken. This was PR36624, which was fixed in r327557. llvm-svn: 327559
* Separate sentences to clarify a comment.Rui Ueyama2018-03-141-7/+9
| | | | llvm-svn: 327555
* Error instead of producing broken binary.Rafael Espindola2018-03-143-0/+27
| | | | | | | | This "fixes" PR36678 by just producing an error when we find a case where we would produce an plt entry that used ebx but ebx would not be set. llvm-svn: 327542
* Reduce code duplication a bit.Rafael Espindola2018-03-145-14/+18
| | | | | | | The code for computing the offset of an entry in the plt is simple, but it was duplicated in quite a few places. llvm-svn: 327536
* [WebAssembly] Use DenseMapInfo traits from LLVM repo. NFCNicholas Wilson2018-03-142-47/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D44150 llvm-svn: 327527
* [WebAssembly] Avoid COMDAT hashmap lookup for each symbol. NFCNicholas Wilson2018-03-147-15/+29
| | | | | | | | | This reduces the number of lookups to one per COMDAT group, rather than one per symbol in a COMDAT group. Differential Revision: https://reviews.llvm.org/D44344 llvm-svn: 327523
* [WebAssembly] Add missing implementation for --initial/max-memory argsNicholas Wilson2018-03-143-2/+62
| | | | | | | | | Previously, Config->InitialMemory/MaxMemory were hooked up to some commandline args but had no effect at all. Differential Revision: https://reviews.llvm.org/D44393 llvm-svn: 327508
* [WebAssembly] Replace varargs debugPrint with standard log callNicholas Wilson2018-03-141-19/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D44441 llvm-svn: 327507
* Fix build broken by llvm r327486Pavel Labath2018-03-141-1/+1
| | | | | | llvm::DWARFFormParams moved to llvm::dwarf::FormParams. llvm-svn: 327489
* [ELF] - Never create .gnu_hash with NBuckets == 0.George Rimar2018-03-144-12/+16
| | | | | | | | | | | | Currently, we can end up with NBuckets==0 and android loader does not like it (PR36537). Seems we can go with a minimal amount of changes here for simplicity and be consistent with gold and so just always use >= 1 value for NBuckets. Differential revision: https://reviews.llvm.org/D44422 llvm-svn: 327481
OpenPOWER on IntegriCloud