Hi guys
I am trying to call functions from the C library in my ASM code. For example I prefer to use printf before doing a syscall to write.
So I disassembled a simple binary and could see that a call to printf derives to the PLT section.
That if I'm not mistaken is a link table, since printf being outside my code, it has to create the address in the execution. Of course when trying to call printf with a callq printf@plt in my ASM code it doesn't work, I haven't linked any libraries.
Well, what would be the correct way to link all those libraries, through clang or ld?
Some example of what would be the best way.
Thanks guys.
I am trying to call functions from the C library in my ASM code. For example I prefer to use printf before doing a syscall to write.
So I disassembled a simple binary and could see that a call to printf derives to the PLT section.
That if I'm not mistaken is a link table, since printf being outside my code, it has to create the address in the execution. Of course when trying to call printf with a callq printf@plt in my ASM code it doesn't work, I haven't linked any libraries.
Well, what would be the correct way to link all those libraries, through clang or ld?
Some example of what would be the best way.
Thanks guys.