[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/14149] The _end symbol is not properly aligned

From: ccoutant at google dot com
Subject: [Bug gold/14149] The _end symbol is not properly aligned
Date: Wed, 23 May 2012 21:59:08 +0000


--- Comment #1 from Cary Coutant <ccoutant at google dot com> 2012-05-23 
21:59:08 UTC ---
> Note that _end has a mis-aligned address.  This causes jemalloc (the malloc in
> FreeBSD's libc) to corrupt it's internal RB trees as it assumes the start of
> the heap is aligned on at least an even address.  Using ld.bfd results in _end
> being aligned on an 8-byte boundary.  The linker scripts for ld.bfd for 
> FreeBSD
> explicitly pad _end to an 8 byte boundary, so I assume it is a bug for the 
> gold
> linker to not do this.

Not that I'm arguing the linker shouldn't do this, but I can't find
anything in the x86 ABI or the AMD64 ABI documents that guarantee _end
should have any specific alignment. The AMD64 ABI supplement says
nothing about _end, and the Intel386 Sys V ABI supplement says only

extern _end;
   This symbol refers neither to a routine nor to a location with interesting
   contents. Instead, its address must correspond to the beginning of a
   program’s dynamic allocation area, called the heap. Typically, the heap
   begins immediately after the data segment of the program’s
   executable file.

It seems to me that your malloc implementation is relying on a
behavior of the GNU linker that is not guaranteed by the ABI. Even if
we do change gold to match the GNU ld behavior, I'd still recommend
that you change the implementation to rely only on the documented ABI.


Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]