summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/SegmentChunks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-516/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* Update for LLVM function name change.Rui Ueyama2016-01-141-16/+13
| | | | llvm-svn: 257801
* [LinkerScript] Process program header in PHDRS commandDenis Protivensky2015-08-121-1/+1
| | | | | | | | | | Add PT_PHDR segment depending on its availability in linker script's PHDRS command, fallback if no linker script is given. Handle FILEHDR, PHDRS and FLAGS attributes of program header. Differential Revision: http://reviews.llvm.org/D11589 llvm-svn: 244743
* [ELF] Apply segments from linker scriptsDenis Protivensky2015-07-231-3/+33
| | | | | | | | | | | | | | 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
* [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
* [ELF] Fix wrong TBSS sizeAdhemerval Zanella2015-06-171-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the wrong .tbss segment size generated for cases where multiple modules have non initialized threads variables. For instance: * t0.c __thread int x0; __thread int x1; __thread int x2; extern __thread int e0; extern __thread int e1; extern __thread int e2; extern __thread int e3; int foo0 () { return x0; } int main () { return x0; } * t1.c __thread int e0; __thread int e1; __thread int e2; __thread int e3; lld is generating (for aarch64): [14] .tbss NOBITS 0000000000401000 00001000 0000000000000010 0000000000000000 WAT 0 0 4 Where is just taking in consideration the largest tbss segment, not all from all objects. ld generates a correct output: [17] .tbss NOBITS 0000000000410dec 00000dec 000000000000001c 0000000000000000 WAT 0 0 4 This issue is at 'lib/ReaderWriter/ELF/SegmentChunks.cpp' where Segment<ELFT>::assignVirtualAddress is setting wrong slice values, not taking care of although tbss segments file size does noy play role in other segment virtual address placement, its size should still be considered. llvm-svn: 239906
* [ELF] Fix gcc -pedantic warnings (remove extra ';')Denis Protivensky2015-04-151-1/+1
| | | | llvm-svn: 234981
* ELF: Attempt to simplify Segment::AssignVirtualAddress.Rui Ueyama2015-04-141-1/+1
| | | | | | This is a retry of r234944. llvm-svn: 234955
* temporaryRui Ueyama2015-04-141-13/+10
| | | | llvm-svn: 234954
* temporaryRui Ueyama2015-04-141-123/+126
| | | | llvm-svn: 234953
* Revert "ELF: Attempt to simplify Segment::assignVirtualAddress()."Rui Ueyama2015-04-141-105/+123
| | | | | | This reverts commit r234944 because it seems to have broken the buildbots. llvm-svn: 234946
* ELF: Attempt to simplify Segment::assignVirtualAddress().Rui Ueyama2015-04-141-123/+105
| | | | | | | | | | | | | This function is too long and complicated. Looks like new code was added incrementaly without any refactoring. Maybe no one can describe its exact semantics any more? It even contains copy-pastes inside it. This patch is an (incomplete) attempt to simplify the function. I tried to mechanically translate code to another form more intelligible. I don't still understand the whole picture, but this patch shouldn't change the linker's functionality. llvm-svn: 234944
* ELF: Split SegmentChunks.h to SegmentChunks.{h,cpp}.Rui Ueyama2015-04-141-0/+462
llvm-svn: 234934
OpenPOWER on IntegriCloud