Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: dynamic loading on AIX

Zoltan Hidvegi wrote:
>The patch below implements dynamic loading on AIX.  AIX 4.1 and older
>versions do not support the dlopen/dlsym interface.  Instead each object
>has an export and an import list.  The export list contains the list of
>symbols which is provided by the object for use by subsequently loaded
>dynamic modules.

This is interesting.  I've been planning for some time to do a manual
implementation of symbol tables, much like this, to allow dependent module
loading on systems such as SunOS, where symbols from one loaded module
are not available to other modules.  Presumably much of the export list
handling code can be shared between these two uses.

Probably we could also use the export list to reduce the size of
symbol tables on some systems where the symbols are handled completely

>The setterm, refresh and cs external symbols had a conflict with the AIX
>C library or with the curses library so they were renamed to zsetterm,
>zrefresh and zshcs respectively.  `cs' was not changes in the source
>files, instead cs is #defined to zshcs in system.h.  It also #defined ll
>just for consistency, since cs and ll are usually used together.  I chose
>the #define solution since cs is used too many places.

I'd like to do a proper solution to this sort of problem.  I've been
thinking along the lines of automatically #defineing each symbol `foo'
to `name_of_module__foo', thus avoiding clashes with both the C library
and other modules.

>                                             It is possible to
>autogenerate export files from the .pro files, and I do have a script
>which does that, but that creates an export file with 636 symbols for zsh
>and 282 symbols for zle, which the current modules use only 233 symbols
>from zsh.export and 8 symbols from zle.export.  Making the export list
>smaller speeds up loading, reduces memory usage and reduces the risk or
>name collisions.

Perhaps it would be better to add a dummy keyword to the declarations,
to flag symbols for export from the module.


Messages sorted by: Reverse Date, Date, Thread, Author