I filed this as a valgrind bug:
but figured it was worth mentioning here, too.
Any version of valgrind (e.g. the latest release, or from svn)
fails with a message like
valgrind: mmap(0x8048000, 90112) failed in UME with error 22 (Invalid
valgrind: this can be caused by executables with very large text, data or bss
if valgrind was linked using gold instead of ld.
This happens very quickly, before any other output, and happens even with
--tool=none. No other output is shown even with -v.
This was on Ubuntu Hardy on plain old intel hardware.
This was with gold built from the binutils-2.19.1 source tarball.
The core issue is that valgrind runs the linker with --verbose to extract the
linker script. It then seds the linker script to adjust the start address of
the text segment. This works OK with the GNU linker, but it fails with gold,
since gold does not have a default linker script.
With gold it ought to work to simply use the -Ttext option.
In any case, gold will never have a default linker script, so this is not
something that can be fixed in gold.