Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137487935
D35589.id107365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35589.id107365.diff
View Options
Index: share/mk/bsd.lib.mk
===================================================================
--- share/mk/bsd.lib.mk
+++ share/mk/bsd.lib.mk
@@ -79,11 +79,16 @@
.if ${MK_BIND_NOW} != "no"
LDFLAGS+= -Wl,-znow
.endif
+.if ${LINKER_FEATURES:Mrelro}
.if ${MK_RELRO} == "no"
LDFLAGS+= -Wl,-znorelro
.else
LDFLAGS+= -Wl,-zrelro
.endif
+.else
+.warning Linker does not support WITH_RELRO/WITHOUT_RELRO, option ignored
+.endif
+.endif
.if ${MK_RETPOLINE} != "no"
.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
CFLAGS+= -mretpoline
Index: share/mk/bsd.linker.mk
===================================================================
--- share/mk/bsd.linker.mk
+++ share/mk/bsd.linker.mk
@@ -13,6 +13,7 @@
# linker support for that feature:
#
# - build-id: support for generating a Build-ID note
+# - relro: Relocation Read-Only
# - retpoline: support for generating PLT with retpoline speculative
# execution vulnerability mitigation
#
@@ -112,6 +113,9 @@
.endif
.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 90000
${X_}LINKER_FEATURES+= ifunc-noplt
+.if ${${X_}LINKER_TYPE} == "lld" || ${${X_}LINKER_TYPE} == "bfd"
+${X_}LINKER_FEATURES+= relro
+.endif
.endif
.endif
.else
Index: share/mk/bsd.prog.mk
===================================================================
--- share/mk/bsd.prog.mk
+++ share/mk/bsd.prog.mk
@@ -41,11 +41,15 @@
.if ${MK_BIND_NOW} != "no"
LDFLAGS+= -Wl,-znow
.endif
+.if ${LINKER_FEATURES:Mrelro}
.if ${MK_RELRO} == "no"
LDFLAGS+= -Wl,-znorelro
.else
LDFLAGS+= -Wl,-zrelro
.endif
+.else
+.warning Linker does not support WITH_RELRO/WITHOUT_RELRO, option ignored
+.endif
.if ${MK_PIE} != "no"
# Static PIE is not yet supported/tested.
.if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 10:24 PM (3 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26077745
Default Alt Text
D35589.id107365.diff (1 KB)
Attached To
Mode
D35589: Add and check for relro linker feature
Attached
Detach File
Event Timeline
Log In to Comment