]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
cheri: fix static linking TLS setup
authorCarlos Eduardo Seo <carlos.seo@arm.com>
Wed, 9 Jun 2021 18:23:23 +0000 (15:23 -0300)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 27 Oct 2022 13:46:52 +0000 (14:46 +0100)
Use the per module RW capability to access the TLS initimage.
The bounds are not restricted for now.

csu/libc-tls.c

index 0a216c550289058ecd408ec71bbcee3322e4f12a..0701ec5acb91b228809c3ff813bf62ab905cb32b 100644 (file)
@@ -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;