reloc.c (559a218c9b257775fb249b67945fe4a05b7a6b9f) reloc.c (9684658e35ab033c79e0519e3681d9a194976b71)
1/*-
2 * Copyright (c) 2019 Leandro Lupori
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20 * SUCH DAMAGE.
21 */
22
23static uint32_t cpu_features;
24static uint32_t cpu_features2;
25
26static void
1/*-
2 * Copyright (c) 2019 Leandro Lupori
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20 * SUCH DAMAGE.
21 */
22
23static uint32_t cpu_features;
24static uint32_t cpu_features2;
25
26static void
27init_cpu_features(char **env)
27ifunc_init(const Elf_Auxinfo *aux)
28{
28{
29 const Elf_Auxinfo *aux;
30
31 /* Find the auxiliary vector on the stack. */
32 while (*env++ != 0) /* Skip over environment, and NULL terminator */
33 ;
34 aux = (const Elf_Auxinfo *)env;
35
36 /* Digest the auxiliary vector. */
37 for (; aux->a_type != AT_NULL; aux++) {
38 switch (aux->a_type) {
39 case AT_HWCAP:
40 cpu_features = (uint32_t)aux->a_un.a_val;
41 break;
42 case AT_HWCAP2:
43 cpu_features2 = (uint32_t)aux->a_un.a_val;

--- 23 unchanged lines hidden ---
29 /* Digest the auxiliary vector. */
30 for (; aux->a_type != AT_NULL; aux++) {
31 switch (aux->a_type) {
32 case AT_HWCAP:
33 cpu_features = (uint32_t)aux->a_un.a_val;
34 break;
35 case AT_HWCAP2:
36 cpu_features2 = (uint32_t)aux->a_un.a_val;

--- 23 unchanged lines hidden ---