Page MenuHomeFreeBSD

D17279.diff
No OneTemporary

D17279.diff

Index: share/mk/bsd.linker.mk
===================================================================
--- share/mk/bsd.linker.mk
+++ share/mk/bsd.linker.mk
@@ -13,6 +13,9 @@
# linker support for that feature:
#
# - build-id: support for generating a Build-ID note
+# - filter: support for filter DSOs
+# - ifunc: support for GNU ifuncs
+# - ifunc-noplt: support for optimized ifunc calls
# - retpoline: support for generating PLT with retpoline speculative
# execution vulnerability mitigation
#
@@ -85,6 +88,7 @@
.endif
.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000
${X_}LINKER_FEATURES+= retpoline
+${X_}LINKER_FEATURES+= ifunc-noplt
.endif
.endif
.else
Index: sys/conf/kern.pre.mk
===================================================================
--- sys/conf/kern.pre.mk
+++ sys/conf/kern.pre.mk
@@ -122,11 +122,16 @@
.endif
.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386") && \
- defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
+ defined(LINKER_FEATURES)
+.if ${LINKER_FEATURES:Mifunc} == ""
.error amd64/i386 kernel requires linker ifunc support
.endif
+.if ${LINKER_FEATURES:Mifunc-noplt} != ""
+LDFLAGS+= -Wl,-z -Wl,ifunc-noplt
+.endif
+.endif
.if ${MACHINE_CPUARCH} == "amd64"
-LDFLAGS+= -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096 -Wl,-z -Wl,ifunc-noplt
+LDFLAGS+= -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096
.endif
NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 7, 7:29 PM (15 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31046973
Default Alt Text
D17279.diff (1 KB)

Event Timeline