This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgcj missing symbol __data_start



----- Original Message ----- From: "Boehm, Hans" <hans.boehm@hp.com>
To: "Andreas Krebbel" <krebbel@linux.vnet.ibm.com>; "Andrew Haley" <aph@redhat.com>
Cc: <gcc-patches@gcc.gnu.org>; <java@gcc.gnu.org>; <gc@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).



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]