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

Re: [MiNT] Shareable/loadable libraries: a preliminary document



On Saturday 30 October 2004 23:02, Philipp Donzé wrote:

Hi Philipp

PC relative addressing is only used by PC for jumps and calls,
which you have to switch off anyhow for larger programs.

For text, data and bss, it uses the 'area' concept.
An area is a piece of memory that can not be split further due to
the use of displacements without fix up information.

Functions are each put in their own area.
Constant data, anonymous data (literals) normal data and bss
can be put in any number of areas.

Addressing of data and bss is done by loading the address of the area
in a register und use d(An) mode to access its parts.

The loading of the address is done by using long absolute mode,
in the object file accompanied by a fixup pointing to its name
or internal identification.

The function of the linker is to pick up all referenced areas
and put them together in their target segment (TEXT, DATA BSS)
Then all fixable references are fixed up.

In a paged envireonment the loader can of course fill up pages
with areas of the same target.

It is this 'area' concept that eliminates the need for a
difference between a object file and a library in Pure C.

I like it :-)

> To avoid this problem you can simply forbidd the usage of PC relative
> addressing modes. IMO a bad solution!

Within a single text area PC relative can be maintained.

-- 
Groeten; Regards.
Henk Robbers.    mailto:h.robbers@chello.nl
                   http://members.ams.chello.nl/h.robbers/Home.html
Interactive disassembler:     TT-Digger;  http://digger.atari.org
A Home Cooked teXt editor:    AHCX