lkml.org 
[lkml]   [2012]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 4/4] x86 boot: Tell ld the kernel doesn't want 2MB file offset alignment.

By default ld uses 2MB pages and aligns our 3 program segments in the
file on 2MB boundaries, creating unnecessarily large uncompressed
vmlinux files.

Solve this by passing -z max-page-size 4096 to ld.

In my test x86_64 SMP test configuration with CONFIG_DEBUG_RODATA
enabled, this reduces the size of vmlinux by roughly 5MB from 15141772
bytes to 10210188 bytes.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
arch/x86/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 1f25214..b5b31c3 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -120,7 +120,7 @@ avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr)

-LDFLAGS := -m elf_$(UTS_MACHINE)
+LDFLAGS := -m elf_$(UTS_MACHINE) -z max-page-size=4096

# Speed up the build
KBUILD_CFLAGS += -pipe
--
1.7.5.4


\
 
 \ /
  Last update: 2012-07-09 09:22    [W:0.071 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site