From 3a41a4efd8a2d1cd5f95c0ec85f2f76ca97ae80a Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Seo Date: Wed, 9 Jun 2021 15:23:23 -0300 Subject: [PATCH] cheri: fix static linking TLS setup Use the per module RW capability to access the TLS initimage. The bounds are not restricted for now. --- csu/libc-tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csu/libc-tls.c b/csu/libc-tls.c index 0a216c55028..0701ec5acb9 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; -- 2.47.2