Nudge lld to break the kernel read-only and read-write sections into

separate 2M pages.  The binutils default for max-page-size and
common-page-size used to produce this result.  By setting these
values, we can nudge lld to also separate these sections into separate
2M pages.

Reviewed by:	jhb, kib
Discussed with:	emaste
Sponsored by:	Netflix
Differential Revision:	D14282
This commit is contained in:
Jonathan T. Looney 2018-03-06 14:18:45 +00:00
parent c2a5dc6cd7
commit a0d442c0d8

View file

@ -120,6 +120,10 @@ CFLAGS+= ${CONF_CFLAGS}
LDFLAGS+= -Wl,--build-id=sha1
.endif
.if ${MACHINE_CPUARCH} == "amd64"
LDFLAGS+= -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096
.endif
NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC}