Re: libgcj missing symbol __data_start

"BGB" <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.java.devel,gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
----- Original Message ----- 
From: "Boehm, Hans" <[email protected]>
To: "Andreas Krebbel" <[email protected]>; "Andrew Haley" 
<[email protected]>
Cc: <[email protected]>; <[email protected]>; <[email protected]>
Sent: Wednesday, August 26, 2009 10:41 AM
Subject: RE: libgcj missing symbol __data_start


> [Adding the gc mailing list, since this still applies to current gc 
> versions.]

<snip>

<--

Unfortunately, I don't think this is the right solution.  If I understand 
correctly, DATASTART will end up as zero, which will cause the collector to 
start tracing at location zero, which seems unlikely to work, if the value 
is needed.  I suspect the value isn't actually used when dl_iterate_phdr is 
available and the application is dynamically linked, but still ...

Another popular option on other architectures is to define 
SEARCH_FOR_DATA_START instead of defining DATASTART to have a specific 
value.  This creates a weak reference to __data_start.  If that ends up 
being zero, the collector will walk the address space backwards starting at 
__end until an access faults.  It will assume that that's the beginning of 
the main data segment.  That might make debugging a bit harder because of 
the extra SIGSEGV at startup, but I still think it's a much better solution, 
assuming it actually works.  If it doesn't, this at least needs a 
conspicuous FIXME comment, since it's pretty clearly doing the wrong thing. 
In any case, I think this should also go in the upstream source.

Hans

-->


although not directly related, I will note that for my GC on Windows, I 
ended up switching to a strategy of using the ToolHelp library to iterate 
over the loaded modules and find their used address ranges...

it also makes the GC work more reliably as well...

I am not sure if something similar can be done on Linux (I have not looked 
into this).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.