jni and static libgcj and friends?

Alexandre Oliva aoliva@redhat.com
Mon Feb 25 08:54:00 GMT 2002


On Feb 25, 2002, Jeff Sturm <jsturm@one-point.com> wrote:

> On Mon, 25 Feb 2002, Martin Kahlert wrote:
>> Has anybody an idea what could cause this?

> Somehow I missed your first message... so ld was saying:

> ld: fatal: relocations remain against allocatable but non-writable
> sections

This is a result of trying to create a shared library out of non-PIC.
That's Solaris with Sun ld, right?  Make sure you only use PIC for
shared libraries.  Ugly work arounds include using GNU ld, that
doesn't flag an error (which is wrong, but it serves as a
work-around), or linking with -mimpure-text.  Both of these
alternatives result in less efficient dynamic libraries, both in terms
of load time and of memory use, because relocations have to be
performed in the text section at load time, and so it can't be shared
by multiple processes.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Java mailing list