[PATCH] D27042: lld: Default image base address to 0x400000

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 10:07:12 PST 2016


On 24 November 2016 at 12:57, Rafael EspĂ­ndola via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>> I agree wholeheartedly RE: cargo cult.  I didn't mean to imply that we
>> should just blindly copy every decision that was made for ld/gold.  I do
>> think it worthwhile to understand where we diverge and why, though.
>>
>> My original question was: why 2MB?  I am just curious how we arrived at
>> that number (for my own education).
>
> Ed covered the "why at least 2MB and aligned at 2MB". The why not 4MB
> is mainly so that we have a chance of finding out why it might be
> significant. If we just did what bfd did we would never know if it was
> important or incidental. With 2MB we are covering the know uses. If
> the need for 4MB never comes up we will know it was incidental (or at
> least historical).

We know that it should be 4MB for i386. As I've been looking at this
I've not been able to find anything to suggest 4MB would be beneficial
on x86-64, arm64, or MIPS. 2MB, however, is a good choice for the
three of them for the same reason as x86-64.

I can only speculate that the authors of the GNU linkers preferred to
use a common value across multiple architectures.


More information about the llvm-commits mailing list