segfaults on amd64
Robert Millan
rmh at aybabtu.com
Sat Feb 25 15:45:04 UTC 2006
On Sat, Feb 25, 2006 at 03:56:42PM +0100, Robert Millan wrote:
>
> Don't ask me why, but it seems that fixing the problem in binutils (see my last
> commit, binutils_elfosabi.diff) solved the segfaults.
>
> I got hello.c to work now.
There, it came back.
I think to summarise, the problem is:
- When strlen(argv[0]) <= 6, it works fine.
- When strlen(argv[0]) > 6:
- If the executable is dynamicaly linked, runs as if it were ld.so.
- If static, segfaults (SIGILL if you run in ktrace).
Test example:
rmh at orthanc:/tmp$ ./test
argc = 1
argv[0] = ./test
rmh at orthanc:/tmp$ /tmp/test
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked `ld.so', the helper program for shared library executables.
[...]
I suspect it has something to do with missing changes that freebsd didn't push
into upstream binutils.
--
Robert Millan
More information about the Glibc-bsd-devel
mailing list