svn commit: r352098 - projects/clang900-import/sys/conf
Dimitry Andric
dim at FreeBSD.org
Mon Sep 9 18:42:41 UTC 2019
Author: dim
Date: Mon Sep 9 18:42:41 2019
New Revision: 352098
URL: https://svnweb.freebsd.org/changeset/base/352098
Log:
Use -znorelro for kernel modules, when they are linked as shared
binaries (e.g. on any arch except amd64 and mips).
Otherwise, with lld 9, after https://reviews.llvm.org/rLLD356117, the
modules will get an additional PT_LOAD segment, which blows up kldxref,
since that has a hardcoded limit of 3 segments.
I could have alternatively bumped up that limit, but since kernel
modules do not use relro, the simplest workaround is to explicitly
disable it.
Modified:
projects/clang900-import/sys/conf/kmod.mk
Modified: projects/clang900-import/sys/conf/kmod.mk
==============================================================================
--- projects/clang900-import/sys/conf/kmod.mk Mon Sep 9 18:35:17 2019 (r352097)
+++ projects/clang900-import/sys/conf/kmod.mk Mon Sep 9 18:42:41 2019 (r352098)
@@ -230,7 +230,7 @@ ${PROG}.debug: ${FULLPROG}
.if ${__KLD_SHARED} == yes
${FULLPROG}: ${KMOD}.kld
- ${LD} -m ${LD_EMULATION} -Bshareable -znotext ${_LDFLAGS} \
+ ${LD} -m ${LD_EMULATION} -Bshareable -znotext -znorelro ${_LDFLAGS} \
-o ${.TARGET} ${KMOD}.kld
.if !defined(DEBUG_FLAGS)
${OBJCOPY} --strip-debug ${.TARGET}
More information about the svn-src-projects
mailing list