Skip to content
Advertisement

Tag: dynamic-linking

How are external symbols of a shared library resolved in the main program?

I’ve been reading a lot about the semantics of load-time linking of shared libraries and one thing that I’m having trouble understanding is how can the main program make references to functions defined in shared libraries? For example, say I have this code myShared.sh main.c I understand that, since shared libraries cannot make any assertions about where they will be

ld undefined reference, despite library found and symbols exported

Been fighting with this on and off for 48 hours now; I’m still getting undefined reference errors when attempting to link a dynamic library with its dependency – despite all exports existing, and the library being found successfully. Scenario: libmemory (C++) – exports functions with extern “C” libstring (C) – exports functions, imports from libmemory libmemory builds successfully: libstring compiles

Compiling pintool with sqlite3 database

I am writing a pintool to instrument my binary. I would like to use sqlite3 database to store the information about instructions. I can compile and execute sqlite3 “helloworld” example without any problem. As well I can compile and execute my pintool without sqlite connection. However, whenever I integrate sqlite code in the pintool I have an error: dlopen failed:

How does dynamic linker changes text segment of process?

If i understand correctly when user tries to execute dynamically linked executable (with execve(“foo”, “”, “”)) instead of loading text segment of “foo” dynamic linker is loaded (ld-linux.so.2) and executed. It have to load libraries required for program (“foo”) to run and change some addresses in “foo” and pass control to foo, but how is this acomplished? How (what system

dynamic linker error with rand() function

I already asked a question about this before but with reference to the following code again Why does compiling this result in the following error Why would this happen? How does the linker know that this is just another rand() function I have declared myself but rather an existing version of rand()? Answer One of your header files (<iostream> in

Advertisement