Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/benchmarks/mangohud/files/patch-src_elfhacks.cpp
16149 views
1
--- src/elfhacks.cpp.orig 2020-08-16 16:54:20 UTC
2
+++ src/elfhacks.cpp
3
@@ -195,22 +195,22 @@ int eh_init_obj(eh_obj_t *obj)
4
if (obj->strtab)
5
return ENOTSUP;
6
7
- obj->strtab = (const char *) obj->dynamic[p].d_un.d_ptr;
8
+ obj->strtab = (const char *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
9
} else if (obj->dynamic[p].d_tag == DT_HASH) {
10
if (obj->hash)
11
return ENOTSUP;
12
13
- obj->hash = (ElfW(Word) *) obj->dynamic[p].d_un.d_ptr;
14
+ obj->hash = (ElfW(Word) *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
15
} else if (obj->dynamic[p].d_tag == DT_GNU_HASH) {
16
if (obj->gnu_hash)
17
return ENOTSUP;
18
19
- obj->gnu_hash = (Elf32_Word *) obj->dynamic[p].d_un.d_ptr;
20
+ obj->gnu_hash = (Elf32_Word *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
21
} else if (obj->dynamic[p].d_tag == DT_SYMTAB) {
22
if (obj->symtab)
23
return ENOTSUP;
24
25
- obj->symtab = (ElfW(Sym) *) obj->dynamic[p].d_un.d_ptr;
26
+ obj->symtab = (ElfW(Sym) *) (obj->dynamic[p].d_un.d_ptr + obj->addr);
27
}
28
p++;
29
}
30
31