I need to be able to add an arbitrary section to an ELF file. I cannot use GPL code in this program, so BFD is out of the question. I can use libelf/gelf to read sections, but the documentation is fairly sparse for these, and I cannot figure out how to add a section. Does anybody know how to do this? I would rather not write my own ELF code.
+3
A:
There's a few (possibly) related answers in this question about ELF file headers. The accepted answer mentioned using objcopy
to add sections to an ELF file, and the BSD bintools claims to have a BSD-licensed implementation of objcopy
that might suit your needs.
Mark Rushakoff
2009-07-06 17:28:48
This looks promising. Thank you
c4757p
2009-07-06 18:51:39
+1
A:
have a look at ELFsh, which is now part of the ERESI project http://www.eresi-project.org/ They have a lot of documentation and cool uses of their tools.
Casimir
2009-07-24 12:18:42