From 2b1192cae03642b2cb16f918322f5cddfc54eae2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 7 Apr 2022 17:04:59 +0100 Subject: cheri: elf: fix pointer provenance of l_tls_initimage --- elf/dl-load.c | 2 +- elf/rtld.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/dl-load.c b/elf/dl-load.c index 1ad0868dad..367b8cdab1 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1369,7 +1369,7 @@ cannot enable executable stack as shared object requires"); /* Adjust the address of the TLS initialization image. */ if (l->l_tls_initimage != NULL) - l->l_tls_initimage = (char *) l->l_tls_initimage + l->l_addr; + l->l_tls_initimage = (ElfW(Addr)) l->l_tls_initimage + (char *) l->l_addr; /* Process program headers again after load segments are mapped in case processing requires accessing those segments. Scan program diff --git a/elf/rtld.c b/elf/rtld.c index 2c61935a21..6ba7b94761 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1274,7 +1274,7 @@ rtld_setup_main_map (struct link_map *main_map) the executable is actually an ET_DYN object. */ if (main_map->l_tls_initimage != NULL) main_map->l_tls_initimage - = (char *) main_map->l_tls_initimage + main_map->l_addr; + = (ElfW(Addr)) main_map->l_tls_initimage + (char *) main_map->l_addr; if (! main_map->l_map_end) main_map->l_map_end = ~0; if (! main_map->l_text_end) -- cgit 1.4.1