Sehr geehrter Herr Geldenhuys,

Sie schrieben am Wed, 16 Aug 2017 16:09:47 +0100:

> On 2017-08-16 15:46, fredvs wrote:
> > If you develop from scratch, what are the advantages to link a library
> > vs to load it dynamically ?  
>  From my personal point of view...
>    * dependency is checked at compile time
>    * dependency is checked immediately when you try and run the binary
>    * 'ldd' can accurately report what is required (including versions) to
>      run the binary.

While these are valid arguments, isn't the main reason for pre-linking with
a dynamic library to enable the program loader to insert real adresses for
all references to library elements (to "patch them up"), so there's only
minimal overhead for any reference?
In contrast, a run-time-loaded dynamic library has to be parsed by the
program, references have to be set up as indirections (pointers) to the
elements used, either by setting up a call table or even creating
individual references for each use, and symbols have to be accessed
indirectly through these pointers.

>    * I think creating header translation units are also slightly less
>      effort than runtime loading.

Could you please explain? Don't you need the "header" information in any
case, to know and to tell the compiler how to use any specific library
symbol? (I.e. commonly to call a function or procedure.)

(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
Mit freundlichen Grüßen, S. Schicktanz

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
mseide-msegui-talk mailing list

Reply via email to