[lld] r309829 - [ELF] When the code segment is the last, align it to the page boundary

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 05:04:04 PDT 2017


On Wed, Aug 02, 2017 at 04:35:00PM -0000, Petr Hosek via llvm-commits wrote:
> Author: phosek
> Date: Wed Aug  2 09:35:00 2017
> New Revision: 309829
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=309829&view=rev
> Log:
> [ELF] When the code segment is the last, align it to the page boundary
> 
> When the data segment is the last segment, it is correct to leave
> it unaligned. However, when the code segment is the last segment,
> it should be aligned to the page boundary to avoid loading the
> non-segment parts of the ELF file at the end of the file.
> 
> Differential Revision: https://reviews.llvm.org/D33630

As I wrote on Phabricator, I don't find this behavior that desirable. It
will waste on average 2KB per binary or more, that easily sums up. The commit
message is also misleading, it doesn't align so much as it does add
padding.

Joerg


More information about the llvm-commits mailing list