2 ms·
I've written an ELF object file exporter as part of a Ghidra extension [1]. It's a bit finicky to get it right (toolchains assume that object files are valid
by boricj 3y ago
I've written an ELF object file exporter as part of a Ghidra
extension [1]. It's a bit finicky to get it right (toolchains assume that object files are valid and don't have much in the way of diagnostics), but these are fairly simple under the hood. Section bytes, symbols and relocations, with some headers and metadata to wrap these up...
It's a bit of a shame that object files aren't more of a lingua franca of toolchains in practice. Embedding binary blobs inside a program in a portable way is still a mess today.
[1] https://github.com/boricj/ghidra-delinker-extension/tree/master/src/main/java/ghidra/app/util/exporter https://github.com/boricj/ghidra-delinker-extension/tree/mas...