Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141911544
D54559.id169313.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54559.id169313.diff
View Options
diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c
--- a/libexec/rtld-elf/aarch64/reloc.c
+++ b/libexec/rtld-elf/aarch64/reloc.c
@@ -444,10 +444,16 @@
return (target);
}
+struct __ifunc_arg_t __ifunc_arg;
+
void
-ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused)
+ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)])
{
-
+ __ifunc_arg._size = sizeof(__ifunc_arg);
+ __ifunc_arg._hwcap = (aux_info[AT_HWCAP] != NULL) ? (aux_info[AT_HWCAP]->a_un.a_val | _IFUNC_ARG_HWCAP) : 0;
+ __ifunc_arg._hwcap2 = (aux_info[AT_HWCAP2] != NULL) ? aux_info[AT_HWCAP2]->a_un.a_val : 0;
+ __ifunc_arg._hwcap3 = (aux_info[AT_HWCAP3] != NULL) ? aux_info[AT_HWCAP3]->a_un.a_val : 0;
+ __ifunc_arg._hwcap4 = (aux_info[AT_HWCAP4] != NULL) ? aux_info[AT_HWCAP4]->a_un.a_val : 0;
}
/*
diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h
--- a/libexec/rtld-elf/aarch64/rtld_machdep.h
+++ b/libexec/rtld-elf/aarch64/rtld_machdep.h
@@ -33,6 +33,7 @@
#include <sys/types.h>
#include <machine/atomic.h>
+#include <machine/ifunc.h>
#include <machine/tls.h>
struct Struct_Obj_Entry;
@@ -67,6 +68,8 @@
#define call_init_pointer(obj, target) \
(((InitArrFunc)(target))(main_argc, main_argv, environ))
+extern struct __ifunc_arg_t __ifunc_arg;
+
/*
* Pass zeros into the ifunc resolver so we can change them later. The first
* 8 arguments on arm64 are passed in registers so make them known values
@@ -75,8 +78,8 @@
* compare the argument with 0 to see if it is set.
*/
#define call_ifunc_resolver(ptr) \
- (((Elf_Addr (*)(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, \
- uint64_t, uint64_t, uint64_t))ptr)(0, 0, 0, 0, 0, 0, 0, 0))
+ (((Elf_Addr (*)(uint64_t, struct __ifunc_arg_t *, uint64_t, uint64_t, uint64_t, \
+ uint64_t, uint64_t, uint64_t))ptr)(__ifunc_arg._hwcap, &__ifunc_arg, 0, 0, 0, 0, 0, 0))
#define round(size, align) \
(((size) + (align) - 1) & ~((align) - 1))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 13, 10:11 AM (1 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27626704
Default Alt Text
D54559.id169313.diff (1 KB)
Attached To
Mode
D54559: rtld-elf: Pass HWCAP flags to ifunc resolver functions
Attached
Detach File
Event Timeline
Log In to Comment