Date: Mon, 20 Aug 2001 01:19:05 -0700 From: Peter Wemm <peter@wemm.org> To: Kris Kennaway <kris@obsecurity.org> Cc: hackers@FreeBSD.ORG Subject: Re: [PATCH] install -s -s(trip-me-harder) Message-ID: <20010820081905.8AE663811@overcee.netplex.com.au> In-Reply-To: <20010820001654.A32129@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kennaway wrote:
> + execlp("strip", "strip", "-s", "-R", ".comment",
> + "-R", ".note", "-N", "gcc2_compiled",
> + to_name, (char *)NULL);
Some comments:
.note: used in ELF branding.
gcc2_compiled: used by gdb
I miss the mcs(1) command (manipulate comment section). Specifically,
you did a 'mcs -c progname' and it compressed and removed any duplicate
comment strings. This was ideal for moving your rcsid strings into from
header files.
Regarding stripping gcc2_compiled.. strip can only filter symbols from
the .symtab and .symstr symbol tables. Since strip already removes both
of those sections, the -N gcc2_compiled is useless. strip cannot modify
the .dynsym/.dynstr in the PT_LOAD sections, so those will stay regardless.
In all, I think this -R gcc2_compiled. is useless unless you're in -X or
-D mode (only remove debug symbols etc).
gdb uses gcc2_compiled to tune its understanding of the generated code.
I suspect the fact that we remove this from the kernel is part of the reason
gdb has so much trouble understanding local variables in gdb -k mode.
(It doesn't understand trap frames either, but thats another story.)
Removing the .note *section* is probably a good idea since it is effectively
useless in an executable. The PT_NOTE executable header is unaffected by
stripping the leftover .note section contents.
Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010820081905.8AE663811>
