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

Meador Inge via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 09:34:58 PST 2016


On Wed, Nov 23, 2016 at 12:19:26PM -0500, Rafael EspĂ­ndola wrote:
> On 23 November 2016 at 11:15, Meador Inge <meadori at codesourcery.com> wrote:
> > On Wed, Nov 23, 2016 at 09:19:37AM -0500, Rafael EspĂ­ndola via llvm-commits wrote:
> >
> >> I would have a small preference for 2MB on X86_64 and 4MB on x86 (if
> >> anyone cares about x86).
> >
> > Out curiosity, why?
> >
> > On Linux, I see GNU LD uses `0x400000` for x86_64 and AArch64.
> > It uses `0x08048000` for i386.  It would be nice to understand
> > why GNU LD uses those particular values.
> 
> IMHO one of the things that has benefitted lld a lot so far is
> avoiding cargo cult. If anything, not doing something just because
> bfd/gold does it means in the worst case we get to find out why (and
> document) they were doing it.

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).

> In the thread you posted I cannot find out why the value was chosen.
> Have I missed something?

I couldn't find the "why" in that thread either.  The thread died with:
"I don't think it matters too much."

The final commit was:

https://sourceware.org/ml/binutils/2001-06/msg00130.html

I realize now that my original mail made it seem like the "why" was in
there -- sorry about that.  I just wanted to post the original commit mail
for when LD switched over to 0x400000.

-- 
Meador Inge
meadori at codesourcery.com
CodeSourcery / Mentor Embedded


More information about the llvm-commits mailing list