Elf and linking
I am cross compiling for an ARM device and don't have access to the dloopen/dlsym etc functions to manipulate shared ELF libraries - what I do have is access to libelf.
I am wondering if anyone has experience with libelf, or manually resolving symbols in shared libraries?
I have a simple shared library (for testing) with two simple functions in it, and no external dependencies. The 'add' function just adds one to the number that you pass it and returns it, and the 'subtract' function returns the input minus one.
After I have loaded the .text and .data section to memory, how can I find out the addresses of the two functions (similar to the dlsym( lib, 'subtract'); type call that would be used if dlopen was available).
Any help greatly appreciated.
This is immensely offtopic.
At the very least, it belongs in Linux programming, but 5 seconds on google would show that libelf has its own support list:
Thanks CWR, though why so nasty?
My ARM device has nothing to do with linux, and ELF isn't linux specific.
Also, i have been googling ELF and linkers for a few weeks, and for some reason have managed to miss this link.
Hey, that's just how he rolls.
Also, this isn't quite on the topic of C programming. Sorry I can't really help with your question, though. The only ELF I know have pointy ears. :)
Yeah, sorry, if its any consolation, development is all in c - plus there are many,many members here so i hoped someone could help.
Thanks guys - the link from CWR is an email address so I will try there.
Sorry for seeming nasty.
I googled for libelf and clicked "I'm feeling lucky" to get that link. It was quite skillful :p
You're right that ELF isn't linux specific, but given that we have "C Programming", "Windows Programming" and "Linux Programming", someone with knowledge of what ELF is would probably know that it's more appropriate to post something related to ELF in a Linux forum given the above choices.
Since you gave no indication that you'd looked for the answer anywhere else, my reply may have sounded harsh. Had you said something like "I've looked at resource X, Y, and Z but found nothing", I'd have probably replied more amicably.
No problem. I would have done the same :). I'll try the linux board too.