How does linking work under Solaris?

Bonz bonzini@gnu.org
Tue Dec 5 11:26:00 GMT 2000


GNU Smalltalk (which I mantain) uses mmap with MAP_FIXED to allocate its
heaps.  If they are allocated in a precise area (around 0xef7c000) it
breaks multiplication and (I think, I have no machine to check this
claim) any other call to libc.  This happens on smaller test programs
too; here is what a user wrote:

> Well I tried a few things:
> 1. I wrote a stupid little prog. It does a simple multiplication
> [...] and once again .umul is called. .umul calls the _PROCEDURE_
> LINKAGE_TABLE and there is the call to the same absolute address as
> before: 0xef7c2f7c. I did with gcc and c89 (ansi c compiler).
>
> Than I wrote a little mmap application that makes 2 mmaps like yours
> one on 0xdf770000 and the following one at 0xef770000, after the 2nd
mmap
> a nice multiplication. I compiled this prog with both gcc and c89.
> Exactly the same behavior, exactly the same problem [i.e. crash with a

> SIGSEGV as soon as PC=0xef7c2f7c].

Why does dynamic linking use absolute addresses rather than position
independent code? If it is not dynamic linking, why isn't the area where
I do the mmaps protected? One other Solaris user reported that the Sun
compiler creates a working executable -- was it just luck or not?

Please reply by personal e-mail. Thanks in advance.

Paolo Bonzini


More information about the Binutils mailing list