This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: [RFC] Boehm GC changes for uClibc.


Joakim Tjernlund wrote:



-----Original Message-----
From: uclibc-bounces@uclibc.org [mailto:uclibc-bounces@uclibc.org] On Behalf Of David Daney
Sent: den 17 april 2006 20:39
To: Java Patch List
Cc: uclibc@uclibc.org; Hans Boehm
Subject: [RFC] Boehm GC changes for uClibc.


I am trying to get libgcj running under uClibc. This patch is necessary
to get a simple 'Hello World' program to run. Other patches will be needed for full functionality, but this one is a good start.


The problem is the the Boehm GC is expecting to be able to find the link_map via the DT_DEBUG dynamic tag. The uClibc dynamic loader does not initialize DT_DEBUG (at least for MIPS) because doing so would dirty the page where it resides.


Yes, MIPS is the only arch not setting DT_DEBUG. MIPS uses
DT_MIPS_RLD_MAP instead. Look at dl-sysdep.h

I will investigate doing that instead.



BTW, Whats the problem if MIPS also sets DT_DEBUG?



As I said before, it dirties the page where DT_DEBUG resides. The DYNAMIC section lays within a read-only LOAD section. Modifying it requires that you temporarily make it writable, modify the DT_DEBUG tag, and then make it read-only. This dirties a page. There was a several month period a couple of years ago when uClibc did that. Evidently it was deemed a bad thing.



The patch gains access the link_map via the global symbol _dl_debug_addr. Without the patch there is a SIGSEGV dereferencing the zero valued DT_DEBUG tag while doing _Jv_CreateJavaVM().


_dl_debug_addr is misnamed in uClibc. It should be named _r_debug instead.

Yes, I discovered that too.


On top of that I can't remember if _r_debug is a glibc thing or if
it is a "standard" symbol. If it is a glibc symbol it might be removed at some point.
If you must use _dl_debug_addr then please rename it and make if work as
in glibc first.


Unfortunately I need to make it work with uClibc-0.9.27, so a retroactive change is not possible. In the interests of making the changes to Boehm GC as small and clean as possible, I want to stay away from hacking up the uClibc trunk and having to support two different ways of doing it.


David Daney.


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