From owner-freebsd-chat Sun Dec 31 12:14:59 2000 From owner-freebsd-chat@FreeBSD.ORG Sun Dec 31 12:14:56 2000 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from whizkidtech.net (r6.bfm.org [216.127.220.102]) by hub.freebsd.org (Postfix) with ESMTP id 7B5FF37B400 for ; Sun, 31 Dec 2000 12:14:54 -0800 (PST) Received: (from adam@localhost) by whizkidtech.net (8.9.2/8.9.2) id NAA01874; Sun, 31 Dec 2000 13:56:00 -0600 (CST) (envelope-from adam) Date: Sun, 31 Dec 2000 13:55:29 -0600 From: "G. Adam Stanislav" To: Andre Albsmeier Cc: Greg Lehey , chat@FreeBSD.ORG Subject: Re: Removing GNU from kernel Message-ID: <20001231135529.A1831@whizkidtech.net> References: <20001230122630.A247@whizkidtech.net> <20001231121623.D3496@wantadilla.lemis.com> <20001231124556.A99615@curry.mchp.siemens.de> <20001231172405.A5383@curry.mchp.siemens.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20001231172405.A5383@curry.mchp.siemens.de>; from andre.albsmeier@mchp.siemens.de on Sun, Dec 31, 2000 at 05:24:05PM +0100 Organization: Whiz Kid Technomagic X-URL: http://www.whizkidtech.net/ X-Castle: http://www.redprince.net/ X-Special-Effects: http://www.FilmSFX.com/ X-Operating-System: FreeBSD whizkidtech.net 3.1-RELEASE FreeBSD 3.1-RELEASE Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, Dec 31, 2000 at 05:24:05PM +0100, Andre Albsmeier wrote: >Just for curiosity, I put -fno-ident in /etc/make.conf and >did a make world and built all my kernels. The disk usage >of /usr/obj was reduced from 539527 KB to 532649 KB. This >is about 7MB. Hmmm... Perhaps gcc changed in the more recent versions then. I tried that (with 3.1-RELEASE) and still got 268 occurances of "GCC: (GNU) 2.7.2.1" in my kernel. I did some further testing, by compiling a dummy C program consisting of only "main() {return 0;}" with gcc -S -fno-ident, and this is what it produced (I am adding a tab at the beginning of each line): .file "t.c" .version "01.01" gcc2_compiled.: .text .p2align 2 .globl main .type main,@function main: pushl %ebp movl %esp,%ebp xorl %eax,%eax jmp .L1 .p2align 2,0x90 .L1: leave ret .Lfe1: .size main,.Lfe1-main .ident "GCC: (GNU) 2.7.2.1" Both, the "01.01" and "GCC: (GNU) 2.7.2.1" are still there. Using gcc -o t -fno-ident t.c produced a file whose hex dump includes: 0000 0046 : 00 47 43 43 3A 20 28 47 | 4E 55 29 20 32 2E 37 2E .GCC: (GNU) 2.7. 0000 0047 : 32 2E 31 00 00 47 43 43 | 3A 20 28 47 4E 55 29 20 2.1..GCC: (GNU) 0000 0048 : 32 2E 37 2E 32 2E 31 00 | 00 47 43 43 3A 20 28 47 2.7.2.1..GCC: (G 0000 0049 : 4E 55 29 20 32 2E 37 2E | 32 2E 31 00 00 47 43 43 NU) 2.7.2.1..GCC 0000 004A : 3A 20 28 47 4E 55 29 20 | 32 2E 37 2E 32 2E 31 00 : (GNU) 2.7.2.1. 0000 004B : 08 00 00 00 00 00 00 00 | 01 00 00 00 30 31 2E 30 ............01.0 0000 004C : 31 00 00 00 08 00 00 00 | 00 00 00 00 01 00 00 00 1............... 0000 004D : 30 31 2E 30 31 00 00 00 | 08 00 00 00 00 00 00 00 01.01........... 0000 004E : 01 00 00 00 30 31 2E 30 | 31 00 00 00 08 00 00 00 ....01.01....... 0000 004F : 00 00 00 00 01 00 00 00 | 30 31 2E 30 31 00 00 00 ........01.01... It is there four times! After "strip -R .comment t" the GNU thingie disappeared, but the 01.01 was still there. I then noticed there was a segment named .note in the file. I stripped that, and the 01.01's were gone as well. I then did "strip -R .note kernel" and it further reduced my kernel from 994,864 bytes (with .comment already stripped) to 989,460 bytes. As I have done that while typing this message, I did not try booting with the newly stripped kernel, but will do so after I send this message. What I will do next is rebuild the kernel again, and try "strip -R .comment -R .note kernel" just to see if it all can be done in one pass (I suspect the answer is yes, but I want to test it nonetheless). I shall keep you posted, of course. Adam -- Suppose you were an idiot. Suppose you were a member of Congress. But I'm repeating myself... -- Mark Twain To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message