summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Apply segments from linker scriptsDenis Protivensky2015-07-2310-105/+171
| | | | | | | | | | | | | | Put sections to segments according to linker scripts if available. Rework the code of TargetLayout::assignSectionsToSegments so it operates on the given list of segments, which can be either read from linker scripts or constructed as before. Handle NONE segments defined in linker scripts by putting corresponding sections to PT_NULL segment. Consider flags set for segments through linker scripts. Differential Revision: http://reviews.llvm.org/D10918 llvm-svn: 243002
* [ELF] Protect write access to the ELFLinkingContext::_cidentSections by a mutexSimon Atanasyan2015-07-221-1/+3
| | | | | | | The _cidentSections container is filled during files parsing so we need to serialize a concurrent access to it. llvm-svn: 242885
* Don't assume ELFFile iterates over the program headers.Rafael Espindola2015-07-211-4/+29
| | | | | | It will stop doing so shortly. llvm-svn: 242832
* Drop last use of getDynamicSymbolName.Rafael Espindola2015-07-211-3/+11
| | | | llvm-svn: 242820
* Keep track of which string table is associated with a symbol table.Rafael Espindola2015-07-211-5/+20
| | | | | | This removes the last uses of getStaticSymbolName in lld. llvm-svn: 242816
* [Mips] Fix addend writing for R_MIPS_REL32 relocationSimon Atanasyan2015-07-212-11/+20
| | | | llvm-svn: 242760
* [Mips] Handle R_MIPS_JALR relocation to omptimize jalr/jr instructionsSimon Atanasyan2015-07-212-10/+39
| | | | llvm-svn: 242759
* Update for llvm api change.Rafael Espindola2015-07-204-27/+26
| | | | llvm-svn: 242701
* Update for llvm api change.Rafael Espindola2015-07-141-3/+9
| | | | llvm-svn: 242216
* [ELF/AArch64] Fix export TLS dynamic symbolAdhemerval Zanella2015-07-146-17/+26
| | | | | | | | This patch fixes the TLS dynamic variable exportation from .got.plt segments, created by General-dynamic relocations (TLSDESC). Current code only export symbols in dynamic table from .got sections. llvm-svn: 242142
* [LinkerScript] Don't create unnecessarily large segmentsRafael Auler2015-07-141-29/+41
| | | | | | | | | | | | | When using a linker script expression to change the address of a section, even if the new address is more than a page of distance from the old address, lld may put everything in the same segment, forcing it to be unnecessarily large. This patch changes the logic in Segment::assignVirtualAddress() and Segment::assignFileOffsets() to allow the segment to be sliced into two or more if it detects a linker script expression that changes a section address. Differential Revision: http://reviews.llvm.org/D10952 llvm-svn: 242096
* [LinkerScript] Fix bug in Segment::assignVirtualAddress()Rafael Auler2015-07-131-1/+1
| | | | | | | | | | | | | | When calculating the start address and size of a segment, lld mistakenly attributed the start address of the last segment slice to the whole segment when it should consider the start address of the first slice. In this case, in a multi-slice segment, Segment::assignVirtualAddress() will return a wrong segment start address to TargetLayout::assignVirtualAddress(). The effect of this miscalculation is to allocate some program headers in unnecessarily far away addresses. This commit fixes this. Differential Revision: http://reviews.llvm.org/D10951 llvm-svn: 242089
* [Mips] Support MIPS big-endian 32/64-bits targetsSimon Atanasyan2015-07-1311-60/+278
| | | | llvm-svn: 242014
* elf: Make error output from AtomSection<ELFT>::write() deterministic.Nico Weber2015-07-122-12/+19
| | | | | | | | | | | | | | | | The function uses parallel_for() and then writes error messages from the parallel loop's body. This produces nondetermistic error messages. Instead, copy error messages to a vector and sort it by the atom's file offsets before printing all error messages after the parallel_for(). This results in a few string copies, but only in the error case. (And passing tests seem more important than performance.) This makes tests elf/AArch64/rel-prel16-overflow.test and elf/AArch64/rel-prel32-overflow.test pass on Windows: Both tests check that atom error messages are emitted in a certain order, and on Windows they happened to be emitted in a different order before this patch. llvm-svn: 241988
* Update for upcoming llvm change.Rafael Espindola2015-07-081-1/+1
| | | | llvm-svn: 241746
* Fix undefined behaviour exposed by the new -Wshift-negative-value warning.Davide Italiano2015-07-071-1/+1
| | | | llvm-svn: 241530
* [ELF/AArch64] Set correct loader name in linking contextAdhemerval Zanella2015-07-031-3/+3
| | | | | | | | This patch reimplements ELFLinkingContext::getDefaultInterpreter for aarch64 with correct loader name. It is required to exclude the loader from DT_NEEDED in shared library creation. llvm-svn: 241371
* [ELF/AArch64] Set correct loader name in linking contextAdhemerval Zanella2015-07-031-0/+5
| | | | | | | | This patch reimplements ELFLinkingContext::getDefaultInterpreter for aarch64 with correct loader name. It is required to exclude the loader from DT_NEEDED in shared library creation. llvm-svn: 241370
* Use getDynamicSymbolName/getStaticSymbolName instead of a constant argument.Rafael Espindola2015-07-032-3/+3
| | | | llvm-svn: 241346
* [Mips] Factor out symbol type checking (PIC/non-PIC) into the separate functionSimon Atanasyan2015-07-033-4/+9
| | | | | | No functional changes. llvm-svn: 241342
* [ELF] Define __start_XXX/__stop_XXX symbols where XXX is a section nameSimon Atanasyan2015-07-035-14/+50
| | | | | | | | | | | | | | This is GNU ELF linker extension used particularly by LibC code. If input object files contain section named XXX, and the XXX is a valid C identifier, and there are undefined or weak symbols __start_XXX/__stop_XXX, linker should define __start_XXX/__stop_XXX symbols point to the begin/end of the XXX section correspondingly. For example, without support of this extension statically linked executables for X86_64 and Mips (maybe other) targets do not flush IO buffers at the end of executing. llvm-svn: 241341
* Update for llvm changes.Rafael Espindola2015-07-021-3/+3
| | | | llvm-svn: 241298
* [ELF] Remove dead code. NFCSimon Atanasyan2015-07-021-12/+0
| | | | llvm-svn: 241274
* [ELF] Make OutputSection::memSize `const` member function. NFCSimon Atanasyan2015-07-011-1/+1
| | | | llvm-svn: 241194
* [ELF/AArch64] Initial General-dynamic TLS supportAdhemerval Zanella2015-07-013-9/+157
| | | | | | | | | | | | | | This patch adds initial general-dynamic TLS support for AArch64. Currently no optimization is done to realx for more performance-wise models (initial-exec or local-exec). This patch also only currently handles correctly executable generation, although priliminary DSO support through PLT specific creation is also added. With this change clang/llvm bootstrap with lld is possible in static configuration (some DSO creation fails due missing Linker script support, not AArch64 specific), although make check also shows some issues. llvm-svn: 241192
* Update for llvm api change.Rafael Espindola2015-07-011-12/+27
| | | | llvm-svn: 241157
* Use copy init instead of direct init.Rafael Espindola2015-06-301-4/+4
| | | | llvm-svn: 241089
* Update for llvm change.Rafael Espindola2015-06-302-6/+6
| | | | llvm-svn: 241075
* Update for llvm api change.Rafael Espindola2015-06-291-1/+1
| | | | llvm-svn: 240997
* Update for llvm api change.Rafael Espindola2015-06-291-1/+5
| | | | llvm-svn: 240951
* Update for llvm change.Rafael Espindola2015-06-293-9/+10
| | | | llvm-svn: 240940
* Update for llvm changes.Rafael Espindola2015-06-261-3/+1
| | | | llvm-svn: 240781
* [Mips] Reject R_MIPS_CALL16 against local symbolsSimon Atanasyan2015-06-261-14/+33
| | | | llvm-svn: 240765
* [Mips] Use helper functions to determine relocations purposeSimon Atanasyan2015-06-261-126/+91
| | | | | | | | That allows to remove duplicated long switch/case statements. No functional changes. llvm-svn: 240764
* [Mips] Create LA25 stubs for all branch relocationsSimon Atanasyan2015-06-261-34/+57
| | | | llvm-svn: 240763
* [ELF] Fix .init_array initializationAdhemerval Zanella2015-06-241-1/+5
| | | | | | | | | | | | | | | Some compilers may not add the section symbol in '.symtab' for the .init_array and 'ldd' just ignore it. It results in global constructor not being called in final executable. This patch add both '.init_array' and '.fini_array' to be added in Atom graph generation even when the section contains no symbol. An already existing testcase is modified to check for such scenario. The issue fixes the llvm test-suite regressions for both Single and MultiSource files. llvm-svn: 240570
* [lld] Add MachO thread-local storage support.Lang Hames2015-06-238-6/+223
| | | | | | | | This allows LLD to correctly link MachO objects that use thread-local storage. Differential Revision: http://reviews.llvm.org/D10578 llvm-svn: 240454
* [MachO] Initialize all fields of NormalizedFile.Benjamin Kramer2015-06-231-20/+14
| | | | | | | | | The ObjectFileYAML.roundTrip serializes a default-constructed NormalizedFile to YAML, triggering uninitialized memory reads. While there use in-class member initializers. llvm-svn: 240446
* [Mips] Support R_MICROMIPS_HI0_LO16 relocation handlingSimon Atanasyan2015-06-222-1/+5
| | | | llvm-svn: 240268
* [Mips] Support R_MICROMIPS_LITERAL relocation handlingSimon Atanasyan2015-06-222-0/+5
| | | | llvm-svn: 240267
* [Mips] Support R_MIPS_LITERAL relocation handlingSimon Atanasyan2015-06-222-1/+5
| | | | llvm-svn: 240266
* [Mips] Support R_MICROMIPS_SUB relocation handlingSimon Atanasyan2015-06-221-2/+6
| | | | llvm-svn: 240265
* [Mips] Reject R_MIPS_GPREL32 against external symbolsSimon Atanasyan2015-06-221-2/+16
| | | | llvm-svn: 240264
* [Mips] Reject position-dependent relocations in case of shared library linkingSimon Atanasyan2015-06-221-10/+70
| | | | llvm-svn: 240262
* [Mips] Support R_MICROMIPS_HIGHER / R_MICROMIPS_HIGHEST relocations handlingSimon Atanasyan2015-06-221-0/+4
| | | | llvm-svn: 240260
* [Mips] Support R_MIPS_HIGHER / R_MIPS_HIGHEST relocations handlingSimon Atanasyan2015-06-221-0/+14
| | | | llvm-svn: 240259
* Fix no-asserts build failure due to unused variable, and cleanup some ↵David Blaikie2015-06-191-1/+3
| | | | | | unique_ptr usage while I'm here llvm-svn: 240169
* Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&David Blaikie2015-06-1924-131/+129
| | | | | | | | None of the implementations replace the SimpleFile with some other file, they just modify the SimpleFile in-place, so a direct reference to the file is sufficient. llvm-svn: 240167
* [lld] Allow LLD passes to return error codes.Lang Hames2015-06-1924-38/+71
| | | | llvm-svn: 240147
* [Mips] Write inline some more relocation calculationsSimon Atanasyan2015-06-171-112/+20
| | | | | | No functional changes. llvm-svn: 239961
OpenPOWER on IntegriCloud