[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Shareable/loadable libraries: a preliminary document
Le Sat, 30 Oct 2004 23:02:30 +0200
Philipp Donzé <philipp.donze@epfl.ch> a écrit:
> > Even if an executable has only one translation table, you know the
> > size of the TEXT segment, so you know if you are relocating an address
> > in the TEXT or the DATA segment, so you can align the segments on MMU
> > pages boundaries.
>
> But this doesn't work if the compiler generates PC relativ addresses.
> E.g. "move.l data(PC), D0" can't work correctly if the assembler does
> not know the correct offset to generate.
> I must admit, I'm new to GCC. But Pure C makes extensive use of PC
> relativ addressing modes. (=> this gives smaller and faster code)
You're right, I did not think of the case of relative to PC. But I don't
know if gcc generate this type of code or not to access the DATA segment.
You talk about PureC, but I don't know if creating dynamic linked
libraries will be possible with it, so I just stick with binutils+gcc.
And on Linux, the segments are aligned on a page boundary to make the TEXT
segment read-only, so either it is done:
- in the file
- no relative to PC when accessing a different segment
--
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Spécialité: Développement, jeux