Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Dec 2000 13:55:29 -0600
From:      "G. Adam Stanislav" <adam@whizkidtech.net>
To:        Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc:        Greg Lehey <grog@lemis.com>, chat@FreeBSD.ORG
Subject:   Re: Removing GNU from kernel
Message-ID:  <20001231135529.A1831@whizkidtech.net>
In-Reply-To: <20001231172405.A5383@curry.mchp.siemens.de>; from andre.albsmeier@mchp.siemens.de on Sun, Dec 31, 2000 at 05:24:05PM %2B0100
References:  <20001230122630.A247@whizkidtech.net> <20001231121623.D3496@wantadilla.lemis.com> <20001231124556.A99615@curry.mchp.siemens.de> <20001231172405.A5383@curry.mchp.siemens.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001231135529.A1831>