[Gc] Re: libgcj missing symbol __data_start
BGB
cr88192 at hotmail.com
Wed Aug 26 11:25:06 PDT 2009
----- Original Message -----
From: "Boehm, Hans" <hans.boehm at hp.com>
To: "Andreas Krebbel" <krebbel at linux.vnet.ibm.com>; "Andrew Haley"
<aph at redhat.com>
Cc: <gcc-patches at gcc.gnu.org>; <java at gcc.gnu.org>; <gc at linux.hpl.hp.com>
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).
More information about the Gc
mailing list