about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarlos Eduardo Seo <carlos.seo@arm.com>2021-06-09 15:23:23 -0300
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-22 14:31:25 +0000
commit9bf00c58bc399042c097121ea5904df3d665128b (patch)
tree96b4e020691994f421117cb6ef2034193963f205
parenta5750ba400ec9a2561ac58700fc4ee76491b3984 (diff)
downloadglibc-9bf00c58bc399042c097121ea5904df3d665128b.tar.gz
glibc-9bf00c58bc399042c097121ea5904df3d665128b.tar.xz
glibc-9bf00c58bc399042c097121ea5904df3d665128b.zip
cheri: fix static linking TLS setup
Use the per module RW capability to access the TLS initimage.
The bounds are not restricted for now.
-rw-r--r--csu/libc-tls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/csu/libc-tls.c b/csu/libc-tls.c
index 0a216c5502..0701ec5acb 100644
--- a/csu/libc-tls.c
+++ b/csu/libc-tls.c
@@ -125,7 +125,7 @@ __libc_setup_tls (void)
 	  /* Remember the values we need.  */
 	  memsz = phdr->p_memsz;
 	  filesz = phdr->p_filesz;
-	  initimage = (void *) phdr->p_vaddr + main_map->l_addr;
+	  initimage = (void *) dl_rx_ptr (main_map, phdr->p_vaddr);
 	  align = phdr->p_align;
 	  if (phdr->p_align > max_align)
 	    max_align = phdr->p_align;