- Mar 08, 2017
-
-
Rafael Espindola authored
llvm-svn: 297287
-
Peter Smith authored
This change moves the calls to finalizeContent() for each synthetic section before createThunks(). This will allow us to assign addresses prior to calling createThunks(). As addition of thunks may add to the static symbol table and may affect the size of the mips got section we introduce a couple of additional member functions to update these values. Differential revision: https://reviews.llvm.org/D29983 llvm-svn: 297277
-
- Mar 07, 2017
-
-
Peter Smith authored
This change fixes a bug in which the Mips LA25 Thunks are always assigned to the same Output section as the caller and not the callee as expected. Differential Revision: https://reviews.llvm.org/D30637 llvm-svn: 297135
-
Rui Ueyama authored
llvm-svn: 297107
-
- Mar 06, 2017
-
-
Rafael Espindola authored
llvm-svn: 297077
-
Rui Ueyama authored
llvm-svn: 297012
-
George Rimar authored
In compare with D30458, this makes Bss/BssRelRo to be pure synthetic sections. That removes CopyRelSection class completely, making Bss/BssRelRo to be just regular synthetics. SharedSymbols involved in creating copy relocations are converted to DefinedRegular, what also simplifies things. Differential revision: https://reviews.llvm.org/D30541 llvm-svn: 297008
-
- Mar 01, 2017
-
-
George Rimar authored
In many places we reset Size to 0 before calling assignOffsets() manually. Sometimes we don't do that. It looks we can just always do that inside. Previous code had: template <class ELFT> void OutputSection::assignOffsets() { uint64_t Off = Size; And tests feels fine with Off = 0. I think Off = Size make no sence. Differential revision: https://reviews.llvm.org/D30463 llvm-svn: 296609
-
- Feb 28, 2017
-
-
Rui Ueyama authored
Differential Revision: https://reviews.llvm.org/D30348 llvm-svn: 296508
-
- Feb 27, 2017
-
-
Rui Ueyama authored
llvm-svn: 296307
-
Rui Ueyama authored
Differential Revision: https://reviews.llvm.org/D30351 llvm-svn: 296303
-
- Feb 24, 2017
-
-
Rafael Espindola authored
Now that all special sections are SyntheticSections, we only need one OutputSection class. llvm-svn: 296127
-
- Feb 23, 2017
-
-
Rafael Espindola authored
With the current design an InputSection is basically anything that goes directly in a OutputSection. That includes plain input section but also synthetic sections, so this should probably not be a template. llvm-svn: 295993
-
Petr Hosek authored
We shouldn't report an error for R_*_NONE relocs since we're emitting them when writing relocations to discarded sections. Differential Revision: https://reviews.llvm.org/D30279 llvm-svn: 295936
-
Rafael Espindola authored
Removing this template is not a big win by itself, but opens the way for removing more templates. llvm-svn: 295923
-
- Feb 21, 2017
-
-
Rui Ueyama authored
This option disable creating copy relocations. ld.bfd and ld.gold have the same option. llvm-svn: 295772
-
- Feb 20, 2017
-
-
Rui Ueyama authored
llvm-svn: 295632
-
- Feb 19, 2017
-
-
Rui Ueyama authored
llvm-svn: 295622
-
- Feb 17, 2017
-
-
Rui Ueyama authored
The previous name caused a little confusion because the function not only returns aliases but a given symbol itself too. llvm-svn: 295408
-
- Feb 16, 2017
-
-
Rui Ueyama authored
llvm-svn: 295289
-
Rui Ueyama authored
llvm-svn: 295288
-
Rui Ueyama authored
This patch removes NeedsCopyOrPltAddr and instead add two variables, NeedsCopy and NeedsPltAddr. This uses one more bit in Symbol class, but the actual size doesn't increase because we had unused bits. This should improve code readability. llvm-svn: 295287
-
Rui Ueyama authored
This is slightly inefficient than the previous code, but that is really negligible as this function is usually called at most only a few times. llvm-svn: 295282
-
Rui Ueyama authored
Previously, space in a BSS section for copy relocations are reserved in a special way. We directly manipulated size of the BSS section. r294577 changed the way of doing it. Now, we create an instance of CopyRelSection (which is a synthetic input section) for each copy relocation. This patch removes the remains of the old way and add CopyRelSections to BSS sections using `addSections` function, which is the usual way to add an input section to an output section. llvm-svn: 295278
-
Rafael Espindola authored
In the target dependent code we already always return a int64_t. In the target independent code we carefully use uintX_t, which has the same result given 2 complement rules. This just simplifies the code to use int64_t everywhere. llvm-svn: 295263
-
- Feb 14, 2017
-
-
Rui Ueyama authored
llvm-svn: 295031
-
- Feb 09, 2017
-
-
Peter Smith authored
When we need a copy relocation we create a synthetic SHT_NOBITS section that contains the right amount of ZI and assign it to either .bss or .rel.ro.bss as appropriate. This allows the dynamic relocation to be placed on the InputSection, removing the last case where a dynamic relocation is stored as an offset from the OutputSection. This has the side effect that we can run assignOffsets() after scanRelocs() without losing the additional ZI needed for the copy relocations. Differential Revision: https://reviews.llvm.org/D29637 llvm-svn: 294577
-
- Feb 01, 2017
-
-
Peter Smith authored
Thunks are now implemented by redirecting the relocation to the symbol S, to a symbol TS in a Thunk. The Thunk will transfer control to S. This has the following implications: - All the side-effects of Thunks happen within createThunks() - Thunks are no longer stored in InputSections and Symbols no longer need to hold a pointer to a Thunk - The synthetic Thunk sections need to be merged into OutputSections This implementation is almost a direct conversion of the existing Thunks with the following exceptions: - Mips LA25 Thunks are placed before the InputSection that defines the symbol that needs a Thunk. - All ARM Thunks are placed at the end of the OutputSection of the first caller to the Thunk. Range extension Thunks are not supported yet so it is optimistically assumed that all Thunks can be reused. This is a recommit of r293283 with a fixed comparison predicate as std::merge requires a strict weak ordering. Differential revision: https://reviews.llvm.org/D29327 llvm-svn: 293757
-
- Jan 28, 2017
-
-
Rui Ueyama authored
This reverts commit r293283 because it broke MSVC build. llvm-svn: 293352
-
- Jan 27, 2017
-
-
Rafael Espindola authored
Now reportUndefined only has to look at Config->UnresolvedSymbols and the symbol. getUnresolvedSymbolOption does all the hard work of mapping options like -shared and -z defs to one of the UnresolvedPolicy enum entries. The critical fix is that now "-z defs --warn-unresolved-symbols" only warns. llvm-svn: 293290
-
Peter Smith authored
Thunks are now implemented by redirecting the relocation to the symbol S, to a symbol TS in a Thunk. The Thunk will transfer control to S. This has the following implications: - All the side-effects of Thunks happen within createThunks() - Thunks are no longer stored in InputSections and Symbols no longer need to hold a pointer to a Thunk - The synthetic Thunk sections need to be merged into OutputSections This implementation is almost a direct conversion of the existing Thunks with the following exceptions: - Mips LA25 Thunks are placed before the InputSection that defines the symbol that needs a Thunk. - All ARM Thunks are placed at the end of the OutputSection of the first caller to the Thunk. Range extension Thunks are not supported yet so it is optimistically assumed that all Thunks can be reused. Differential Revision: https://reviews.llvm.org/D29129 llvm-svn: 293283
-
- Jan 20, 2017
-
-
Peter Smith authored
Include removal of call to getThunkExpr() as it has already been called and recorded by scanRelocs() Cleanup suggestions by Rafael. llvm-svn: 292614
-
- Jan 18, 2017
-
-
Peter Smith authored
A necessary first step towards range extension thunks is to delay the creation of thunks until the layout of InputSections within OutputSections has been done. The change scans the relocations directly from InputSections rather than looking in the ELF File the InputSection came from. This will allow a future change to redirect the relocations to symbols defined by Thunks rather than indirect when resolving relocations. A side-effect of moving ThunkCreation is that the OutSecOff of InputSections may change in an OutputSection that contains Thunks. In well behaved programs thunks are not in OutputSections with dynamic relocations. Differential Revision: https://reviews.llvm.org/D28811 llvm-svn: 292359
-
- 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
-
- Dec 19, 2016
-
-
Rafael Espindola authored
llvm-svn: 290112
-
Adhemerval Zanella authored
AArch64 TLSDESC for local symbol in shared objects are implemented in a arch specific manner where the TLSDESC dynamic relocation addend is the symbol VM inside the TLS block. For instance, with a shared library created from the code: -- static __thread int32_t x1; static __thread int64_t x2; int32_t foo1 (int32_t x) { x1 += x; return x; } int64_t foo2 (int64_t x) { x2 += x; return x; } -- The dynamic relocation should be create as: Relocations [ Section (N) .rela.dyn { <Address1> R_AARCH64_TLSDESC - 0x0 <Address2> R_AARCH64_TLSDESC - 0x8 } ] Where 0x0 addend in first dynamic relocation is the address of 'x1' in TLS block and '0x8' is the address of 'x2'. Checked against test-suite on aarch64-linux-gnu. llvm-svn: 290099
-
- Dec 13, 2016
-
-
Rafael Espindola authored
llvm-svn: 289550
-
- Dec 08, 2016
-
-
Peter Smith authored
This change introduces new synthetic sections IpltSection, IgotPltSection that represent the ifunc entries that would previously have been put in the PltSection and the GotPltSection. The separation makes sure that the R_*_IRELATIVE relocations are placed after the non R_*_IRELATIVE relocations, which permits ifunc resolvers to know that the .got.plt slots will be initialized prior to the resolver being called. A secondary benefit is that for ARM we can move the IgotPltSection and its dynamic relocations to the .got and .rel.dyn as the ARM glibc expects all the R_*_IRELATIVE relocations to be in the .rel.dyn Differential revision: https://reviews.llvm.org/D27406 llvm-svn: 289045
-
Simon Atanasyan authored
These MIPS specific symbols should be global because in general they can have an arbitrary value. By default this value is a fixed offset from .got section. This patch adds more checks to the mips-gp-local.s test case but marks it as XFAIL because LLD does not allow redefinition of absolute symbols value by a linker script. This should be fixed by D27276. Differential revision: https://reviews.llvm.org/D27524 llvm-svn: 289025
-
- Dec 06, 2016
-
-
Rafael Espindola authored
For preemptable symbols the dynamic linker does all the work. Trying to compute the addend is at best wasteful and can also lead to crashes in cases of programs that uses tls but doesn't define any tls variables. llvm-svn: 288803
-