From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 10 03:17:11 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6056916A4CE; Sat, 10 Jan 2004 03:17:11 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0646143D4C; Sat, 10 Jan 2004 03:17:09 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id B75B75327; Sat, 10 Jan 2004 12:17:08 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id DABF2530E; Sat, 10 Jan 2004 12:16:59 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 2C3E133C9A; Sat, 10 Jan 2004 12:16:59 +0100 (CET) To: Alfred Perlstein References: <20040110050033.GP9623@elvis.mu.org> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sat, 10 Jan 2004 12:16:58 +0100 In-Reply-To: <20040110050033.GP9623@elvis.mu.org> (Alfred Perlstein's message of "Fri, 9 Jan 2004 21:00:33 -0800") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.1 required=5.0 tests=RCVD_IN_SORBS autolearn=no version=2.60 cc: hackers@freebsd.org Subject: Re: help with linking please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2004 11:17:11 -0000 Alfred Perlstein writes: > I'm having a hell of a time doing this so I can produce a static > .o or .a with most of the symbols stripped. Two problems seem to be > that even if I use "ld -r -o main.o obj1.o obj2.c libfoo.a" then I > can not strip symbols in obj1.o that are referenced from obj2.o > even after I combine the object files. You can link all your object files into one: $ ld -r -o all.o foo.o bar.o baz.o then strip unwanted symbols with {objcopy,strip} -N (or better yet, use {objcopy,strip} -K to strip all symbols except the ones you want to export) this is precisely what we do with klds to reduce namespace pollution. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no