diff --git a/base/mk/spec-x86_64.mk b/base/mk/spec-x86_64.mk index 6cd035baf..9099190c9 100644 --- a/base/mk/spec-x86_64.mk +++ b/base/mk/spec-x86_64.mk @@ -11,4 +11,14 @@ REP_INC_DIR += include/x86_64 CC_MARCH ?= -m64 +# +# Avoid wasting almost 4 MiB by telling the linker that the max page size is +# 4K. Otherwise, the linker would align the text segment to a 4M boundary, +# effectively adding 4M of zeros to each binary. +# +# See http://sourceware.org/ml/binutils/2009-04/msg00099.html +# +LD_MARCH ?= -melf_x86_64 -z max-page-size=0x1000 + + include $(call select_from_repositories,mk/spec-64bit.mk)