Build the kernel with -mconstant-gp. This means that function calls,

with the exception of indirect function calls, are assumed to be
intra load module and thus that GP will be the same. This avoids
saving, setting and restoring GP for each function call and
reduces the kernel with ~320KB. There's obviously a performance
benefit as well.

Note that since we generally don't know if calls will be intra or
inter load module when we're compiling kernel modules, -mconstant-gp
cannot be used for modules.
This commit is contained in:
Marcel Moolenaar 2002-10-13 07:07:51 +00:00
parent 7d2eb23f79
commit 52f5014e73
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105022

View File

@ -32,6 +32,8 @@ S= ../../..
.endif
.include "$S/conf/kern.pre.mk"
CFLAGS+= -mconstant-gp
ASM_CFLAGS= -x assembler-with-cpp -Wa,-x -DLOCORE ${CFLAGS}
%BEFORE_DEPEND