Skip to content
Advertisement

Tag: relocation

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

ELF label address

I have the following code in .s file: Its object file has the following: After linking, it becomes: How does the argument 0x0 to pushq at byte 20 of the object file gets converted to 0x400578 in the final executable? Which section of the object file contains this information? Answer You answered your own question: After linking…. Here is a

Why GOT entry offset appears wrong?

I wrote simple shared library: Compiled/built: Disassembled, to see how some_func is referenced: Looked where .got.plt is located: What is the relocation: In 6aa-6bb we get absolute location of GOT: 6aa + 0x200956 = 0x201000 That agrees with readelf -S libtest.so ‘s output. We skip 3 reserved bytes in GOT(functions-related) and determine that some_func’s absolute address should be found at

Advertisement