From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 7E1A13857355; Fri, 5 Aug 2022 19:33:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E1A13857355 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] TODO(relro): cheri: make __attribute_relro a nop X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: d77736297ac6c980a70fa8537bab7e11a414140a X-Git-Newrev: 347f7e2ac1f34f92bc382afe9e5fe32ebe7cf16c Message-Id: <20220805193323.7E1A13857355@sourceware.org> Date: Fri, 5 Aug 2022 19:33:23 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2022 19:33:23 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=347f7e2ac1f34f92bc382afe9e5fe32ebe7cf16c commit 347f7e2ac1f34f92bc382afe9e5fe32ebe7cf16c Author: Szabolcs Nagy Date: Thu Jun 10 16:10:15 2021 +0100 TODO(relro): cheri: make __attribute_relro a nop relro does not work in the libc, because capabilities are readonly even before the page protection is applied. Diff: --- include/libc-symbols.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index f4437ff6ad..1a7df359fd 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -426,8 +426,12 @@ for linking") #define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec"))) +#if defined __CHERI_PURE_CAPABILITY__ +/* avoid readonly caps at startup when relro has to be writable */ +#define attribute_relro +#else #define attribute_relro __attribute__ ((section (".data.rel.ro"))) - +#endif /* Used to disable stack protection in sensitive places, like ifunc resolvers and early static TLS init. */