Sehr geehrter Herr fredvs,

Sie schrieben am Wed, 16 Aug 2017 17:50:29 -0500 (CDT):

> I am not sure about the terminology but let'say:

Yes.

> - Staticaly Linking = use libX11.so = store some data in ELF, more safe...

Static linking means to insert at least all of the code (& possibly data)
from the library the program uses directly & "physically" into the program
file itself. A statically linked program does not need any of the libraries
it's (statically) linked to.

> - Dynamicaly Linking = use libX11.so.6 = more freedom, can use dynlib....

Dynamic linking means to insert
- a symbol table with library references &
- placeholders for any symbol references
"physically" into the program. The first measure then allows a "linking
loader" to gather all the relevant information to access all the library
symbols the program uses, and the second one allows the loader to insert
appropriate access code in place of the placeholders, "fixing up" the
program to allow it to access the library code directly after the library
has been loaded into memeory along with the program code.

Yet another method to use libraries dynamically, which doesn't seem to have
a commonly used name of its own, is to build code into the program that
can analyze a needed library, have it loaded into memory (either privately
for the program only or "publically" for access by other programs too), find
the pertinent symbols and set up any means needed to access them correctly.

While the former variant of dynamic linking can be fully performed by the
operating system, the latter has to be fully controlled by the program
using the linked library, although the system can provide means to support
the neccessary activities.

> That said, both linkings have advantages.
> 
> And I am not sure for libX11 that Staticaly Linking is the one I would
> choose.

Hardly, indeed. Any statically linked program contains _all_ of the library
code it uses, leading to multiple copies of this code in memory if several
such programs run in parallel, thus wasting memory. And libX11 will waste a
lot of memory.

> So, IMHO and, please, without opening any war, I would vote in a utopic
> world for a compiler that gives me the choice.

No war to "open", as this is by no means "utopic" - the Linux / Unix /
Windows linkers all give you the choice how to link your programs, you can
even mix static and both variants of dynamic linking in any single program.

> But, yes, I agree, it is twice the work to develop the package (and twice
> problems to debug it).

How? THere's _no_ more work needed for either method - they simply differ
by linker options.

> But do not worry, this will never append for fpc.

In fact, it already does. (Implying you wanted to write "apply" instead of
"append".)

-- 
-- 
(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, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to