public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/arm/gcs] aarch64: process gnu properties in static exe
Date: Wed, 14 Feb 2024 15:07:50 +0000 (GMT)	[thread overview]
Message-ID: <20240214150750.34BCB385E45A@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fcdce58087260a68d1a74b28e5b0146e69511f16

commit fcdce58087260a68d1a74b28e5b0146e69511f16
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Wed Dec 27 17:17:11 2023 +0000

    aarch64: process gnu properties in static exe

Diff:
---
 sysdeps/unix/sysv/linux/aarch64/libc-start.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/aarch64/libc-start.h b/sysdeps/unix/sysv/linux/aarch64/libc-start.h
index ccf0f8af5c..6e2e9762ee 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc-start.h
+++ b/sysdeps/unix/sysv/linux/aarch64/libc-start.h
@@ -21,6 +21,8 @@
 
 #ifndef SHARED
 
+# include <dl-prop.h>
+
 # ifndef PR_SET_SHADOW_STACK_STATUS
 #  define PR_GET_SHADOW_STACK_STATUS	71
 #  define PR_SET_SHADOW_STACK_STATUS	72
@@ -36,6 +38,16 @@ aarch64_libc_setup_tls (void)
 {
   __libc_setup_tls ();
 
+  struct link_map *main_map = _dl_get_dl_main_map ();
+  const ElfW(Phdr) *phdr = GL(dl_phdr);
+  const ElfW(Phdr) *ph;
+  for (ph = phdr; ph < phdr + GL(dl_phnum); ph++)
+    if (ph->p_type == PT_GNU_PROPERTY)
+      {
+	_dl_process_pt_gnu_property (main_map, -1, ph);
+	_rtld_main_check (main_map, _dl_argv[0]);
+	break;
+      }
   uint64_t s = GL(dl_aarch64_gcs);
   if (s != 0)
     INLINE_SYSCALL_CALL (prctl, PR_SET_SHADOW_STACK_STATUS, s, 0, 0, 0);

                 reply	other threads:[~2024-02-14 15:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240214150750.34BCB385E45A@sourceware.org \
    --to=nsz@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).