On Sun, Apr 10, 2011 at 4:32 AM, Martin Pieuchot <mpieuc...@nolizard.org> wrote:
> Without the "-a" option strings(1) doesn't scan the file entirely [0].

I see, I never realized strings(1) handled executables specially... I
always assumed the -a behavior was the default anyway.  My bad.

> I would say to not create empty files, I just used the same method as
> for nm.

I was thinking something like sys/kern/exec_elf*.c, but mimicking
nm(1) makes sense too.

> The question here is more about *how* to reuse nm(1)'s elf.c in a smart
> way (for nm, ranlib, strings...). I could have used the same file (diff
> below) but that makes the binary twice bigger in size (but still less
> than 5% of the size of the actual strings on amd64).

I'm in favor of just reusing the existing nm(1) elf.c code for
simplicity.  If a lot of tools use the same code, we can move the code
to libutil or something so it can be shared.  (Maybe import a
BSD-licensed libelf to base?)

Reply via email to