- Nov 23, 2016
-
-
Rui Ueyama authored
They are essentially the same in this context, so I prefer the one that doesn't need `Twine::`. llvm-svn: 287814
-
Rui Ueyama authored
We have different functions to stringize objects to construct error messages. For InputFile, we have getFilename, and for InputSection, we have getName. You had to memorize them. I think this is the case where the function overloading comes in handy. This patch defines toString() functions that are overloaded for all these types, so that you just call it in error(). Differential Revision: https://reviews.llvm.org/D27030 llvm-svn: 287787
-
Rui Ueyama authored
Previously, we stored offsets in string tables to symbols, so you needed to pass a string table to get a symbol name. This patch stores const char pointers instead to eliminate the need to pass a string table. llvm-svn: 287737
-
- Nov 21, 2016
-
-
Rui Ueyama authored
LLD's error messages contain line numbers, function names or section names. Currently they are formatter as follows. foo.c (32): symbol 'foo' not found foo.c (function bar): symbol 'foo' not found foo.c (.text+0x1234): symbol 'foo' not found This patch changes them so that they are consistent with Clang's output. foo.c:32: symbol 'foo' not found foo.c:(function bar): symbol 'foo' not found foo.c:(.text+0x1234): symbol 'foo' not found Differential Revision: https://reviews.llvm.org/D26901 llvm-svn: 287537
-
- Nov 18, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26842 llvm-svn: 287346
-
- Nov 16, 2016
-
-
Simon Atanasyan authored
MIPS GOT handling is very different from other targets so it is better to keep the code in the separatre section class MipsGotSection. This patch introduces the new section and moves all MIPS specific code from GotSection to the new class. I did not rename fields and methods in the MipsGotSection class to reduce the diff and plan to do that by the separate commit. Differential revision: https://reviews.llvm.org/D26733 llvm-svn: 287150
-
George Rimar authored
Forgot about that, I am sorry. llvm-svn: 287123
-
George Rimar authored
Particulaty "cannot preempt symbol" message is extended with locations now. Differential revision: https://reviews.llvm.org/D26738 llvm-svn: 287120
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26669 llvm-svn: 287092
-
George Rimar authored
Patch improves message to show locations for "can't create dynamic relocation" error. Differential revision: https://reviews.llvm.org/D26548 llvm-svn: 287086
-
- Nov 15, 2016
-
-
George Rimar authored
Patch adds a filename to that error message. I faced next error when debugged one of FreeBSD port: error: relocation R_X86_64_PLT32 cannot refer to absolute symbol __tls_get_addr error message was poor and this patch improves it to show the locations of symbol declaration and using. Differential revision: https://reviews.llvm.org/D26508 llvm-svn: 286940
-
Vitaly Buka authored
Summary: getFile() can return nullptr. This usually happens when Rels is empty so the reference is never used. Still UBSAN complains. Reviewers: rafael Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26662 llvm-svn: 286937
-
- Nov 11, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26498 llvm-svn: 286580
-
- Nov 10, 2016
-
-
Rafael Espindola authored
Relocations are the last thing that we wore storing a raw section pointer to and parsing on demand. With this patch we parse it only once and store a pointer to the actual data. The patch also changes where we store it. It is now in InputSectionBase. Not all sections have relocations, but most do and this simplifies the logic. It also means that we now only support one relocation section per section. Given that that constraint is maintained even with -r with gold bfd and lld, I think it is OK. llvm-svn: 286459
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26349 llvm-svn: 286443
-
George Rimar authored
Patch allows to pass a symbols file to linker. LLD will map symbols to sections and sort sections in output according to symbol ordering file. That can help to reduce the startup time and/or amount of pagefaults during startup. Also, interesting benchmark result was produced by Rafael Espíndola. After applying the symbols file for clang he timed compiling X86MCTargetDesc.ii to an object file. The page faults went from just 56,988 to 56,946 since most faults are not in the binary. Running time went from 4.403053515 to 4.178112244. The speedup seems to be because of better cache locality. Differential revision: https://reviews.llvm.org/D26130 llvm-svn: 286440
-
- Nov 09, 2016
-
-
Simon Atanasyan authored
Previously, we have both input and output sections for .reginfo and .MIPS.options. Now for each such sections we have one synthetic input sections: MipsReginfoSection and MipsOptionsSection respectively. Both sections are handled as regular sections until the control reaches Writer. Writer then aggregates all sections whose type is SHT_MIPS_REGINFO or SHT_MIPS_OPTIONS to create a single synthesized input section. In that moment Writer also save GP0 value to the MipsGp0 field of the corresponding ObjectFile. This value required for R_MIPS_GPREL16 and R_MIPS_GPREL32 relocations calculation. Differential revision: https://reviews.llvm.org/D26444 llvm-svn: 286397
-
Rafael Espindola authored
This is similar to what was done for InputSection. With this the various fields are stored in host order and only converted to target order when writing. llvm-svn: 286327
-
- Nov 08, 2016
-
-
Rui Ueyama authored
All tests pass without the first parameter, so I guess we don't need it. Differential Revision: https://reviews.llvm.org/D26411 llvm-svn: 286287
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26397 llvm-svn: 286244
-
- Nov 05, 2016
-
-
Simon Atanasyan authored
In short the patch introduces support for linking object file conform MIPS N32 ABI [1]. This ABI is similar to N64 ABI but uses 32-bit pointer size. The most non-trivial requirement of this ABI is one more relocation packing format. N64 ABI puts multiple relocation type into the single relocation record. The N32 ABI uses series of successive relocations with the same offset for this purpose. In this patch, new function `mergeMipsN32RelTypes` handle this case and "convert" N32 relocation to the N64 relocation so the rest of the code keep unchanged. For now, linker does not support series of relocations applied to sections without SHF_ALLOC bit. Probably later I will add the support or insert some sort of assert into the `relocateNonAlloc` routine to catch this case. [1] ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf Differential revision: https://reviews.llvm.org/D26298 llvm-svn: 286052
-
- Nov 03, 2016
-
-
Rafael Espindola authored
llvm-svn: 285966
-
Rafael Espindola authored
This avoids duplicating the buffer in InputFile. llvm-svn: 285965
-
Rafael Espindola authored
llvm-svn: 285956
-
- Nov 02, 2016
-
-
Rui Ueyama authored
DIHelper is a class having only one member, and ObjectFile has a unique pointer to a DIHelper. So we can directly have ObjectFile have the member. Differential Revision: https://reviews.llvm.org/D26223 llvm-svn: 285850
-
- Nov 01, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26070 llvm-svn: 285680
-
- Oct 27, 2016
-
-
Rafael Espindola authored
This fixes pr30803 by not relaxing that particular access. We could also let adjustRelaxExpr know that the target is absolute so that it uses R_RELAX_GOT_PC_NOPIC, but it is not clear if it is worth it. llvm-svn: 285317
-
- Oct 26, 2016
-
-
Rui Ueyama authored
llvm-svn: 285236
-
Rui Ueyama authored
llvm-svn: 285235
-
Rui Ueyama authored
llvm-svn: 285219
-
Rafael Espindola authored
llvm-svn: 285190
-
Eugene Leviant authored
This patch make lld show following details for undefined symbol errors: - file (line) - file (function name) - file (section name + offset) Differential revision: https://reviews.llvm.org/D25826 llvm-svn: 285186
-
- Oct 25, 2016
-
-
Rafael Espindola authored
We were fairly inconsistent as to what information should be accessed with getSectionHdr and what information (like alignment) was stored elsewhere. Now all section info has a dedicated getter. The code is also a bit more compact. llvm-svn: 285079
-
- Oct 21, 2016
-
-
Simon Atanasyan authored
Some MIPS relocations used to access GOT entries are able to manipulate 16-bit index. The other ones like R_MIPS_CALL_HI16/LO16 can handle 32-bit indexes. 16-bit relocations are generated by default. The 32-bit relocations are generated by -mxgot flag passed to compiler. Usually these relocation are not mixed in the same code but files like crt*.o contain 16-bit relocations so even if all "user's" code compiled with -mxgot flag a few 16-bit relocations might come to the linking phase. Now LLD does not differentiate local GOT entries accessed via a 16-bit and 32-bit indexes. That might lead to relocation's overflow if 16-bit entries are allocated to far from the beginning of the GOT. The patch introduces new "part" of MIPS GOT dedicated to the local GOT entries accessed by 32-bit relocations. That allows to put local GOT entries accessed via a 16-bit index first and escape relocation's overflow. Differential revision: https://reviews.llvm.org/D25833 llvm-svn: 284809
-
- Oct 20, 2016
-
-
Rafael Espindola authored
We allocate a lot of these when linking debug info. This speeds up the link of debug programs by 1% to 2%. llvm-svn: 284716
-
Peter Smith authored
The R_ARM_PREL31 and R_ARM_NONE relocations should not be faulted in shared libraries. In the case of R_ARM_NONE, we have moved the TLS relaxation hint instruction to R_TLSDESC_CALL so that R_HINT can be used without side-effects. In the case of R_ARM_PREL31 we permit it to be used against PLT entries as the personality routines are imported when used in shared libraries. Differential Revision: https://reviews.llvm.org/D25721 llvm-svn: 284710
-
George Rimar authored
llvm-svn: 284705
-
- Oct 06, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D25240 llvm-svn: 283431
-
- Sep 29, 2016
-
-
Rui Ueyama authored
It's better because it's a verb. llvm-svn: 282763
-
- Sep 23, 2016
-
-
Peter Smith authored
The ARM TLS relocations are placed on literal data and not the code-sequence, it is therefore not possible to implement the relaxTls* functions. This change updates handleMipsTlsRelocation() to handleNoRelaxTlsRelocation() and incorporates ARM as well as Mips. The ARM support in handleNoRelaxTlsRelocation() currently needs to ouput the module index dynamic relocation in all cases as it is relying on the dynamic linker to set the module index in the got. Should address PR30218 Differential Revision: https://reviews.llvm.org/D24827 llvm-svn: 282250
-