[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ppc patch] shrink grubof build
From: |
Hollis Blanchard |
Subject: |
Re: [ppc patch] shrink grubof build |
Date: |
Tue, 14 Sep 2004 09:47:56 -0500 |
On Sep 14, 2004, at 9:00 AM, Hollis Blanchard wrote:
On Sep 14, 2004, at 6:17 AM, Stefan Reinauer wrote:
* Hollis Blanchard <address@hidden> [040914 02:59]:
This patch shrinks the size of the 'grubof' binary from >300K to ~60K
2004-09-13 Hollis Blanchard <address@hidden>
* conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): add -N and -S
I see that -S makes sense (stripping debugger symbols), but -N
(setting
text sections to writable) I don't fully understand...
That's what Marco and I said as well. :) However, that flag is used in
the i386 build, and shrinks the PPC binary significantly as well.
grubof: 351219 bytes
grubof -S: 166131 bytes; objcopy -O binary: 146224 bytes
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg
Align
LOAD 0x010000 0x00200000 0x00200000 0x13d68 0x13d68 R E
0x10000
LOAD 0x023d68 0x00223d68 0x00223d68 0x001b0 0x08bd4 RW
0x10000
grubof -S -N: 100723 bytes; objcopy -O binary: 81688 bytes
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg
Align
LOAD 0x000080 0x00200000 0x00200000 0x13f18 0x1c93c RWE 0x10
I'm noticing the offset changed significantly, while obviously the
in-memory size didn't. The ppc ABI (32- and 64-bit) say "Virtual
addresses and file offsets for the 64-bit PowerPC processor family
segments are congruent modulo 64 Kbytes (0x10000) or larger powers of
2." Apparently -N means "ignore the ABI" here, which is fine for us.
(Aside: Old World Open Firmware won't read a filesystem on a partition
(only on a whole volume like a floppy disk), so OF can't load an ELF
for me. To work around that I have a dumb stage1 (from the quik
bootloader) that loads a blocklist into memory. So I objcopy -O binary
and record that blocklist.)
I still can't fully explain why there is such a drastic difference in
the binary output size (rather than the ELF size).
-Hollis
Re: [ppc patch] shrink grubof build, Marco Gerards, 2004/09/14