I am looking for a C or C++ library for parsing and loading (i.e. performing relocations) on ELF files. This is for an embedded project and ideally I'd like it to support multiple CPU platforms, i.e. Arm, MIPS, PPC, x86, etc. I've found plenty of references for parsing ELF files, but so far cannot find anything I can use to do relocations. So far I've looked at these libraries and found them lacking:

  • BFD in Binutils -- Confusing API and lack of documentation
  • radare2 -- contains an ELF library, but I don't see any code to do relocations
  • ELFIO -- Only supports x86

Can anyone suggest a library containing code I could use?

  • 1
    you do understand that each different type of CPU requires different code, so a library supporting multiple CPUs would have multiple entry points to functions that do the same thing. To distinguish between those functions means that the name of the function would be different, depending on which CPU that specific function supports. If your working with a OS, like linux, then the OS will handle the relocating, etc for you. – user3629249 Jul 15 '16 at 14:52
  • try: softwarerecs.stackexchange.com/a/37720/27945 – user27945 Nov 26 '16 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.