- Jan 10, 2017
-
-
Peter Collingbourne authored
When reserving copy relocation space for a shared symbol, scan the DSO's program headers to see if the symbol is in a read-only segment. If so, reserve space for that symbol in a new synthetic section named .bss.rel.ro which will be covered by the relro program header. This fixes the security issue disclosed on the binutils mailing list at: https://sourceware.org/ml/libc-alpha/2016-12/msg00914.html Differential Revision: https://reviews.llvm.org/D28272 llvm-svn: 291524
-
- Jan 05, 2017
-
-
Rafael Espindola authored
llvm-svn: 291113
-
Rafael Espindola authored
llvm-svn: 291110
-
Rafael Espindola authored
After Mark's patch I was wondering what was the rationale for the ELF spec requiring us to merge only sections with matching flags and types. I tried emailing https://groups.google.com/forum/#!forum/generic-abi, but looks like my emails are not being posted (the list is probably moderated). I emailed Cary Coutant instead. Cary pointed out that the section was a late addition and didn't got the scrutiny it deserved. Given that and the problems found by implementing the letter of the standard, I propose changing lld to merge all sections with the same name and issue errors if the types or some critical flags are different. This should allow an unmodified firefox linked with lld to run. This also merges some code with the linkerscript path. llvm-svn: 291107
-
- Dec 20, 2016
-
-
Rui Ueyama authored
That variable was of type DenseMap<StringRef, unsigned>, but the unsigned numbers needed to be monotonicly increasing numbers because the implementation that used the variable depended on that fact. That was an implementation detail and shouldn't have leaked into Config. This patch simplifies its type to std::vector<StringRef>. llvm-svn: 290151
-
- Dec 19, 2016
-
-
Rafael Espindola authored
llvm-svn: 290115
-
- Nov 29, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D27097 llvm-svn: 288114
-
- Nov 26, 2016
-
-
Rui Ueyama authored
llvm-svn: 287977
-
- Nov 25, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D27098 llvm-svn: 287914
-
- Nov 22, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26958 llvm-svn: 287675
-
- Nov 21, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26918 llvm-svn: 287554
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26906 llvm-svn: 287549
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26854 llvm-svn: 287526
-
- Nov 18, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26842 llvm-svn: 287346
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26834 llvm-svn: 287326
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26792 llvm-svn: 287322
-
Rui Ueyama authored
MergeOutputSection class was a bit hard to use because it provdes a series of finalize functions that have to be called in a right way at a right time. It also intereacted with MergeInputSection, and the logic was somewhat entangled between the two classes. This patch simplifies it by providing only one finalize function. Now, all you have to do is to call MergeOutputSection::finalize when you have added all sections to the output section. Then, it internally merges strings and initliazes StringPiece objects. I think this is much easier to understand. This patch also adds comments. llvm-svn: 287314
-
- Nov 17, 2016
-
-
Eugene Leviant authored
llvm-svn: 287218
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26740 llvm-svn: 287216
-
- Nov 16, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26669 llvm-svn: 287092
-
- Nov 15, 2016
-
-
Eugene Leviant authored
This patch introduces the following changes: - DynamicSection now inherits InputSection<ELFT> and was moved to SyntheticSections.h/.cpp. - Link and Entsize fields of DynamicSection are propagated to its output section - In<ELFT>::SyntheticSections was removed. - Finalization of synthetic sections was removed from OutputSection<ELFT>::finalize. Now finalizeSyntheticSections is used instead. Differential revision: https://reviews.llvm.org/D26603 llvm-svn: 286950
-
- Nov 14, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26549 llvm-svn: 286799
-
- Nov 11, 2016
-
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D26498 llvm-svn: 286580
-
- Nov 10, 2016
-
-
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
-
Rafael Espindola authored
The disadvantage is that we use uint64_t instad of uint32_t for some value in 32 bit files. The advantage is a substantially simpler code, faster builds and less code duplication. llvm-svn: 286414
-
- Nov 09, 2016
-
-
Simon Atanasyan authored
Previously, we have both input and output section for .MIPS.abiflags. Now we have only one class for .MIPS.abiflags, which is MipsAbiFlagsSection. This class is a synthetic input section. .MIPS.abiflags sections are handled as regular sections until the control reaches Writer. Writer then aggregates all sections whose type is SHT_MIPS_ABIFLAGS to create a single synthesized input section. The synthesized section is then processed normally as if it came from an input file. llvm-svn: 286398
-
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
-
-
Rafael Espindola authored
llvm-svn: 286286
-
- Nov 04, 2016
-
-
Rafael Espindola authored
llvm-svn: 285996
-
- Nov 02, 2016
-
-
Rui Ueyama authored
Differential Revision: https://reviews.llvm.org/D26225 llvm-svn: 285851
-
Rui Ueyama authored
Previously, we added strings from DynamicSection::finalize(). It was a bit tricky because finalize() is supposed to fix the final size of the section, but adding new strings would change the size of .dynstr section. So there was a dependency between finalize functions of .dynamic and .dynstr. However, I noticed that we can elimiante the dependency by simply add strings early; we don't have to do that in finalize() but can do from DynamicSection's ctor. This patch defines a new function, DynamicSection::addEntries, to add .dynamic entries that doesn't depend on other sections. llvm-svn: 285784
-
Rui Ueyama authored
llvm-svn: 285764
-
Rui Ueyama authored
llvm-svn: 285763
-
- Nov 01, 2016
-
-
Rui Ueyama authored
We are going to have many more classes for linker-synthesized input sections, so it's worth to be added to a separate file than to the file for regular input sections. llvm-svn: 285740
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D25627 llvm-svn: 285682
-
- 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
-
-
George Rimar authored
In this patch partial gdb_index section is created. For costructing the .gdb_index section 6 steps should be performed (details are in SplitDebugInfo.cpp file header), this patch do first 3: Creates proper section header. Fills list of compilation units. Types CU list area is not supposed to be supported, so it is ignored and therefore can be treated as implemented either. Differential revision: https://reviews.llvm.org/D24706 llvm-svn: 284708
-
George Rimar authored
llvm-svn: 284705
-