Cloud
Cloud

Reputation: 19333

Linking/build vernacular/jargon - Dynamic linking methods

I'm familiar with general program memory layout (ie: text segment, data segment, heap, stack, etc), and am trying to find something similar to the description and diagrams here:

http://www.tenouk.com/Bufferoverflowc/Bufferoverflow1c.html

However, I'm trying to figure out three distinct cases, each involving the use of external libraries:

  1. Static linkage of an external library at build time (ie: libtest.a in the ldflags)
  2. Dynamic linkage of an external library at build time (ie: libtest.so in the ldflags)
  3. Dynamic linkage of an external library at run time (ie: libtest.so NOT in the ldflags, but the library is loaded via dlopen()/dlsym() calls)

Can someone more familiar with this explain the memory layout to me? I'm especially interested in the distinction, if any, between cases (2) and (3).

Thank you.

Upvotes: 2

Views: 91

Answers (1)

James McPherson
James McPherson

Reputation: 2576

I've found the Solaris Linker Guide (at http://docs.oracle.com/cd/E26502_01/html/E26507/index.html) to be very well written, and incredibly useful at explaining an immensely complex utility.

Diagram-wise, you might find those at http://docs.oracle.com/cd/E26502_01/html/E26507/chapter6-93046.html#scrolltoc, http://docs.oracle.com/cd/E26502_01/html/E26507/chapter6-34713.html#scrolltoc to be helpful.

Upvotes: 1

Related Questions