-
chevron_right
Linker Test
Stefan · Sunday, 5 December, 2021 - 07:13
Eine Datei erstellen test.c
int test(int f) {
return 0;
}
gcc -c test.c -o test.o ; gcc --shared test.o -o test.so ; ldd test.so
statically linked
Anpassen der Datei test.c
#include "string.h"
int test(int f) {
char* x = strdup("ABC");
return 0;
}
gcc -c test.c -o test.o ; gcc --shared test.o -o test.so ; ldd test.so
linux-vdso.so.1 (0x00007fff883d0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1ad7d4c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1ad7f37000)