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/morello/main] cheri: fix SYMBOL_ADDRESS to return RX derived pointer Date: Wed, 12 Oct 2022 14:17:51 +0000 (GMT) [thread overview] Message-ID: <20221012141751.DB5C4385084D@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9912e5c608b276588a0e83926353c0632f516a02 commit 9912e5c608b276588a0e83926353c0632f516a02 Author: Szabolcs Nagy <szabolcs.nagy@arm.com> Date: Tue Sep 6 09:08:25 2022 +0100 cheri: fix SYMBOL_ADDRESS to return RX derived pointer All symbol addresses can be derived from the RX capability of the module (l_map_start). For RW object symbols pointer will have to be rederived from l_rw_start. Diff: --- sysdeps/generic/ldsodefs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 9cded5fdbf..3cb35dbb93 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -121,13 +121,16 @@ dl_rw_ptr (const struct link_map *l, ElfW(Addr) vaddr) typedef struct link_map *lookup_t; #define LOOKUP_VALUE(map) map #define LOOKUP_VALUE_ADDRESS(map, set) ((set) || (map) ? (map)->l_addr : 0) +#define LOOKUP_VALUE_START(map, set) ((set) || (map) ? (map)->l_map_start : 0) /* Calculate the address of symbol REF using the base address from map MAP, if non-NULL. Don't check for NULL map if MAP_SET is TRUE. */ #define SYMBOL_ADDRESS(map, ref, map_set) \ ((ref) == NULL ? 0 \ - : (__glibc_unlikely ((ref)->st_shndx == SHN_ABS) ? 0 \ - : LOOKUP_VALUE_ADDRESS (map, map_set)) + (ref)->st_value) + : (__glibc_unlikely ((ref)->st_shndx == SHN_ABS) ? (ref)->st_value \ + : dl_get_ptr (LOOKUP_VALUE_START (map, map_set), \ + LOOKUP_VALUE_ADDRESS (map, map_set), \ + (ref)->st_value))) /* Type of a constructor function, in DT_INIT, DT_INIT_ARRAY, DT_PREINIT_ARRAY. */
reply other threads:[~2022-10-12 14:17 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=20221012141751.DB5C4385084D@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: linkBe 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).