|
From: Kailash S. <hs...@gm...> - 2005-08-04 11:52:09
|
Hi all, Currently, the netbsd/i386 port of valgrind is based off a snapshot from the svn taken about 3 weeks ago. It is at a stage where it can compile and load into stage2, where it dies. However there are a lot of problems. Firstly, in netbsd there is no libdl, dlopen dlclose etc are functions that are included in every dynamically linked program automatically. stage1 is compiled as static by default in valgrind-current. If we do this in netbsd, it seems that the auxv structures that we look for in fix_auxv() are not there. Only the first two we place are located. If stage1 is compiled as dynamic, the rest of the auxv structures can be found and fixed up. Loading stage2 as dynamic also, causes severe problems which I have not been able to successfully debug. It just crashes within the linker code, when it tries to process PT_DYNAMIC sections. My suspicion was that loading a dynamic stage2 when stage1 is also dynamic could result in some problems, so I tried a static stage2, which successfully loaded. The problem here in stage 2 is that the break() , used internally by malloc in libc syscalls fail. I dont think netbsd falls back to mmap like in glibc, I have not investigated this closely. If stage2 is static, the big problem is that I am unable to dlopen the tools. Hence I am in a bit of a problem. Should I try my best to get both stage1 and stage2 as dynamic? I am simply not sure how to load stage1 as static and cirumvent the missing auxv problem. NetBSD 2 still uses binutils 2.14. Instead of hacking the default ldscript to our needs, I have modified the Makefile to source a canned one instead. I recently read http://sourceforge.net/mailarchive/message.php?msg_id=3D12190260 , it seems that such an approach may be better at least in my case. Perhaps I should try statically linking as per that proposal? Is there any plans to implement it in the valgrind tree? As we have periodic syncs planned there should be no problems getting changes in from the tree. By the way , what we have so far is available here : https://developer.berlios.de/projects/vg4nbsd/ Thanks and Regards, Kailash |