Add support for SEGMENT_START.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 28 Jul 2016 18:16:24 +0000 (18:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 28 Jul 2016 18:16:24 +0000 (18:16 +0000)
commit54c145ce0e2fd205036cd8e02275451bac7c3819
treea3503a12eee7a38c4fade03c26cef1cb1cef5409
parent6a742846525d89e8e53972919ab6ffdde6fedeec
Add support for SEGMENT_START.

This is a bit of an odd feature. It is normally used in

. = SEGMENT_START(seg, val);

In bfd it evaluates to val or to the value of the corresponding
-T<seg>-segment. Note that the -T<seg>-segment in bfd doesn't actually
change the segment address, just the value this evaluates too,
including in the default linker script.

In gold the -T<seg>-segment options do change the segment address and
seeing this expressions in linker scripts disables the options.

For new this just always evaluates the expression to val.

llvm-svn: 277014
lld/ELF/LinkerScript.cpp
lld/test/ELF/linkerscript/Inputs/segment-start.script [new file with mode: 0644]
lld/test/ELF/linkerscript/segment-start.s [new file with mode: 0644]