Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2019 18:42:41 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r352098 - projects/clang900-import/sys/conf
Message-ID:  <201909091842.x89IgfWV025883@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909091842.x89IgfWV025883>