- Dec 09, 2015
-
-
George Rimar authored
Implement the TLS relocation optimization for 32-bit x86 that is described in "ELF Handling For Thread-Local Storage" by Ulrich Drepper, chapter 5, "IA-32 Linker Optimizations". Specifically, this patch implements these optimizations: LD->LE, GD->IE, GD->LD, and IE->LE. Differential revision: http://reviews.llvm.org/D15292 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@255103 91177308-0d34-0410-b5e6-96231b3b80d8
-
Pete Cooper authored
The gcc_except_tab was generating these references to point to the typeinfo in the data section. gcc_except_tab also had the DW_EH_PE_indirect flag set which means that at runtime we are going to dereference this entry as if it is in the GOT. Reviewed by Nick Kledzik in http://reviews.llvm.org/D15360. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@255085 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 08, 2015
-
-
Rui Ueyama authored
MSVC linker considers PDB files created with this patch valid. So you don't have to remove PDB files created by lld before running MSVC linker. This patch has no test since llvm-pdbdump dislikes PDB files with no metadata streams. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@255039 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 07, 2015
-
-
George Rimar authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254918 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
(per discussion with Michael Spencer) git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254896 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 05, 2015
-
-
Igor Kudrin authored
All relocations, which cannot be handled by the dynamic linker, cause a linking error "rebuild with -fPIC". Differential revision: http://reviews.llvm.org/D15193 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254840 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 04, 2015
-
-
Rui Ueyama authored
Before this patch, we created an empty PDB file if /debug option is specified. For MSVC linker, such PDB file is completely broken, and linker exits without doing anything as soon as it finds an empty PDB file. A PDB file created in this patch has the correct file signature. MSVC linker still thinks that the file is broken, but it then removes and replaces with its output. This is an initial patch to support PDB in LLD. We aim to support PDB in order to make it 100% compatible with MSVC linker. PDB support is the last missing piece. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254796 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rafael Espindola authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254725 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
"Ulrich Drepper, ELF Handling For Thread-Local Storage" (5.5 x86-x64 linker optimizations, http://www.akkadia.org/drepper/tls.pdf) shows how GD can be optimized to IE. This patch implements the optimization. Differential revision: http://reviews.llvm.org/D15000 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254713 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rafael Espindola authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254697 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 03, 2015
-
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254649 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254648 91177308-0d34-0410-b5e6-96231b3b80d8
-
Igor Kudrin authored
Generate R_AARCH64_COPY relocations for non-GOT relocations, which reference object symbols from shared libraries. Differential revision: http://reviews.llvm.org/D15043 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254591 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
If a section symbol is not external, that COMDAT section should never be merge with other sections in other compilation unit. Previously, we didn't take visibility into account. Note that COMDAT sections with non-external visibility makes sense because they can be removed by dead-stripping. Fixes https://llvm.org/bugs/show_bug.cgi?id=25686 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254578 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 02, 2015
-
-
George Rimar authored
Main aim of the patch to introduce basic support for TLS access models for x86 target. Models using @tlsgd, @tlsldm and @gotntpoff are implemented. Differential revision: http://reviews.llvm.org/D15060 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254500 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 01, 2015
-
-
Simon Atanasyan authored
Some MIPS relocations including `R_MIPS_HI16/R_MIPS_LO16` use combined addends. Such addend is calculated using addends of both paired relocations. Each `R_MIPS_HI16` relocation is paired with the next `R_MIPS_LO16` relocation. ABI requires to compute such combined addend in case of REL relocation record format only. For details see p. 4-17 at ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf This patch implements lookup of the next paired relocation suing new `InputSectionBase::findPairedRelocLocation` method. The primary disadvantage of this approach is that we put MIPS specific logic into the common code. The next disadvantage is that we lookup `R_MIPS_LO16` for each `R_MIPS_HI16` relocation, while in fact multiple `R_MIPS_HI16` might be paired with the single `R_MIPS_LO16`. From the other side this way allows us to keep `MipsTargetInfo` class stateless and implement later relocation handling in parallel. This patch does not support `R_MIPS_HI16/R_MIPS_LO16` relocations against `_gp_disp` symbol. In that case the relocations use a special formula for the calculation. That will be implemented later. Differential Revision: http://reviews.llvm.org/D15112 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254461 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
[ELF] - Fixed bug leading to miss of tls relocation when @tlsgd and @gottpoff relocations were used at the same time. Combination of @tlsgd and @gottpoff at the same time leads to miss of R_X86_64_TPOFF64 dynamic relocation. Patch fixes that. @tlsgd(%rip) - Allocate two contiguous entries in the GOT to hold a tls index structure (for passing to tls get addr). @gottpoff(%rip) - Allocate one GOT entry to hold a variable offset in initial TLS block (relative to TLS block end, %fs:0). The same situation can be observed for x86 (probably others too, not sure) with corresponding for that target relocations: @tlsgd, @gotntpoff. Differential revision: http://reviews.llvm.org/D15105 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254443 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Fix was: uint32_t getLocalTlsIndexVA() { return getVA() + LocalTlsIndexOff; } => uint32_t getLocalTlsIndexVA() { return Base::getVA() + LocalTlsIndexOff; } Both works for my MSVS. Original commit message: [ELF] - Refactor of tls_index implementation for tls local dynamic model. Patch contains the next 2 changes: 1) static variable Out<ELFT>::LocalModuleTlsIndexOffset moved to Out<ELFT>::Got. At fact there is no meaning for it to be separated from GOT class because at each place of using it anyways needs to call GOT`s getVA(). Also it is impossible to have that offset and not have GOT. 2) addLocalModuleTlsIndex -> addLocalModelTlsIndex (word "Module" changed to "Model"). Not sure was it a mistype or not but I think that update is closer to Urlich terminology. Differential revision: http://reviews.llvm.org/D15113 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254433 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
It failed buildbot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/3782/steps/build/logs/stdio Target.cpp In file included from /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/ELF/Target.cpp:20: /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/ELF/OutputSections.h:136:42: error: use of undeclared identifier 'getVA' uint32_t getLocalTlsIndexVA() { return getVA() + LocalTlsIndexOff; } git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254432 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Removes Target::getGotRefReloc() method to simplify Target class a little. Differential revision: http://reviews.llvm.org/D15107 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254429 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Patch contains the next 2 changes: 1) static variable Out<ELFT>::LocalModuleTlsIndexOffset moved to Out<ELFT>::Got. At fact there is no meaning for it to be separated from GOT class because at each place of using it anyways needs to call GOT`s getVA(). Also it is impossible to have that offset and not have GOT. 2) addLocalModuleTlsIndex -> addLocalModelTlsIndex (word "Module" changed to "Model"). Not sure was it a mistype or not but I think that update is closer to Urlich terminology. Differential revision: http://reviews.llvm.org/D15113 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254428 91177308-0d34-0410-b5e6-96231b3b80d8
-
Igor Kudrin authored
Differential revision: http://reviews.llvm.org/D15045 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254393 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 30, 2015
-
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254345 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
In other places, we don't have the comment. Absence of check{Int,UInt} is the sign that no overflow check is needed. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254326 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Splitted writeTo to separate tls relocs handling stuff which is too long for one method now. NFC. Differential revision: http://reviews.llvm.org/D15012 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254309 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 29, 2015
-
-
George Rimar authored
Incorrect template specialization was used (generic ELFT type was expected but platform specific was used). git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254253 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 26, 2015
-
-
Simon Atanasyan authored
If an argument of the INPUT directive is a regular path, linker should lookup it in the current folder first. The fix does not contain any test cases because I think it is not a good idea to pollute a current folder (which in general might be arbitrary) by test files. Differential Revision: http://reviews.llvm.org/D15027 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254178 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254175 91177308-0d34-0410-b5e6-96231b3b80d8
-
Igor Kudrin authored
ABI specifies the allowed range for these relocations as 2^(n-1) <= X < 2^n. The patch fixes checks and introduces precise tests for these relocations. Differential revision: http://reviews.llvm.org/D14957 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254146 91177308-0d34-0410-b5e6-96231b3b80d8
-
Igor Kudrin authored
It helps to standardize common checks and unify error messages. Differential revision: http://reviews.llvm.org/D14943 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254144 91177308-0d34-0410-b5e6-96231b3b80d8
-
Simon Atanasyan authored
In case a sysroot prefix is configured, and the filename starts with the '/' character, and the script being processed was located inside the sysroot prefix, the file's name will be looked for in the sysroot prefix. Otherwise, the linker falls to the common lookup scheme. It is slightly modified version of the commit r254031. The problem of the initial commit was in the `is_absolute` call. On Windows 'C:\' is absolute path but we do not need to find it under sysroot. In this patch linker looks up a path under sysroot only if the paths starts with '/' character. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254135 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 25, 2015
-
-
Hal Finkel authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254111 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Fix is (OutputSections.cpp): for (std::pair<const SymbolBody *, size_t> &I : Entries) { => for (std::pair<const SymbolBody *, unsigned> &I : Entries) { git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254105 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/3555 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254103 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Implements @tlsld (LD to LE) and @tlsgd (GD to LE) optimizations. Patch does not implement the GD->IE case for @tlsgd. Differential revision: http://reviews.llvm.org/D14870 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254101 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Patch implements lazy relocations for x86. One of features of x86 is that executable files and shared object files have separate procedure linkage tables. So patch implements both cases. Detailed information about instructions used can be found in http://docs.oracle.com/cd/E19620-01/805-3050/chapter6-1235/index.html (search: x86: Procedure Linkage Table). Differential revision: http://reviews.llvm.org/D14955 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254098 91177308-0d34-0410-b5e6-96231b3b80d8
-
Simon Atanasyan authored
R_MIPS_CALL16 relocation provides the same result as R_MIPS_GOT16 relocation but does not need to check the result on overflow. Differential Revision: http://reviews.llvm.org/D14916 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254092 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
This patch implements next relocations: R_386_TLS_LE - Negative offset relative to static TLS (GNU version). R_386_TLS_LE_32 - Offset relative to static TLS block. These ones are created when using next code sequences: * @tpoff - The operator must be used to compute an immediate value. The linker will report an error if the referenced variable is not defined or it is not code for the executable itself. No GOT entry is created in this case. * @ntpoff Calculate the negative offset of the variable it is added to relative to the static TLS block. The operator must be used to compute an immediate value. The linker will report an error if the referenced variable is not defined or it is not code for the executable itself. No GOT entry is created in this case. Information was found in Ulrich Drepper, ELF Handling For Thread-Local Storage, http://www.akkadia.org/drepper/tls.pdf, (6.2, p76) Differential revision: http://reviews.llvm.org/D14930 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254090 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
https://docs.oracle.com/cd/E19683-01/817-3677/chapter6-26/index.html says: R_386_GOTPC Resembles R_386_PC32, except that it uses the address of the global offset table in its calculation. The symbol referenced in this relocation normally is _GLOBAL_OFFSET_TABLE_, which also instructs the link-editor to create the global offset table. Currently _GLOBAL_OFFSET_TABLE_ has value == zero. And we use GOT address to calculate the relocation. This patch does not changes that. It just removes the method which is used only for x86. So it is close to non functional change. Differential revision: http://reviews.llvm.org/D14993 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254088 91177308-0d34-0410-b5e6-96231b3b80d8
-
George Rimar authored
Implements R_386_COPY relocation for x86 target. Similar to one for x64 http://reviews.llvm.org/D14090 which did most of job needed. Differential revision: http://reviews.llvm.org/D14958 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@254065 91177308-0d34-0410-b5e6-96231b3b80d8
-