[PATCH] D22674: [ELF] - Linkerscript: implemented ALIGN modificatior of output sections.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 00:17:04 PDT 2016


grimar added a comment.

In https://reviews.llvm.org/D22674#493846, @ruiu wrote:

> ALIGN shouldn't be implemented as a special feature that is allowed only after ":" in SECTIONS subcommands. It is a generic function as described in https://sourceware.org/binutils/docs/ld/Builtin-Functions.html#Builtin-Functions.
>
> If you support an expression after ":" in the context and the ALIGN built-in function, this feature is going to naturally be supported.


I think we have different typese of ALIGN here. One is a output section description modificator.
3.6.1 Output Section Description explicitly says that ALIGN is a part of description.
(https://sourceware.org/binutils/docs/ld/Output-Section-Description.html#Output-Section-Description).
That is what this patch implements.

The other ALIGN is a generic function, as you mentioned.

I think location counter value in output secrion description is "global", but
in expressions inside declaration is "local" (relative to OutSec start address).
So ALIGN in declarations allows to use global location counter and layout the section
properly.

Because of above I think patch implements it in a correct way.


https://reviews.llvm.org/D22674





More information about the llvm-commits mailing list