|
From: Nicholas N. <nj...@cs...> - 2005-08-26 16:34:24
|
On Fri, 26 Aug 2005, Julian Seward wrote:
> However: I can't get it to link with "-nodefaultlibs -lgcc". The
> invokation and results are shown below. Anybody have any idea what
> I should do? The no-linking-glibc-world is one I know nothing about.
I'd try to get it working on a trivial case before plumbing it into
Valgrind. I don't even know how to do that, though:
[~/grind/trunk5] cat a.c
int main(void)
{
return 0;
}
[~/grind/trunk5] gcc -nodefaultlibs -lgcc a.c
/usr/lib/crt1.o(.text+0x1d): In function `_start':
: undefined reference to `__libc_start_main'
collect2: ld returned 1 exit status
I also tried -nostdlib
[~/grind/trunk5] gcc -nostdlib -lgcc a.c
/lusr/opt/binutils-2.15/bin/ld: warning: cannot find entry symbol
_start; defaulting to 08048094
[~/grind/trunk5] a.out
Segmentation fault
I don't know.
> (For the curious: I replaced all glibc uses by our own implementations,
> apart from three which are non-essential and hard to do:
> localtime_r in VG_(ctime)
> ptrace in m_debugger.c
> fork in m_debugger.c.
> If anyone has enthusiasm to hack up standalone replacements, especially
> for localtime_r, please hack on!)
For ptrace and fork don't we just need trivial wrappers for the syscalls?
Nick
|