From 2648698edf3370791ee02c8a0fd76c0a2704db66 Mon Sep 17 00:00:00 2001 From: emaste Date: Thu, 28 Mar 2019 02:12:32 +0000 Subject: [PATCH] revert r341429 "disable BIND_NOW in libc, libthr, and rtld" r345620 by kib@ fixed the rtld issue that caused a crash at startup during resolution of libc's ifuncs with BIND_NOW. PR: 233333 Sponsored by: The FreeBSD Foundation --- contrib/elftoolchain/readelf/readelf.c | 1 + lib/libc/Makefile | 2 -- lib/libthr/Makefile | 1 - libexec/rtld-elf/Makefile | 1 - sys/sys/elf_common.h | 3 ++- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index a53f65f6af7..d6bd3f23830 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re) static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" }, + { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, { 0, NULL } }; diff --git a/lib/libc/Makefile b/lib/libc/Makefile index b545a2e81e9..ea3879ece59 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -6,8 +6,6 @@ SHLIBDIR?= /lib .include -# BIND_NOW in libc results in segfault at startup (PR 233333) -MK_BIND_NOW= no # Force building of libc_pic.a MK_TOOLCHAIN= yes diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index 4a11cdb6c96..e2e571e1341 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -9,7 +9,6 @@ PACKAGE= clibs SHLIBDIR?= /lib .include -MK_BIND_NOW= no MK_SSP= no LIB=thr diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 59e97c93cd8..52befa6a0d4 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -6,7 +6,6 @@ .include PACKAGE= clibs -MK_BIND_NOW= no MK_PIE= no # Always position independent using local rules MK_SSP= no diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 2d61e953401..1b71b46eadf 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -763,7 +763,8 @@ typedef struct { #define NT_FREEBSD_FEATURE_CTL 4 /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 +#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ -- 2.45.0