http://sourceware.org/bugzilla/show_bug.cgi?id=14149
--- 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 this: 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. -cary -- 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. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils