summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-runtime.c11
-rw-r--r--elf/dl-symaddr.c2
-rw-r--r--elf/rtld.c2
3 files changed, 6 insertions, 9 deletions
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index 61ef6d61ca..63bbc89776 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -124,14 +124,13 @@ _dl_fixup (
of the object that defines sym. Now add in the symbol
offset. */
value = DL_FIXUP_MAKE_VALUE (result,
- sym ? (LOOKUP_VALUE_ADDRESS (result)
- + sym->st_value) : 0);
+ SYMBOL_ADDRESS (result, sym, false));
}
else
{
/* We already found the symbol. The module (and therefore its load
address) is also known. */
- value = DL_FIXUP_MAKE_VALUE (l, l->l_addr + sym->st_value);
+ value = DL_FIXUP_MAKE_VALUE (l, SYMBOL_ADDRESS (l, sym, true));
result = l;
}
@@ -241,9 +240,7 @@ _dl_profile_fixup (
of the object that defines sym. Now add in the symbol
offset. */
value = DL_FIXUP_MAKE_VALUE (result,
- defsym != NULL
- ? LOOKUP_VALUE_ADDRESS (result)
- + defsym->st_value : 0);
+ SYMBOL_ADDRESS (result, defsym, false));
if (defsym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
@@ -254,7 +251,7 @@ _dl_profile_fixup (
{
/* We already found the symbol. The module (and therefore its load
address) is also known. */
- value = DL_FIXUP_MAKE_VALUE (l, l->l_addr + refsym->st_value);
+ value = DL_FIXUP_MAKE_VALUE (l, SYMBOL_ADDRESS (l, refsym, true));
if (__builtin_expect (ELFW(ST_TYPE) (refsym->st_info)
== STT_GNU_IFUNC, 0))
diff --git a/elf/dl-symaddr.c b/elf/dl-symaddr.c
index 0f16ab74e6..7f1ccc2516 100644
--- a/elf/dl-symaddr.c
+++ b/elf/dl-symaddr.c
@@ -22,7 +22,7 @@
void *
_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref)
{
- ElfW(Addr) value = (map ? map->l_addr : 0) + ref->st_value;
+ ElfW(Addr) value = SYMBOL_ADDRESS (map, ref, false);
/* Return the pointer to function descriptor. */
if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC)
diff --git a/elf/rtld.c b/elf/rtld.c
index f8d9597cdd..e7681ebb1f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1916,7 +1916,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
NULL, ELF_RTYPE_CLASS_PLT,
DL_LOOKUP_ADD_DEPENDENCY, NULL);
- loadbase = LOOKUP_VALUE_ADDRESS (result);
+ loadbase = LOOKUP_VALUE_ADDRESS (result, false);
_dl_printf ("%s found at 0x%0*Zd in object at 0x%0*Zd\n",
_dl_argv[i],