- Jan 27, 2017
-
-
Rafael Espindola authored
[ELF] Fixed formatting. NFC and [ELF] Bypass section type check Differential revision: https://reviews.llvm.org/D28761 They do the opposite of what was asked for in the code review. llvm-svn: 293320
-
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
-
Eugene Leviant authored
llvm-svn: 293278
-
Eugene Leviant authored
Differential revision: https://reviews.llvm.org/D28761 llvm-svn: 293276
-
- Jan 26, 2017
-
-
Rafael Espindola authored
Should fix a few freebsd packages with dtrace. llvm-svn: 293177
-
Rui Ueyama authored
llvm-svn: 293144
-
Rui Ueyama authored
Negative flags are still bit flags, so I think "not flag" is a very good name. llvm-svn: 293143
-
Rui Ueyama authored
llvm-svn: 293142
-
Rui Ueyama authored
llvm-svn: 293141
-
Davide Italiano authored
Patch by Dmitry Mikulin. PR: 31735 Differential Revision: https://reviews.llvm.org/D29150 llvm-svn: 293139
-
Peter Collingbourne authored
Now we never append a number to the file name for task ID 0. This is similar to r293132 in the gold plugin. llvm-svn: 293138
-
Rui Ueyama authored
llvm-svn: 293130
-
- Jan 25, 2017
-
-
Rui Ueyama authored
llvm-svn: 293100
-
Rui Ueyama authored
llvm-svn: 293095
-
Rafael Espindola authored
It now uses the same infrastructure as symbol versions. This fixes us creating a dynamic relocation without a corresponding dynamic symbol. This also means that unlike gold and bfd we keep a STB_LOCAL in the static symbol table. It seems an odd feature to offer precise control over what is in a symbol table that is not used by the dynamic linker. We can bring this back if needed, but it would probably be better to just have --discard option that tells the linker to keep in the static symbol table only what is in the dynamic one. Should fix the eog build. llvm-svn: 293093
-
Rui Ueyama authored
llvm-svn: 293089
-
George Rimar authored
These relocations are used in linux kernel. Differential revision: https://reviews.llvm.org/D28094 llvm-svn: 293054
-
Peter Smith authored
Mapping symbols allow a mapping symbol aware disassembler to correctly disassemble the PLT when the code immediately prior to the PLT is Thumb. To implement this we add a function to add symbols with local binding to be defined in SyntheticSymbols. Differential Revision: https://reviews.llvm.org/D28956 llvm-svn: 293044
-
- Jan 24, 2017
-
-
Rui Ueyama authored
llvm-svn: 292980
-
George Rimar authored
Next code crashed under MSVS2015 for me: this->OutSec->Info = this->Info = 1 + It - Symbols.begin(); Because It was end() and addition of 1 is not allowed. vector implementation catched and failed that inside: _Myiter& operator+=(difference_type _Off) { // increment by integer #if _ITERATOR_DEBUG_LEVEL == 2 if (this->_Getcont() == 0 || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off) { // report error _DEBUG_ERROR("vector iterator + offset out of range"); _SCL_SECURE_OUT_OF_RANGE; llvm-svn: 292940
-
Peter Smith authored
The sh_info field of the SHT_SYMTAB section holds the index for the first non-local symbol. When there are global symbols that are output with STB_LOCAL binding due to having hidden visibility or matching the local version from a version script, the calculated value of NumLocals + 1 does not account for them. This change accounts for global symbols being output with local binding. Differential Revision: https://reviews.llvm.org/D28950 llvm-svn: 292910
-
George Rimar authored
It was requested during post commit review. llvm-svn: 292903
-
Rui Ueyama authored
Currently ld.lld -r allocates space for common symbols, whereas ld.bfd -r doesn't. As a result the OpenBSD makefile bits for creating libraries fail as they use ld -X -r to strip local symbols, which results in duplicate symbol errors because space for the common symbols has been allocated. The diff also implements the --define-commons option such that allocation of commons can be forced even if -r is used. Patch by Mark Kettenis. llvm-svn: 292878
-
Meador Inge authored
As specified here: * https://sourceware.org/binutils/docs/ld/MEMORY.html#MEMORY There are two deviations from what is specified for GNU ld: 1. Only integer constants and *not* constant expressions are allowed in `LENGTH` and `ORIGIN` initializations. 2. The `I` and `L` attributes are *not* implemented. With (1) there is currently no easy way to evaluate integer only constant expressions. This can be enhanced in the future. With (2) it isn't clear how these flags map to the `SHF_*` flags or if they even make sense for an ELF linker. Differential Revision: https://reviews.llvm.org/D28911 llvm-svn: 292875
-
- Jan 23, 2017
-
-
George Rimar authored
Previously we stored kept locals in a KeptLocalSyms arrays, belonged to files. Patch makes SymbolTableSection to store locals in Symbols member, that already present and was used for globals. SymbolTableSection already had NumLocals counter member, so change itself is trivial. That allows to simplify handling of -r, Body::DynsymIndex is no more used as "symbol table index" for relocatable output. Change was suggested during review of D28773 and opens road for D28612. Differential revision: https://reviews.llvm.org/D29021 llvm-svn: 292789
-
George Rimar authored
It is used in linux kernel script: http://lxr.free-electrons.com/source/arch/x86/kernel/vmlinux.lds.S#L140 Though CONSTRUCTORS is ignored for ELF. Differential revision: https://reviews.llvm.org/D28951 llvm-svn: 292777
-
- Jan 20, 2017
-
-
Rafael Espindola authored
llvm-svn: 292644
-
Rafael Espindola authored
This will simplify a bug fix. llvm-svn: 292642
-
Rafael Espindola authored
addIgnored already creates the symbol only if there is a reference to it. llvm-svn: 292628
-
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
-
George Rimar authored
Found that during attempts of linking linux kernel, previously we partially duplicated code from getOutputSection(), and it missed commons symbol case. Differential revision: https://reviews.llvm.org/D28903 llvm-svn: 292594
-
Peter Collingbourne authored
If two sections contained relocations to absolute symbols with the same value we would crash when trying to access their sections. Add a check that both symbols point to sections before accessing their sections, and treat absolute symbols as equal if their values are equal. Differential Revision: https://reviews.llvm.org/D28935 llvm-svn: 292578
-
- Jan 19, 2017
-
-
Rafael Espindola authored
I don't know of anything using it, but we should handle it like _end. llvm-svn: 292513
-
Rafael Espindola authored
The freebsd sbrk implementation uses _end to find the initial value of brk, so it has to be defined in the main binary. This should fix the emacs build. llvm-svn: 292512
-
- 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
-
Rui Ueyama authored
This patch adds a test for an invalid output path for -Map option, though that test is not for verifying that we are using error() instead of fatal() in writeMapFile. llvm-svn: 292336
-
Peter Collingbourne authored
Although this relocation type is not part of the x86-64 psABI, I intend to use it internally as part of the ThinLTO implementation. Differential Revision: https://reviews.llvm.org/D28841 llvm-svn: 292330
-
- Jan 17, 2017
-
-
Rafael Espindola authored
llvm-svn: 292228
-
George Rimar authored
I found this when tried to link linux kernel with LLD: https://github.com/torvalds/linux/blob/master/arch/x86/entry/vdso/vdso-layout.lds.S#L86 Output section command can have optional comma at the end: .text : { *(.text*) } :text =0x90909090, It was documented about 3 years ago for binutils: https://sourceware.org/ml/binutils/2014-04/msg00045.html Differential revision: https://reviews.llvm.org/D28803 llvm-svn: 292225
-