[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] -fPIC (was: Re: mintlib and shareable libraries)


On Fri, 13 Feb 2004, Patrice Mandin wrote:

> When you have dynamic linking, the .text section of a library is shared
> between all programs (and may be present at different adresses for each
> program) hence the code must be fully PC-independent (-fPIC switch for
> gcc). The .data and .bss sections of the library are attached to the
> program that run it, and each program has private .data and .bss library
> stuff (is it clear ?):

Hmm, PIC? How's the code generated by a current gcc 2.95.x supported by
SpareMiNT dependent on a memory address that is loaded to? We don't have
VM and so we do relocation by each exec(), right?

In case the binary is made using -fPIC. Do we have to do any relocation at

So with -fPIC we can just resolve symbols across libs/executables and we
are done. This is what ELF loader need to do no matter if the VM is or
is not in use.

Is that correct?