比方說,我有一個名爲libfoo.so的共享庫,它也依賴於另一個名爲libbar.so的共享庫。在libfoo.so中,它提供的唯一功能是存儲兩個整數的類,並且可以返回這兩個整數相加的值。 libfoo.so: // Foo.hpp
class Foo
{
int x, y;
public:
Foo(int x, int y);
int add() const
我有一個非常簡單的ELF可執行文件: $ readelf -l ./plt.out
Elf file type is EXEC (Executable file)
Entry point 0x400338
There are 7 program headers, starting at offset 64
Program Headers:
Type Offset V
這兩個等價或不同(在某種意義上)? myfile1.c #include <stdio.h>
#include <math.h>
//some code here which uses math library
,通常使用編譯gcc $gcc myfile1.c
myfile2.c #include <stdio.h>
//some code here w