Subject: Re: compiler madness
To: None <eeh@netbsd.org>
From: James Chacon <jchacon@genuity.net>
List: port-sparc64
Date: 03/29/2002 16:29:39
The linker calls __start
Why is start in crt0? That obviously conflicts with the users namespace.
James
>
>
>| Am 28. Mar 2002 um 18:30 MET schrieb eeh@netbsd.org:
>| > 1) How and when did you compile the innd that is segfaulting?
>|
>| Hm, what do you mean by "when"? I hope the phase of the moon has
>| got nothing to do with it. I tried with and without optimization,
>| same result.
>
>Was this package built before or after your upgrade?
>
>| (gdb) run
>| Starting program: /usr/pkgsrc/news/inn/work.sparc64/inn-2.3.2/innd/./innd -d
>|
>| Program received signal SIGSEGV, Segmentation fault.
>| 0x1382a4 in TMRinit () at timer.c:70
>| 70 count[i] = start[i] = cumulative[i] = 0;
>| (gdb) info all-registers
>| g0 0x0 0
>| g1 0x474 1140
>| g2 0x10b800 1095680
>| g3 0x29d800 2742272
>| g4 0x0 0
>| g5 0x0 0
>| g6 0x0 0
>| g7 0x0 0
>| o0 0x29daec 2743020
>| o1 0x10bab8 1096376
>| o2 0x29db24 2743076
>| o3 0x0 0
>| o4 0x0 0
>| o5 0x29d800 2742272
>
>| $1 = 0
>| (gdb) p count
>| $2 = {0 <repeats 13 times>}
>| (gdb) p start
>
>Oh, I think I know what's going on here. The name `start' happens to
>be the same as a symbol in crt0, which is for the start of code. The
>linker merges the two symbols and your array ends up in the bottom
>of the text segment, which happens to be read-only.
>
>Hm. I wonder if the linker still uses `start' as the entry vector.
>
>Yes, file a toolchain pr.
>
>Eduardo
>
>
>
>