- Aug 29, 2017
-
-
George Rimar authored
This is PR32429. We did not mention -fPIC in error about producing dynamic relocation in readonly segment before. Patch changes that. Differential revision: https://reviews.llvm.org/D36874 llvm-svn: 312003
-
Rui Ueyama authored
Looks like there's no need to use a higher order function. We can simply use the regular for-loop. llvm-svn: 311942
-
- Aug 28, 2017
-
-
Rui Ueyama authored
Various classes have `Symtab` member variables even though we have lld::coff::Symtab variable because previous attempts to make COFF lld's internal structure resemble to ELF's was incomplete. This patch finishes that job by removing member variables. llvm-svn: 311938
-
Rui Ueyama authored
Summary: ArgParser created an instance of COFFOptTable on stack to use it to parser command line arguments. Parsed arguments were then returned from the function as InputArgList. This was safe because InputArgList referred only statically-allocated InfoTable. That is not a safe assumption after https://reviews.llvm.org/D36782, which changes the type of its internal table from ArrayRef to std::vector. To make lld work with that patch, we need to keep an instance of COFFOptTable at least as long as an InputArgList is alive. This patch does that. Reviewers: yamaguchi Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37217 llvm-svn: 311930
-
Simon Atanasyan authored
llvm-svn: 311889
-
George Rimar authored
llvm-svn: 311878
-
- Aug 25, 2017
-
-
Rui Ueyama authored
Patch by Patricio Villalobos. I discovered that lld for darwin is generating the wrong code for lazy bindings in the __stub_helper section (at least for osx 10.12). This is the way i can reproduce this problem, using this program: #include <stdio.h> int main(int argc, char **argv) { printf("C: printf!\n"); puts("C: puts!\n"); return 0; } Then I link it using i have tested it in 3.9, 4.0 and 4.1 versions: $ clang -c hello.c $ lld -flavor darwin hello.o -o h1 -lc When i execute the binary h1 the system gives me the following error: C: printf! dyld: lazy symbol binding failed: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 4 which is too large (0..3) dyld: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 4 which is too large (0..3) Trace/BPT trap: 5 Investigating the code, it seems that the problem is that the asm code generated in the file StubPass.cpp, specifically in the line 323,when it adds, what it seems an arbitrary number (12) to the offset into the lazy bind opcodes section, but it should be calculated depending on the MachONormalizedFileBinaryWrite::lazyBindingInfo result. I confirmed this bug by patching the code manually in the binary and writing the right offset in the asm code (__stub_helper). This patch fixes the content of the atom that contains the assembly code when the offset is known. Differential Revision: https://reviews.llvm.org/D35387 llvm-svn: 311734
-
Dmitry Mikulin authored
linker script SECTION rules. This patch extends it to use a fully specified file name as it appears in --trace output to match agains, i.e, "<path>/<objname>.o" or "<path>/<libname>.a(<objname>.o)". Differential Revision: https://reviews.llvm.org/D37031 llvm-svn: 311713
-
- Aug 24, 2017
-
-
Simon Atanasyan authored
llvm-svn: 311712
-
Simon Atanasyan authored
Currently LLD reads the R_MIPS_HI16's addends in the `computeMipsAddend` function, the R_MIPS_LO16's addends in both `computeMipsAddend` and `getImplicitAddend` functions. This patch moves reading all addends to the `getImplicitAddend` function. As a side effect it fixes a "paired" HI16/LO16 addend calculation if "LO16" part of a pair is not found. llvm-svn: 311711
-
Simon Atanasyan authored
llvm-svn: 311710
-
Rui Ueyama authored
llvm-svn: 311700
-
Rui Ueyama authored
llvm-svn: 311696
-
Rui Ueyama authored
Fixes https://bugs.llvm.org/show_bug.cgi?id=34311 llvm-svn: 311682
-
Rui Ueyama authored
Before this patch, lld printed out something like error: -O: number expected, but got After this patch, it prints out the same error message like this: error: -O: number expected, but got '' Fixes https://bugs.llvm.org/show_bug.cgi?id=34311 llvm-svn: 311681
-
- Aug 23, 2017
-
-
Sam Clegg authored
Also remove unused include of raw_ostream.h Differential Revision: https://reviews.llvm.org/D37048 llvm-svn: 311587
-
Petr Hosek authored
Currently, LLD checks whether there's enough space for headers by checking if headers fit below the address of the first allocated section. However, that's always thue if the binary doesn't start at zero which means that LLD always emits a segment for headers, even if no other sections belong to that segment. This is a problem in cases when linker script is being used with a non-zero start address when we don't want to make the headers visible by not leaving enough space for them. This pattern is common in embedded programming but doesn't work in LLD. This patch changes the behavior of LLD in case when linker script is being to match the behavior of BFD ld and gold, which is to only place headers into a segment when they're covered by some output section. Differential Revision: https://reviews.llvm.org/D36256 llvm-svn: 311586
-
George Rimar authored
Previously up to 3 errors were reported at once, with patch we always will report only one, just like in other linker code. Differential revision: https://reviews.llvm.org/D37015 llvm-svn: 311537
-
George Rimar authored
It was broken from begining, because visibility attributes were not applied properly to symbols before this patch. Differential revision: https://reviews.llvm.org/D36966 llvm-svn: 311536
-
George Rimar authored
Code suggested by Rui Ueyama in PR34238 comments. Previously LTO optimized away symbols referenced from linker script because did not see that them are used from regular objects. Patch adds such symbols as undefined earlier, before running LTO, what sets IsUsedInRegularObj for them and fixes the issue. Differential revision: https://reviews.llvm.org/D37009 llvm-svn: 311534
-
Martell Malone authored
llvm-svn: 311518
-
- Aug 22, 2017
-
-
Rui Ueyama authored
This reverts commit r311468 because it broke some CFI bots. llvm-svn: 311497
-
Rui Ueyama authored
Patch by Rafael Espíndola. This is PR34053. The implementation is a bit of a hack, given the precise location where IsPreemtible is set, it cannot be used from SymbolTable::handleAnonymousVersion. I could add another method to SymbolTable if you think that would be better. Differential Revision: https://reviews.llvm.org/D36499 llvm-svn: 311468
-
George Rimar authored
llvm-svn: 311449
-
George Rimar authored
This is PR33097. Previously when doing relocatable link, all IR symbols were absent in result object file. Patch makes external symbols to be exported. Differential revision: https://reviews.llvm.org/D36957 llvm-svn: 311431
-
Chandler Carruth authored
a std::move() isn't needed here as the object is a temporary. llvm-svn: 311430
-
Eric Beckmann authored
Summary: Now that the llvm-mt manifest merging libraries are complete, we may use them to merge manifests instead of needing to shell out to mt.exe. Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D36255 llvm-svn: 311424
-
- Aug 21, 2017
-
-
Sam Elliott authored
Summary: This change depends on https://reviews.llvm.org/D36054 and should be landed at the same time. Reviewers: anemet Reviewed By: anemet Subscribers: llvm-commits, emaste Differential Revision: https://reviews.llvm.org/D36950 llvm-svn: 311348
-
Zachary Turner authored
This adds support for dumping a summary of module symbols and CodeView debug chunks. This option prints a table for each module of all of the symbols that occurred in the module and the number of times it occurred and total byte size. Then at the end it prints the totals for the entire file. Additionally, this patch adds the -jmc (just my code) option, which suppresses modules which are from external libraries or linker imports, so that you can focus only on the object files and libraries that originate from your own source code. llvm-svn: 311338
-
James Henderson authored
hexdump is not part of the GNU coreutils, and so is not required to be able to build and test LLVM, according to the documentation. This change removes the dependency on hexdump from a lit test. Reviewers: grimar Differential Revision: https://reviews.llvm.org/D36958 llvm-svn: 311335
-
George Rimar authored
With fix: explicitly specify ouput format for hexdump tool call. Original commit message: [ELF] - Do not forget to fill last bytes of PT_LOADs with trap instructions. Previously last 4 bytes of executable loads were not filled with trap instructions, patch fixes this bug. Differential revision: https://reviews.llvm.org/D36262 llvm-svn: 311315
-
George Rimar authored
[ELF] - Revert r311310 "[ELF] - Do not forget to fill last bytes of PT_LOADs with trap instructions." It broke BB: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/11792/steps/test_lld/logs/stdio llvm-svn: 311314
-
George Rimar authored
This is PR32942, previously threading was disabled because slowed down this testcase a lot. It was fixed in r311312. llvm-svn: 311313
-
George Rimar authored
[ELF] - Do not segfault when doing logical and/or operations on symbols that have no output sections. Previously we would crash on samples from testcase, because were trying to access zero pointer to output section. Differential revision: https://reviews.llvm.org/D36145 llvm-svn: 311311
-
George Rimar authored
Previously last 4 bytes of executable loads were not filled with trap instructions, patch fixes this bug. Differential revision: https://reviews.llvm.org/D36262 llvm-svn: 311310
-
- Aug 19, 2017
-
-
Rui Ueyama authored
I renamed corresponding classes in r309199 but forgot to rename enums at the moment. Rename them now to make them consistent. llvm-svn: 311214
-
- Aug 18, 2017
-
-
Ben Dunbobbin authored
Removed extraneous comment markers llvm-svn: 311169
-
- Aug 17, 2017
-
-
George Rimar authored
We would previously crash on next script: MEMORY { name : ORIGIN = .; } Patch fixes that. Differential revision: https://reviews.llvm.org/D36138 llvm-svn: 311073
-
Rui Ueyama authored
We had a lock to guard BAlloc from being used concurrently, but that is not very easy to understand. This patch replaces it with a std::unique_ptr. llvm-svn: 311056
-
- Aug 16, 2017
-
-
Davide Italiano authored
Also add a test. This fixes r310995 and PR34200. llvm-svn: 310998
-