Commit Graph

16 Commits

Author SHA1 Message Date
Davide Italiano 21e1cd79d0 [LinkerScript] Enforce uniqueness of output object files...
... in order to avoid conflicts when tests are run in parallel.
This is an attempt to fix PR24591.

llvm-svn: 246153
2015-08-27 15:18:43 +00:00
Davide Italiano b3c7fb7f24 [LinkerScript] Fix a crash when matching wildcards.
Submitted by:	  zan jyu via llvm-dev

llvm-svn: 245792
2015-08-22 20:36:19 +00:00
Denis Protivensky 0c8beb1c95 [LinkerScript] Process program header in PHDRS command
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
2015-08-12 12:31:35 +00:00
Denis Protivensky f84acb959b [LinkerScript] Fix case when setting custom NONE segment
llvm-svn: 243006
2015-07-23 11:46:59 +00:00
Denis Protivensky cdc1246750 [ELF] Apply segments from linker scripts
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
2015-07-23 10:34:30 +00:00
Rafael Auler 2c4af3ead7 [LinkerScript] Don't create unnecessarily large segments
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
2015-07-14 00:34:43 +00:00
Simon Atanasyan 1e7b08b68d [ELF] Fix ELF test cases. Do not provide content for bss sections.
llvm-svn: 241378
2015-07-03 23:06:24 +00:00
Denis Protivensky 1aaf736d89 [LinkerScript] Add matching of output sections to segments
Add method to query segments for specified output section name.
Return error if the section is assigned to unknown segment.
Check matching of sections to segments during layout on the subject of correctness.
NOTE: no actual functionality of using custom segments is implemented.

Differential Revision: http://reviews.llvm.org/D10359

llvm-svn: 239719
2015-06-15 08:00:51 +00:00
Rui Ueyama 035025c0da Remove trailing whitespace characters.
llvm-svn: 235897
2015-04-27 17:18:04 +00:00
Simon Atanasyan 596dae5fc2 [LinkerScript] Handle symbols defined in linker scripts in case of shared lib
This patch is a follow-up to the rL232409 and allows define symbols
in a linker script in case of linking shared library.

llvm-svn: 234163
2015-04-06 15:15:01 +00:00
Rui Ueyama 533849c615 YAML: Do not use 2^x notation to represent alignments.
llvm-svn: 233222
2015-03-25 22:06:04 +00:00
Rafael Auler 01d73c9678 [LinkerScript] Handle symbols defined in linker scripts
Puts symbols defined in linker script expressions in a runtime file that is
added as input to the resolver, making the input object files see symbols
defined in linker scripts.

http://reviews.llvm.org/D8263

llvm-svn: 232409
2015-03-16 20:39:07 +00:00
Rafael Auler 8dd680dcb1 [LinkerScript] Adding test cases for SECTIONS semantics
llvm-svn: 232404
2015-03-16 19:56:42 +00:00
Meador Inge 84f613532f LinkerScript: Add -T <scriptfile> option
GNU LD has an option named -T/--script which allows a user to specify
a linker script to be used [1].  LLD already accepts linker scripts
without this option, but the option is widely used.  Therefore it is
best to support it in LLD as well.

[1] https://sourceware.org/binutils/docs/ld/Options.html#Options

llvm-svn: 232183
2015-03-13 18:15:01 +00:00
Meador Inge 28dac858cd LinkerScript: Add evaluation of the EXTERN command
This patch implements evaluation of the GNU ld EXTERN command.

llvm-svn: 232111
2015-03-12 21:55:55 +00:00
Shankar Easwaran c5ed819b02 [ELF] Return error from invalid linker script parse.
llvm-svn: 192360
2013-10-10 16:59:53 +00:00