From owner-freebsd-hackers Mon Aug 20 1:19:12 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id D512537B410 for ; Mon, 20 Aug 2001 01:19:06 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f7K8J5M67698 for ; Mon, 20 Aug 2001 01:19:05 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 8AE663811; Mon, 20 Aug 2001 01:19:05 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Kris Kennaway Cc: hackers@FreeBSD.ORG Subject: Re: [PATCH] install -s -s(trip-me-harder) In-Reply-To: <20010820001654.A32129@xor.obsecurity.org> Date: Mon, 20 Aug 2001 01:19:05 -0700 From: Peter Wemm Message-Id: <20010820081905.8AE663811@overcee.netplex.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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