I'm finishing the implementation of my ELF32 loader. Currently I'm testing everything on GNU/Linux with GCC. My tests consists of load an ELF32 library, look for a specific function and call it.
My loader already supports R_386_32, R_386_PC32, R_386_GLOB_DAT and R_386_JMP_SLOT relocation types, but I have a problem with R_386_PC32 when relocating an external function (e.g. some libc function).
When compiling some shared library, I got a relocation table like this:
Code: Select all
Offset Info Type Sym.Value Sym. Name
000005d2 00000702 R_386_PC32 000005a0 dummy
000005e8 00000202 R_386_PC32 00000000 printf
What could I do to relocate that symbols?