Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145220386
D35589.id107348.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.id107348.diff
View Options
Index: share/mk/bsd.lib.mk
===================================================================
--- share/mk/bsd.lib.mk
+++ share/mk/bsd.lib.mk
@@ -79,11 +79,13 @@
.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
+.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
@@ -15,6 +15,7 @@
# - build-id: support for generating a Build-ID note
# - retpoline: support for generating PLT with retpoline speculative
# execution vulnerability mitigation
+# - relro: Relocation Read-Only
#
# LINKER_FREEBSD_VERSION is the linker's internal source version.
#
@@ -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,13 @@
.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
+.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
Wed, Feb 18, 6:11 AM (10 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28839537
Default Alt Text
D35589.id107348.diff (1 KB)
Attached To
Mode
D35589: Add and check for relro linker feature
Attached
Detach File
Event Timeline
Log In to Comment