[Scummvm-devel] Question regarding DC plugins

Marcus Comstedt marcus at mc.pp.se
Thu Aug 20 17:22:52 CEST 2009


yotam barnoy <yotambarnoy at gmail.com> writes:

> I have a question about the DC plugin implementation, which I'm trying to
> adapt for the PSP.
>
> Specifically, I'm not sure how the ld command line parameters work.
> --retain-symbol-file is supposed to get rid of all symbols not mentioned in
> the plugin.syms file. How then can the executable call anything in the
> shared object file except for loadPlugin, pluginName etc.?

Those are the only functions it can call _by name_ (using dlsym).
However, since the function PLUGIN_getObject (which is one of the few
named functions that can be called) returns a pointer to an instance
of the class PluginObject, any method declared by the base class
PluginObject can be called in this object, even if the implementation
is in the shared objects.  No symbols are needed, just following
pointers. The methods in the PluginObject will then return other
objects, implemented in the shared object, which have a baseclass in
the main executable and can therefore have their methods called.


  // Marcus






More information about the Scummvm-devel mailing list