[llvm-dev] Object file tools

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 9 12:43:24 PST 2017


On Mon, Jan 9, 2017 at 12:36 PM, Dmitry Golovin via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hello!
>
> Does LLVM provide tools for working with object files? I'm particularly interested in strip and elfcopy tools. Are they a thing? Can they be implemented? Or maybe they are already implemented under different names that I don't know about?
>

You mean objcopy(1)? Anyway, no, LLVM doesn't implement replacements
for strip/objcopy.
The main issue is that lib/Object only knows how to read object files
but not how to manipulate them. So, as a first step LLVM should grow
this support (in lib/Object or in another library).

> I suppose that with LLD there was a lot of code written for working with ELF, COFF and MachO, so it would be relatively easy to implement llvm-strip and llvm-objcopy.
>

Not sure how much code can be actually factored out. There's some
commonality (e.g. between a subset of the features of objcopy and `ld
-r`) but it's an open question how much of it can be reused.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-dev mailing list