* [PATCH] fix ppc kernels after build-id addition
@ 2007-07-25 12:17 Meelis Roos
2007-07-26 5:01 ` Paul Mackerras
0 siblings, 1 reply; 3+ messages in thread
From: Meelis Roos @ 2007-07-25 12:17 UTC (permalink / raw)
To: linuxppc-dev, Linux Kernel list
This patch fixes arch/ppc kernels, at least for prep subarch, after
build-id addition. Without the patch, kernels were 3 times the size and
bootloader refused to load them. Now they are back to normal again.
The patch is very similar to David Millers sparc patch, just applied to
ppc architecture.
Tested only with Roland McGrath's "Use LDFLAGS_MODULE only for .ko
links" patch applied - boots and works fine.
Signed-off-by: Meelis Roos <mroos@linux.ee>
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index c0aac3f..98c1212 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -91,6 +91,8 @@ SECTIONS
. = ALIGN(8192);
.data.init_task : { *(.data.init_task) }
+ NOTES
+
. = ALIGN(4096);
__init_begin = .;
.init.text : {
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fix ppc kernels after build-id addition
2007-07-25 12:17 [PATCH] fix ppc kernels after build-id addition Meelis Roos
@ 2007-07-26 5:01 ` Paul Mackerras
2007-07-27 15:01 ` Meelis Roos
0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2007-07-26 5:01 UTC (permalink / raw)
To: Meelis Roos; +Cc: linuxppc-dev, Linux Kernel list
Meelis Roos writes:
> This patch fixes arch/ppc kernels, at least for prep subarch, after
> build-id addition. Without the patch, kernels were 3 times the size and
> bootloader refused to load them. Now they are back to normal again.
I just built an ARCH=ppc kernel for the prep subarch and the vmlinux
size was normal. Can you identify exactly why the kernels got so much
bigger, i.e. what is taking up all the space?
Paul.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix ppc kernels after build-id addition
2007-07-26 5:01 ` Paul Mackerras
@ 2007-07-27 15:01 ` Meelis Roos
0 siblings, 0 replies; 3+ messages in thread
From: Meelis Roos @ 2007-07-27 15:01 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Linux Kernel list
> > This patch fixes arch/ppc kernels, at least for prep subarch, after
> > build-id addition. Without the patch, kernels were 3 times the size and
> > bootloader refused to load them. Now they are back to normal again.
>
> I just built an ARCH=ppc kernel for the prep subarch and the vmlinux
> size was normal. Can you identify exactly why the kernels got so much
> bigger, i.e. what is taking up all the space?
Now I got the previous patches tested and got to this one. Retested with
fresh git (build-id patch already applied) and latest Debian unstable
(binutils package 2.17cvs20070718-1, GNU ld (GNU Binutils for Debian)
2.17.50.20070718).
size -A vmlinux yields the same results (module notes section) and is
roughly the same size:
vmlinux :
section size addr
.note.gnu.build-id 36 180
.text 2399820 3221225472
.rodata 378440 3223625728
.pci_fixup 1448 3224004168
__ksymtab 18376 3224005616
__ksymtab_gpl 4600 3224023992
__ksymtab_strings 53334 3224028592
__param 1600 3224081928
__ex_table 11096 3224084480
__bug_table 18276 3224095576
.data 126504 3224117248
.data.page_aligned 12288 3224244224
.data.read_mostly 5468 3224256512
.data.cacheline_aligned 256 3224264704
.data.init_task 8192 3224272896
.init.text 103668 3224281088
.exit.text 2964 3224384768
.init.data 21516 3224387732
.init.setup 684 3224409248
.initcall.init 556 3224409932
.con_initcall.init 8 3224410488
__ftr_fixup 544 3224410496
.bss 198296 3224412160
.stab 1236 0
.stabstr 1783 0
.comment 34278 0
Total 3405267
The differneces come in under arc/ppc/boot/images.
Without the patch:
-rwxr-xr-x 1 mroos mroos 4654112 2007-07-27 17:20 zImage.bugboot
-rwxr-xr-x 1 mroos mroos 4719626 2007-07-27 17:20 zImage.elf
-rwxr-xr-x 1 mroos mroos 4655114 2007-07-27 17:20 zImage.prep
-rw-r--r-- 1 mroos mroos 3224410860 2007-07-27 17:00 vmlinux.bin
-rw-r--r-- 1 mroos mroos 4604269 2007-07-27 17:14 vmlinux.gz
With the patch:
-rwxr-xr-x 1 mroos mroos 1528864 2007-07-27 02:01 zImage.bugboot
-rwxr-xr-x 1 mroos mroos 1594378 2007-07-27 02:01 zImage.elf
-rwxr-xr-x 1 mroos mroos 1529866 2007-07-27 02:01 zImage.prep
-rwxr-xr-x 1 mroos mroos 3189664 2007-07-27 01:31 vmlinux.bin
-rw-r--r-- 1 mroos mroos 1476643 2007-07-27 01:31 vmlinux.gz
Without the patch, vmlinux.bin is ... huge. However, only zImage.elf is
easily measurable with size.
size -A arch/ppc/boot/images/zImage.elf (without patch):
section size addr
.text 24964 8388608
.data 4620288 8417280
.bss 35660 13037568
Total 4680912
size -A arch/ppc/boot/images/zImage.elf (with patch):
section size addr
.text 24964 8388608
.data 1495040 8417280
.bss 35660 9912320
Total 1555664
It seems the differences come in in .data section.
objdump -t -j .data arch/ppc/boot/images/zImage.elf (without patch):
arch/ppc/boot/images/zImage.elf: file format elf32-powerpc
SYMBOL TABLE:
00807000 l d .data 00000000 .data
00808f38 l O .data 00000130 rs_table
008090dc l O .data 00000026 order.2247
00809182 l O .data 00000800 lenfix.2194
00809102 l O .data 00000080 distfix.2195
008099c2 l O .data 00000040 dbase.2118
00809982 l O .data 00000040 dext.2119
00809a40 l O .data 0000003e lbase.2116
00809a02 l O .data 0000003e lext.2117
008089d0 l O .data 00000004 key_pending
00809ab0 l O .data 00000ff0 font
00807634 g O .data 00000200 ctrl_map
00807434 g O .data 00000200 altgr_map
00c6efb5 g .data 00000000 __image_end
00808db0 g O .data 00000015 AC
00808dc8 g O .data 000000c0 PCI_slots
00808e88 g O .data 00000004 cmd_line
00807a34 g O .data 00000200 alt_map
0080ae48 g .data 00000000 __image_begin
00808ea0 g O .data 00000004 orig_y
00c6f000 g .data 00000000 __ramdisk_begin
00808e9c g O .data 00000004 cols
00808234 g O .data 00000099 func_buf
00808e90 g O .data 00000004 hold_residual
00807c34 g O .data 00000200 ctrl_alt_map
00808eac g O .data 00000004 funcbufsize
00808eb0 g O .data 00000004 accent_table_size
00808e8c g O .data 00000004 keyb_present
00808ea8 g O .data 00000004 funcbufptr
00807e34 g O .data 00000400 key_maps
00808e94 g O .data 00000004 vidmem
00808ea4 g O .data 00000004 keymap_count
008089d4 g O .data 000000dc GenVgaTextRegs
00807834 g O .data 00000200 shift_ctrl_map
00807034 g O .data 00000200 plain_map
0080702f g .data 00000000 timebase_period_ns
00c6f000 g .data 00000000 __ramdisk_end
008082d0 g O .data 00000400 func_table
00807234 g O .data 00000200 shift_map
008086d0 g O .data 00000300 accent_table
00808ab0 g O .data 00000300 TextCLUT
00807000 g O .data 0000002f cmd_preset
00808e98 g O .data 00000004 lines
objdump -t -j .data arch/ppc/boot/images/zImage.elf (with patch):
/home/mroos/kraam/linux-2.6/arch/ppc/boot/images/zImage.elf: file format elf32-powerpc
SYMBOL TABLE:
00807000 l d .data 00000000 .data
00808f38 l O .data 00000130 rs_table
008090dc l O .data 00000026 order.2247
00809182 l O .data 00000800 lenfix.2194
00809102 l O .data 00000080 distfix.2195
008099c2 l O .data 00000040 dbase.2118
00809982 l O .data 00000040 dext.2119
00809a40 l O .data 0000003e lbase.2116
00809a02 l O .data 0000003e lext.2117
008089d0 l O .data 00000004 key_pending
00809ab0 l O .data 00000ff0 font
00807634 g O .data 00000200 ctrl_map
00807434 g O .data 00000200 altgr_map
0097366b g .data 00000000 __image_end
00808db0 g O .data 00000015 AC
00808dc8 g O .data 000000c0 PCI_slots
00808e88 g O .data 00000004 cmd_line
00807a34 g O .data 00000200 alt_map
0080ae48 g .data 00000000 __image_begin
00808ea0 g O .data 00000004 orig_y
00974000 g .data 00000000 __ramdisk_begin
00808e9c g O .data 00000004 cols
00808234 g O .data 00000099 func_buf
00808e90 g O .data 00000004 hold_residual
00807c34 g O .data 00000200 ctrl_alt_map
00808eac g O .data 00000004 funcbufsize
00808eb0 g O .data 00000004 accent_table_size
00808e8c g O .data 00000004 keyb_present
00808ea8 g O .data 00000004 funcbufptr
00807e34 g O .data 00000400 key_maps
00808e94 g O .data 00000004 vidmem
00808ea4 g O .data 00000004 keymap_count
008089d4 g O .data 000000dc GenVgaTextRegs
00807834 g O .data 00000200 shift_ctrl_map
00807034 g O .data 00000200 plain_map
0080702f g .data 00000000 timebase_period_ns
00974000 g .data 00000000 __ramdisk_end
008082d0 g O .data 00000400 func_table
00807234 g O .data 00000200 shift_map
008086d0 g O .data 00000300 accent_table
00808ab0 g O .data 00000300 TextCLUT
00807000 g O .data 0000002f cmd_preset
00808e98 g O .data 00000004 lines
The only differences are __image_end, __ramdisk_begin and __ramdisk_end.
What more to look at?
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-27 15:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25 12:17 [PATCH] fix ppc kernels after build-id addition Meelis Roos
2007-07-26 5:01 ` Paul Mackerras
2007-07-27 15:01 ` Meelis Roos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).