summaryrefslogtreecommitdiffstats
path: root/lld/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not use a hash table to uniquify mergeable strings.Rui Ueyama2018-12-052-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, we have a hash table containing strings and their offsets to manage mergeable strings. Technically we can live without that, because we can do binary search on a vector of mergeable strings to find a mergeable strings. We did have both the hash table and the binary search because we thought that that is faster. We recently observed that lld tend to consume more memory than gold when building an output with debug info. A few percent of memory is consumed by the hash table. So, we needed to reevaluate whether or not having the extra hash table is a good CPU/memory tradeoff. I run a few benchmarks with and without the hash table. I got a mixed result for the benchmark. We observed a regression for some programs by removing the hash table (that's what we expected), but we also observed that performance imrpovements for some programs. This is perhaps due to reduced memory usage. Differential Revision: https://reviews.llvm.org/D55234 llvm-svn: 348401
* [ELF] Simplify getSectionPieceFangrui Song2018-12-041-12/+5
| | | | | | | | | | | | Reviewers: ruiu, espindola Reviewed By: ruiu Subscribers: grimar, emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D55248 llvm-svn: 348311
* Remove unreachable code.Rui Ueyama2018-12-041-1/+0
| | | | llvm-svn: 348294
* ELF: allow non allocated sections to go into allocated sectionsRui Ueyama2018-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch from Andrew Kelley. For context, see https://bugs.llvm.org/show_bug.cgi?id=39862 The use case is embedded / OS programming where the kernel wants access to its own debug info via mapped dwarf info. I have a proof of concept of this working, using this linker script snippet: .rodata : ALIGN(4K) { *(.rodata) __debug_info_start = .; KEEP(*(.debug_info)) __debug_info_end = .; __debug_abbrev_start = .; KEEP(*(.debug_abbrev)) __debug_abbrev_end = .; __debug_str_start = .; KEEP(*(.debug_str)) __debug_str_end = .; __debug_line_start = .; KEEP(*(.debug_line)) __debug_line_end = .; __debug_ranges_start = .; KEEP(*(.debug_ranges)) __debug_ranges_end = .; } Differential revision: https://reviews.llvm.org/D55276 llvm-svn: 348291
* [ELF] Allow discarding of .rela.pltMartell Malone2018-12-041-2/+1
| | | | | | | | | | | | | | | | When linking the linux kernel on ppc64le ld.lld -EL -m elf64lppc -Bstatic --orphan-handling=warn --build-id -o .tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.a --no-whole-archive --start-group lib/lib.a --end-group ld.lld: error: discarding .rela.plt section is not allowed The linker script discards with the following matches *(.glink .iplt .plt .rela* .comment) Differential Revision: https://reviews.llvm.org/D54871 llvm-svn: 348258
* [PPC][PPC64] PPC_REL14 and PPC64_REL14 relocationsMartell Malone2018-12-042-4/+19
| | | | | | | | | | When linking the linux kernel on ppc64 and ppc ld.lld: error: unrecognized reloc 11 11 is PPC_REL14 and PPC64_REL14 Differential revision: https://reviews.llvm.org/D54868 llvm-svn: 348255
* Show a proper error message if output file is too large.Rui Ueyama2018-12-031-1/+2
| | | | | | | | | At least on Linux, if a file size given to FileOutputBuffer is greater than 2^63, it fails with "Invalid argument" error, which is not a user-friendly error message. With this patch, lld prints out "output file too large" instead. llvm-svn: 348153
* [LLD][ELF] - Remove the excessive condition. NFC.George Rimar2018-12-031-1/+1
| | | | | | | | There is no need to check that In.DynSymTab != nullptr, because `includeInDynsym` already checks for `!Config->HasDynSymTab` and `HasDynSymTab` is the pre-condition for In.DynSymTab creation. llvm-svn: 348143
* [LLD][ELF] - Improve the DWARF v5 suport for building .gdb_index.George Rimar2018-12-032-1/+12
| | | | | | | | | | | | Now LLD might build the broken/incomplete .gdb_index when some DWARF v5 sections (like .debug_rnglists and .debug_addr) are used. Particularly, for the case above, we emit an empty address area. A test case is provided and patch fixes the issue. Differential revision: https://reviews.llvm.org/D55109 llvm-svn: 348119
* Inline a function template that is used only once. NFC.Rui Ueyama2018-11-301-18/+12
| | | | llvm-svn: 348013
* [LLD][ELF] Error if _GLOBAL_OFFSET_TABLE_ is defined in input objectsPeter Smith2018-11-291-3/+14
| | | | | | | | | | | | | | | | | The _GLOBAL_OFFSET_TABLE_ is a linker defined symbol that is placed at some location relative to the .got, .got.plt or .toc section. On some targets such as Arm the correctness of some code sequences using a relocation to _GLOBAL_OFFSET_TABLE_ depend on the value of the symbol being in the linker defined place. Follow the ld.gold example and give a multiple symbol definition error. The ld.bfd behaviour is to ignore the definition in the input object and redefine it, which seems like it could be more surprising. fixes pr39587 Differential Revision: https://reviews.llvm.org/D54624 llvm-svn: 347854
* [ELF] --gdb-index: use lower_bound to compute relative CU index in the ↵Fangrui Song2018-11-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | object file Summary: This reinstates what I originally intended to do in D54361. It removes the assumption that .debug_gnu_pubnames has increasing CuOffset. Now we do better than gold here: when .debug_gnu_pubnames contains multiple sets, gold would think every set has the same CU index as the first set (incorrect). Reviewed By: ruiu Reviewers: ruiu, dblaikie, espindola Subscribers: emaste, arichardson, arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D54483 llvm-svn: 347820
* Simplify Symbol::getPltVA.Rui Ueyama2018-11-286-21/+11
| | | | | | | | | | | This patch also makes getPltEntryOffset a non-member function because it doesn't depend on any private members of the TargetInfo class. I tried a few different ideas, and it seems this change fits in best to me. Differential Revision: https://reviews.llvm.org/D54981 llvm-svn: 347781
* Fix a typo.Haojian Wu2018-11-281-1/+1
| | | | llvm-svn: 347751
* Fix build error.Haojian Wu2018-11-281-15/+15
| | | | llvm-svn: 347750
* [ELF][MIPS] Handle mips in the OUTPUT_FORMAT directiveSimon Atanasyan2018-11-281-16/+26
| | | | | | Differential Revision: http://reviews.llvm.org/D54920 llvm-svn: 347742
* [ELF] Use more specific method to calculate DT_PLTRELSZPeter Smith2018-11-281-1/+13
| | | | | | | | | | | | | | | | | | | | The DT_PLTRELSZ dynamic tag is calculated using the size of the OutputSection containing the In.RelaPlt InputSection. This will work for the default no linker script case and the majority of linker scripts. Unfortunately it doesn't work for some 'almost' sensible linker scripts. It is permitted by ELF to have a single OutputSection containing both In.RelaDyn, In.RelaPlt and In.RelaIPlt. It is also permissible for the range of memory [DT_RELA, DT_RELA + DT_RELASZ) and the range [DT_JMPREL, DT_JMPREL + DT_JMPRELSZ) to overlap as long as the the latter range is at the end. To support this type of linker script use the specific InputSection sizes. Fixes pr39678 Differential Revision: https://reviews.llvm.org/D54759 llvm-svn: 347736
* Make a member function non-member. NFC.Rui Ueyama2018-11-271-8/+4
| | | | llvm-svn: 347678
* [ELF] - Fix R_AARCH64_ADR_GOT_PAGE, R_AARCH64_LD64_GOT_LO12 handling against ↵George Rimar2018-11-273-4/+25
| | | | | | | | | | | | | | | | | | | | IFUNC symbols. This is https://bugs.llvm.org/show_bug.cgi?id=38074. The issue is that when calling a function, LLD generates a .got entry that points to the IFUNC resolver function when instead, it should use the PLT entries properly for handling the IFUNC. So we should create a got entry that points to PLT entry, which itself loads the value from .got.plt, relocated with R_*_IRELATIVE to make things work. Patch do that. Differential revision: https://reviews.llvm.org/D54314 llvm-svn: 347650
* [AArch64] Cortex-a53-843419 erratum should not apply to relaxed TLS.Peter Smith2018-11-271-4/+8
| | | | | | | | | | | | | | | | The changes to the instructions performed by TLS relaxation and the errata patching are performed with relocations. As these are applied so late the errata scanning won't see the changes in the section data made by the TLS relaxation. This can lead to a TLS relaxed sequence being patched when it doesn't need to be. The fix checks to see if there is a R_RELAX_TLS_IE_TO_LE instruction at the same address as the ADRP as this indicates the presence of a relaxation of a sequence that might get recognised as a patch. Differential Revision: https://reviews.llvm.org/D54854 llvm-svn: 347649
* [ELF] - Implement -z nodefaultlibGeorge Rimar2018-11-273-2/+6
| | | | | | | | | | | | | | | | | | | | This is https://bugs.llvm.org//show_bug.cgi?id=38978 Spec says that: "Objects may be built with the -z nodefaultlib option to suppress any search of the default locations at runtime. Use of this option implies that all the dependencies of an object can be located using its runpaths. Without this option, which is the most common case, no matter how you augment the runtime linker's library search path, its last element is always /usr/lib for 32-bit objects and /usr/lib/64 for 64-bit objects." The patch implements this option. Differential revision: https://reviews.llvm.org/D54577 llvm-svn: 347647
* ELF: ICF: Include contents of referenced sections in initial partitioning ↵Peter Collingbourne2018-11-261-2/+27
| | | | | | | | | | | | | | hash. NFCI. On my machine this reduced median link time of lld-speed-test/chrome from 2.68s to 2.41s. It also reduces link time of Chrome for Android with a prototype compiler change that causes the compiler to create large numbers of identical (modulo relocations) sections from >15 minutes to a few seconds. Differential Revision: https://reviews.llvm.org/D54773 llvm-svn: 347594
* [LLD][ELF] - Do not crash when parsing the -defsym option from a error state.George Rimar2018-11-261-0/+2
| | | | | | | | | | | | | | When we are in a error state, script parser will not parse the -defsym expression and hence will not tokenize it. Then ScriptLexer::Pos will be 0 and LLD will assert and crash here: MemoryBufferRef ScriptLexer::getCurrentMB() { assert(!MBs.empty() && Pos > 0); // Bang ! Solution - stop parsing the defsym in a error state. That is consistent with the regular case (when we parse the linker script). llvm-svn: 347549
* [LLD][ELF] - Remove the excessive safety return. NFC.George Rimar2018-11-261-3/+0
| | | | | | | | | | | | We explicitly call finalizeContents() only once for DynamicSection. The code testing we do not do it twice is just excessive. It could be an assert, but we don't do that for other sections, so does not seem we should do it here too. llvm-svn: 347543
* [LLD][ELF] - Add llvm_unreachable. NFC.George Rimar2018-11-261-1/+3
| | | | | | We never should call writeTo() for BSS section. llvm-svn: 347540
* [LLD][ELF] - Simplify. NFCI.George Rimar2018-11-232-7/+5
| | | | | | | This makes getRISCVPCRelHi20 to be static local helper, and rotates the 'if' condition. llvm-svn: 347497
* [ELF] - Make SymbolTable::addDefined return Defined.George Rimar2018-11-223-13/+12
| | | | | | | | | Now it returns Symbol. This should be NFC that avoids doing cast at the caller's sides. Differential revision: https://reviews.llvm.org/D54627 llvm-svn: 347455
* [ELF] Write IPLT header in -static -z retpolineplt modeFangrui Song2018-11-212-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes PR39711: -static -z retpolineplt does not produce retpoline PLT header. -z now is not relevant. Statically linked executable does not have PLT, but may have IPLT with no header. When -z retpolineplt is specified, however, the repoline PLT header should still be emitted. I've checked that this fixes the FreeBSD reproduce in PR39711 and a Linux program statically linked against glibc. The programm print "Hi" rather than SIGILL/SIGSEGV. getPltEntryOffset may look dirty after this patch, but it can be cleaned up later. Another possible improvement is that when there are non-preemptible IFUNC symbols (rare case, e.g. -Bsymbolic), both In.Plt and In.Iplt can be non-empty and we'll emit the retpoline PLT header twice. Reviewers: espindola, emaste, chandlerc, ruiu Reviewed By: emaste Subscribers: emaste, arichardson, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D54782 llvm-svn: 347404
* [ELF] Allow --noinhibit-exec to produce corrupted executable with relocation ↵Fangrui Song2018-11-201-3/+3
| | | | | | | | | | | | | | | | | | | overflow Summary: When --noinhibit-exec is used, ld.bfd/gold emit errors but allow to produce corrupted executable, which is handy for debugging purpose. lld's --noinhibit-exec has a different meaning and changes some errors to warnings. This patch replaces "error" with "errorOrWarn" to exploit that property. We may revisit this: if we should keep them as errors (as ld.bfd/gold do) but allow to produce a (corrupted) executable. Reviewers: ruiu, grimar, espindola Reviewed By: grimar Subscribers: Timmmm, jhenderson, emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D54651 llvm-svn: 347327
* Support ARM_V4BX relocationFangrui Song2018-11-161-0/+6
| | | | | | | | | | | | | | | | Summary: This patch implementation the handler for ARM_V4BX. This relocation is used by GNU runtime files and other armv4 applications. Patch by Yin Ma Reviewers: espindola, MaskRay, ruiu, peter.smith, pcc Reviewed By: ruiu Subscribers: yinma, pcc, peter.smith, MaskRay, rovka, efriedma, emaste, javed.absar, arichardson, kristof.beyls, chrib, llvm-commits Differential Revision: https://reviews.llvm.org/D53444 llvm-svn: 347077
* [ELF][MIPS] Use MIPS R6 `sigrie` as a trap instructionSimon Atanasyan2018-11-161-1/+3
| | | | | | | | | | | | | | | Current value using as a trap instruction (0xefefefef) is not a good choice for MIPS because it's a valid MIPS instruction `swc3 $15,-4113(ra)`. This patch replaces 0xefefefef by 0x04170001. For all MIPS ISA revisions before R6, this value is just invalid instruction. Starting from MIPS R6 it's a valid instruction `sigrie 1` which signals a Reserved Instruction exception. mips-traps.s test case is added to test trap encoding. Other test cases are modified to remove redundant checking. Differential revision: https://reviews.llvm.org/D54154 llvm-svn: 347029
* [WebAssembly] Refactor config setting and checking. NFC.Sam Clegg2018-11-151-2/+2
| | | | | | | | This matches the way the ELF backend does it. Differential Revision: https://reviews.llvm.org/D54559 llvm-svn: 346972
* [ELF] - Renamed few more AArch64 specific relocation expressions. NFC.George Rimar2018-11-154-17/+18
| | | | | | They are AArch64 only, so have to have AARCH64_* prefix. llvm-svn: 346963
* [ELF] Fix compilation with GCC 5Martin Storsjo2018-11-151-1/+1
| | | | | | | | | | | | | | | | | | Remove the default initializer for TrapInstr; all subclasses overwrite the defaults in their constructors anyway. This fixes compilation errors like these, with GCC 5.4 on Ubuntu 16.04, present since SVN r346893: In file included from ../tools/lld/ELF/Arch/AArch64.cpp:12:0: ../tools/lld/ELF/Target.h:125:49: error: array must be initialized with a brace-enclosed initializer std::array<uint8_t, 4> TrapInstr = {0, 0, 0, 0}; ^ ../tools/lld/ELF/Target.h:125:49: error: too many initializers for ‘std::array<unsigned char, 4ul>’ Differential Revision: https://reviews.llvm.org/D54569 llvm-svn: 346934
* [ELF] Make TrapInstr and Filler byte arrays. NFC.Simon Atanasyan2018-11-149-29/+33
| | | | | | | | | | | | The uint32_t type does not clearly convey that these fields are interpreted in the target endianness. Converting them to byte arrays should make this more obvious and less error-prone. Patch by James Clarke Differential Revision: http://reviews.llvm.org/D54207 llvm-svn: 346893
* [PPC64] Long branch thunks.Sean Fertile2018-11-148-15/+186
| | | | | | | | | | | | | | | | | | On PowerPC64, when a function call offset is too large to encode in a call instruction the address is stored in a table in the data segment. A thunk is used to load the branch target address from the table relative to the TOC-pointer and indirectly branch to the callee. When linking position-dependent code the addresses are stored directly in the table, for position-independent code the table is allocated and filled in at load time by the dynamic linker. For position-independent code the branch targets could have gone in the .got.plt but using the .branch_lt section for both position dependent and position independent binaries keeps it consitent and helps keep this PPC64 specific logic seperated from the target-independent code handling the .got.plt. Differential Revision: https://reviews.llvm.org/D53408 llvm-svn: 346877
* [AArch64] Fix resolution of R_PLT_PAGE RelExprPeter Smith2018-11-141-7/+6
| | | | | | | | | | | | | The R_AARCH64_ADR_PREL_PG_HI21 relocation type is given the R_PAGE_PC RelExpr. This can be transformed to R_PLT_PAGE_PC via toPlt(). Unfortunately the resolution is identical to R_PAGE_PC so instead of getting the address of the PLT entry we get the address of the symbol which may not be correct in the case of static ifuncs. The fix is to handle the cases separately and use getPltVA() + A with R_PLT_PAGE_PC. Differential Revision: https://reviews.llvm.org/D54474 llvm-svn: 346863
* [ELF] Rename NameTypeEntry to NameAttrEntry and its field "Type" to ↵Fangrui Song2018-11-132-12/+12
| | | | | | | | | | | | | | | | | | | CuIndexAndAttrs Summary: NameTypeEntry::Type is a bit-packed value of CU index+attributes (https://sourceware.org/gdb//onlinedocs/gdb/Index-Section-Format.html), which is named cu_index_and_attrs in a local variable in gdb/dwarf2read.c:dw2_symtab_iter_next The new name CuIndexAndAttrs is more meaningful. Reviewers: ruiu, dblaikie, espindola Reviewed By: dblaikie Subscribers: emaste, aprantl, arichardson, JDevlieghere, arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D54481 llvm-svn: 346794
* [ELF] - Renamed AArch64 specific relocations expressions. NFC.George Rimar2018-11-134-17/+18
| | | | | | They did not have AArch64 prefix. Now they do. llvm-svn: 346749
* [ELF] .gdb_index: fix CuOff when a .debug_info section contains more than 1 ↵Fangrui Song2018-11-131-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | DW_TAG_compile_unit Summary: Idx passed to readPubNamesAndTypes was an index into Chunks, not an index into the CU list. This would be incorrect if some .debug_info section contained more than 1 DW_TAG_compile_unit. In real world, glibc Scrt1.o is a partial link of start.os abi-note.o init.o and contains 2 CUs in debug builds. Without this patch, any application linking such Scrt1.o would have invalid .gdb_index The issue could be demonstrated by: (gdb) py print(gdb.lookup_global_symbol('main')) None Reviewers: espindola, ruiu Reviewed By: ruiu Subscribers: Higuoxing, grimar, dblaikie, emaste, aprantl, arichardson, JDevlieghere, arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D54361 llvm-svn: 346747
* [ELF] Change GnuPub{Names,Types}Section from StringRef to LLDDWARFSectionFangrui Song2018-11-113-23/+24
| | | | | | | | | | | | | | | Summary: The debug_info_offset value may be relocated. This is lld side change of D54375. Reviewers: ruiu, dblaikie, grimar, espindola Subscribers: emaste, arichardson, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D54376 llvm-svn: 346616
* [DWARFv5] Read and dump multiple .debug_info sections.Paul Robinson2018-11-071-2/+4
| | | | | | | | Type units go in .debug_info comdats, not .debug_types, in v5. Differential Revision: https://reviews.llvm.org/D53907 llvm-svn: 346360
* [PPC64] Use INT32_MIN instead of std::numeric_limits<int32_t>::min()Fangrui Song2018-11-071-2/+1
| | | | | | | | | | | | | | | | | | | | Summary: D53821 fixed the bogus MSVC (at least 2017) C4146 warning (unary minus applied on unsigned type) by using std::numeric_limits<int32_t>::min(). The warning was because -2147483648 is incorrectly treated as unsigned long instead of long long) Let's use INT32_MIN which is arguably more readable. Note, on GCC or clang, -0x80000000 works fine (ILP64: long, LP64: long long). Reviewers: ruiu, jhenderson, sfertile, espindola Reviewed By: sfertile Subscribers: emaste, nemanjai, arichardson, kbarton, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D54200 llvm-svn: 346356
* Handle OUTPUT_FORMAT arguments in quotation marksGalina Kistanova2018-11-031-1/+1
| | | | llvm-svn: 346068
* [ELF] Change sh_link of .rel{,a}.plt to make GNU strip happyFangrui Song2018-11-011-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: D52830 sets sh_link to .symtab in static link, which breaks executable stripped by GNU strip. It may also be odd that .rela.plt (SHF_ALLOC) points to .symtab (non-SHF_ALLOC). Change the logic on pcc's suggestion. Before: % clang -fuse-ld=lld -static -xc =(printf 'int main(){}') # or gcc % strip a.out; ./a.out unexpected reloc type in static binary[1] 61634 segmentation fault ./a.out Reviewers: ruiu, grimar, emaste, espindola Reviewed By: ruiu Subscribers: pcc, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D53993 llvm-svn: 345899
* Omit "virtual" if overridden.Rui Ueyama2018-11-011-1/+1
| | | | llvm-svn: 345886
* Use llvm_unreachable for unreachable code.Rui Ueyama2018-11-011-2/+2
| | | | llvm-svn: 345885
* Set MAttrs in LTO modeFangrui Song2018-11-011-0/+1
| | | | | | | | | | | | | | | | Summary: Without this patch, MAttrs are not set. Patch by Yin Ma Reviewers: espindola, MaskRay, ruiu, pcc Reviewed By: MaskRay, pcc Subscribers: pcc, emaste, sbc100, inglorion, arichardson, aheejin, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D53446 llvm-svn: 345884
* [ELF] - Do not crash when -r output uses linker script with `/DISCARD/`George Rimar2018-11-012-5/+13
| | | | | | | | | | | | This is https://bugs.llvm.org/show_bug.cgi?id=39493. We crashed previously because did not handle /DISCARD/ properly when -r was used. I think it is uncommon to use scripts with -r, though I see nothing wrong to handle the /DISCARD/ so that we will not crash at least. Differential revision: https://reviews.llvm.org/D53864 llvm-svn: 345819
* [ELF] Refactor per-target TLS layout configuration. NFC.Ryan Prichard2018-10-315-34/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are really three different kinds of TLS layouts: * A fixed TLS-to-TP offset. On architectures like PowerPC, MIPS, and RISC-V, the thread pointer points to a fixed offset from the start of the executable's TLS segment. The offset is 0x7000 for PowerPC and MIPS, which allows a signed 16-bit offset to reach 0x1000 of per-thread implementation data and 0xf000 of the application's TLS segment. The size and layout of the TCB isn't relevant to the static linker and might not be known. * A fixed TCB size. This is the format documented as "variant 1" in Ulrich Drepper's TLS spec. The thread pointer points to a 2-word TCB followed by the executable's TLS segment. The first word is always the DTV pointer. Used on ARM. The thread pointer must be aligned to the TLS segment's alignment, possibly creating alignment padding. * Variant 2. This format predates variant 1 and is also documented in Drepper's TLS spec. It allocates the executable's TLS segment before the thread pointer, apparently for backwards-compatibility. It's used on x86 and SPARC. Factor out an lld::elf::getTlsTpOffset() function for use in a follow-up patch for Android. The TcbSize/TlsTpOffset fields are only used in getTlsTpOffset, so replace them with a switch on Config->EMachine. Reviewers: espindola, ruiu, PkmX, jrtc27 Reviewed By: ruiu, PkmX, jrtc27 Subscribers: jyknight, emaste, sdardis, nemanjai, javed.absar, arichardson, kristof.beyls, kbarton, fedor.sergeev, atanasyan, PkmX, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D53905 llvm-svn: 345775
OpenPOWER on IntegriCloud