Dynamic Class Loading Idea

Craig Black craigblack2 at cox.net
Sat Nov 3 09:28:13 PDT 2007


"Vladimir Panteleev" <thecybershadow at gmail.com> wrote in message 
news:op.t0741htdm02fvl at cybershadow...
> On Sat, 03 Nov 2007 15:40:34 +0200, Craig Black <craigblack2 at cox.net> 
> wrote:
>
>>> I like DDL's approach, in which it acts as a run-time linker. It uses
>>> relocation data in OBJ files to find address references and fix them 
>>> (thus
>>> "relocating" the code for any memory address) when loading the 
>>> libraries.
>>
>> Does this relocation use function pointers?
>
> "Relocation data" is just a list of addresses which have pointers. I 
> didn't express myself correctly, relocation data isn't used to resolve 
> cross-module references. It is only used to "move" that code at a random 
> address. To do that, the linker/loader adds the address to which the code 
> is relocated to each DWORD the address of which is specified in the 
> relocation list.
>
> References are resolved by having a list of symbols, and each symbol 
> having an address of where in this module it's referenced. The 
> linker/loader then simply places the address of each symbol into the 
> referenced locations.
>
> Since this is done before any code in the module is executed, it should be 
> possible to implement on all platforms (except platforms where code and 
> data is strictly separated).
>
> -- 
> Best regards,
> Vladimir                          mailto:thecybershadow at gmail.com

Thanks for the explanation.  So then modules can be loaded at run time, and 
this system effectively eliminates function pointers? 




More information about the Digitalmars-d mailing list