- Jul 04, 2017
-
-
Simon Atanasyan authored
llvm-svn: 307083
-
Rafael Espindola authored
We now don't produce "has undefined version" errors when producing binaries even when there is a linker script. llvm-svn: 307082
-
George Rimar authored
This is PR28414. Previously LLD was unable to link following: (failed with undefined symbol bar) Version script: SOME_VERSION { global: *; }; .global _start .global bar .symver _start, bar@@SOME_VERSION _start: jmp bar Manual has next description: .symver name, name2@@nodename In this case, the symbol name must exist and be defined within the file being assembled. It is similar to name2@nodename. The difference is name2@@nodename will also be used to resolve references to name2 by the linker https://sourceware.org/binutils/docs/as/Symver.html Patch implements that. If we have name@@ver symbol and name is undefined, name@@ver is used to resolve references to name. If name is defined then multiple definition error is emited, that is consistent with what bfd do. Differential revision: https://reviews.llvm.org/D33680 llvm-svn: 307077
-
George Rimar authored
Two more places. llvm-svn: 307076
-
- Jul 03, 2017
-
-
Rafael Espindola authored
llvm-svn: 307044
-
Rafael Espindola authored
Now removeUnusedSyntheticSections operates entirely on the linker script. llvm-svn: 307043
-
Rafael Espindola authored
llvm-svn: 307041
-
George Rimar authored
* Return type changed to void, because it was unused. * std::find_if -> llvm::find_if llvm-svn: 307039
-
Petr Hosek authored
Script commands are processed before unused synthetic sections are removed. Therefore, if a linker script matches one of these sections it'll get emitted as an empty output section because the logic for removing unused synthetic sections ignores script commands which could have already matched and captured one of these sections. This patch fixes that by also removing the unused synthetic sections from the script commands. Differential Revision: https://reviews.llvm.org/D34800 llvm-svn: 307037
-
George Rimar authored
Since yaml2obj is now able to parse integer values as relocation types, there is no need to keep hex edited elf object for this test, we can produce it on fly, just like this patch do. Differential revision: https://reviews.llvm.org/D34893 llvm-svn: 307032
-
Andrew Ng authored
This patch makes changes to allow sections without the SHF_ALLOC bit to be assigned to segments in a linker script. The assignment of output sections to segments is performed in LinkerScript::createPhdrs. Previously, this function would bail as soon as it encountered an output section which did not have the SHF_ALLOC bit set, thus preventing any output section without SHF_ALLOC from being assigned to a segment. This restriction has now been removed from LinkerScript::createPhdrs and instead a check for SHF_ALLOC has been added to LinkerScript::adjustSectionsAfterSorting to not propagate program headers to sections without SHF_ALLOC which matches the behaviour of bfd linker scripts. Differential Revision: https://reviews.llvm.org/D34204 llvm-svn: 307013
-
Rui Ueyama authored
This reverts commit r306813 because it broke linking of the FreeBSD base system. llvm-svn: 306996
-
- Jul 01, 2017
-
-
Martin Storsjö authored
A plain empty entry point function that returns 0 seems to produce a binary that loads and runs fine in wine. Differential Revision: https://reviews.llvm.org/D34833 llvm-svn: 306963
-
Eric Beckmann authored
Summary: This reverts commit 51931072a7c9a52540baf76fc30ef391d2529a2f. This revert was originally done because the integrations of the new WindowsResource library into LLD was causing error in chromium, due to bugs in how resource sections were handled. These bugs were fixed, meaning that the features may be reintegrated. Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34922 llvm-svn: 306941
-
- Jun 30, 2017
-
-
Zachary Turner authored
Type records have a unique type index, but symbol records do not. Instead, symbol records refer to other symbol records by referencing their offset in the symbol stream. In a sense this is the analogue of the TypeIndex, but we are not printing it in the dumper. Printing it not only gives us more useful information when manually investigating the contents of a PDB, but also allows us to write better tests by enabling us to verify that fields that reference other symbol records do so correctly. Differential Revision: https://reviews.llvm.org/D34906 llvm-svn: 306890
-
Richard Smith authored
This is a short-term fix for PR33650 aimed to get the modules build bots green again. Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR macros to try to locally specialize a global template for a global type. That's not how C++ works. Instead, we now centrally define how to format vectors of fundamental types and of string (std::string and StringRef). We use flow formatting for the former cases, since that's the obvious right thing to do; in the latter case, it's less clear what the right choice is, but flow formatting is really bad for some cases (due to very long strings), so we pick block formatting. (Many of the cases that were using flow formatting for strings are improved by this change.) Other than the flow -> block formatting change for some vectors of strings, this should result in no functionality change. Differential Revision: https://reviews.llvm.org/D34907 Corresponding LLVM change is r306878. llvm-svn: 306880
-
Eric Beckmann authored
Summary: There have been bugs with the WindowsResource library, such as incorrect symbols for addresses. Directly checking the .rsrc in the final PE will help ensure this doesn't happen again. Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34900 llvm-svn: 306854
-
George Rimar authored
This is PR28414. Previously LLD was unable to link following: (failed with undefined symbol bar) ``` Version script: SOME_VERSION { global: *; }; .global _start .global bar .symver _start, bar@@SOME_VERSION _start: jmp bar ``` Manual has next description: // .symver name, name2@@nodename In this case, the symbol name must exist and be defined within the file being assembled. It is similar to name2@nodename. **The difference is name2@@nodename will also be used to resolve references to name2 by the linker** https://sourceware.org/binutils/docs/as/Symver.html // Patch implements that. If we have name@@ver symbol and name is undefined, name@@ver is used to resolve references to name. Differential revision: https://reviews.llvm.org/D33680 llvm-svn: 306813
-
Martin Storsjö authored
llvm-svn: 306796
-
Sam Clegg authored
Differential Revision: https://reviews.llvm.org/D34852 llvm-svn: 306772
-
- Jun 29, 2017
-
-
Paul Robinson authored
llvm-svn: 306700
-
Eric Beckmann authored
This reverts commit d4c7e9fc63c10dbab0c30186ef8575474a704496. This is done in order to address the failure of CrWinClangLLD etc. bots. These throw an error of "side-by-side configuration is incorrect" during compilation, which sounds suspiciously related to these manifest changes. Revert "Switch external cvtres.exe for llvm's own resource library." This reverts commit 71fe8ef283a9dab9a3f21432c98466cbc23990d1. llvm-svn: 306618
-
Rafael Espindola authored
Now that _GLOBAL_OFFSET_TABLE_ is defined, we can just use R_PC for it if needed. llvm-svn: 306614
-
Rafael Espindola authored
llvm-svn: 306609
-
- Jun 28, 2017
-
-
Rui Ueyama authored
We could have add this function either Symbol or SymbolBody. I added it to Symbol at first. But I noticed that if I've added it to SymbolBody, we could've removed SymbolBody::setName(). So I'll do that in this patch. llvm-svn: 306590
-
Rui Ueyama authored
This patch adds a utility function to Symbol. This function should be useful in https://reviews.llvm.org/D33680 too. llvm-svn: 306587
-
Reid Kleckner authored
Summary: In order to do this without switching on the symbol kind multiple times, I created Defined::getChunkAndOffset and use that instead of SymbolBody::getRVA in the inner relocation loop. Now we get the symbol's chunk before switching over relocation types, so we can test if it has been discarded outside the inner relocation type switch. This also simplifies application of section relative relocations. Previously we would switch on symbol kind to compute the RVA, then the relocation type, and then the symbol kind again to get the output section so we could subtract that from the symbol RVA. Now we *always* have an OutputSection, so applying SECREL and SECTION relocations isn't as much of a special case. I'm still not quite happy with the cleanliness of this code. I'm not sure what offsets and bases we should be using during the relocation processing loop: VA, RVA, or OutputSectionOffset. Reviewers: ruiu, pcc Reviewed By: ruiu Subscribers: majnemer, inglorion, llvm-commits, aprantl Differential Revision: https://reviews.llvm.org/D34650 llvm-svn: 306566
-
Rui Ueyama authored
Add support for the most common SPARC relocations. Make DT_PLTGOT point to the PLT on SPARC. Mark the PLT as executable on SPARC. This adds a basic test that creates a SPARV9 executable that invokes the exit system call on OpenBSD. Patch by Mark Kettenis. Differential Revision: https://reviews.llvm.org/D34618 llvm-svn: 306565
-
George Rimar authored
This is PR33596. Previously LLD would crash because BYTE command synthesized output section, but it was not assigned to Sec member of OutputSectionCommand. Behaviour of -script and -r combination is not well defined, but it seems after this change LLD naturally inherits behavior of GNU linkers - creates output section requested in script and does not crash anymore. Differential revision: https://reviews.llvm.org/D34676 llvm-svn: 306527
-
George Rimar authored
This fixes PR33598. Size field for undefined symbols is not significant. Setting it to fixed value, like zero, may be useful though. For example when we have 2 DSO's, like in this PR, if lower level DSO may change slightly (in part of some symbol's st_size) and higher-level DSO is rebuilt, then tools that monitoring checksum of high level DSO file can notice it and trigger cascade of some other unnecessary actions. If we set st_size to zero, that can be avoided. Differential revision: https://reviews.llvm.org/D34673 llvm-svn: 306526
-
Peter Smith authored
When -ffunction-sections and ARM C++ exceptions are used each .text.suffix section will have at least one .ARM.exidx.suffix section and may have an additional .ARM.extab.suffix section if the unwinding instructions are too large to inline into the .ARM.exidx table entry. For a large program without a linker script this can lead to a large number of section header table entries that can increase the size of the ELF file. This change introduces a default rule for .ARM.extab.* to be placed in a single output section called .ARM.extab . This follows the behavior of ld.gold and ld.bfd. fixes pr33407 Differential Revision: https://reviews.llvm.org/D34678 llvm-svn: 306522
-
Rafael Espindola authored
It is somewhat pointless to check that a specific error is not produced. That is already checked by the ld.lld exit value. Instead make the test a bit stronger by checking that the output file has the expected symbol and section. llvm-svn: 306496
-
- Jun 27, 2017
-
-
Eric Beckmann authored
Summary: The testing on the resource section of executables produced by lld has been very lax, and allowed a major bug to go unnoticed when we switched from shelling out to cvtres.exe to using llvm's own library. These additional tests should cover all the major failure points. Reviewers: zturner, ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34664 llvm-svn: 306465
-
Ed Maste authored
From Mark Kettenis in review D34618. llvm-svn: 306403
-
- Jun 26, 2017
-
-
Rui Ueyama authored
llvm-svn: 306323
-
Rui Ueyama authored
This patch fills holes in executable sections with 0xd4 (ARM) or 0xef (MIPS). These trap instructions were suggested by Theo de Raadt. llvm-svn: 306322
-
Paul Robinson authored
llvm-svn: 306316
-
Eric Beckmann authored
This patch removes the dependency on the external rc.exe tool by writing a simple .res file using our own library. In this patch I also added an explicit definition for the .res file magic. Furthermore, I added a unittest for embeded manifests and fixed a bug exposed by the test. llvm-svn: 306311
-
Rui Ueyama authored
llvm-svn: 306308
-
Rui Ueyama authored
`addInputSec` returns void. Even though it is syntactically correct, the use of `return` here is just confusing. llvm-svn: 306307
-