summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Haehnel <marcus.haehnel@kernkonzept.com>2025-03-07 08:13:56 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2025-03-08 10:03:09 +0100
commite921185d316af9e4a6b44ebac3a17874e461e9ec (patch)
tree239fc0ceca1a4c492047126ce6e4585f9e225070
parent0fb6b453528bfea7bb7c31459d3fea6264f2b27a (diff)
ldso.h: factor out _dl_auxvt from ldso.h
The _dl_auxvt is also used on non shared builds to access the values of the vector from getauxval. Putting the definitions in ldso.h leads to issues because that header also implements fcntl.h functionality making it incompatible with files that include that header directly. Factor out the _dl_auxvt related declarations to a new header dl-auxvt.h and include from ldso.h as well as include it directly from __uClibc_main.c to make the definitions available. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
-rw-r--r--ldso/include/dl-auxvt.h9
-rwxr-xr-xldso/include/ldso.h6
-rw-r--r--libc/misc/internals/__uClibc_main.c2
3 files changed, 11 insertions, 6 deletions
diff --git a/ldso/include/dl-auxvt.h b/ldso/include/dl-auxvt.h
new file mode 100644
index 000000000..29eda6eb3
--- /dev/null
+++ b/ldso/include/dl-auxvt.h
@@ -0,0 +1,9 @@
+#ifndef _DL_AUXVT_H
+#define _DL_AUXVT_H
+
+#define AUX_MAX_AT_ID 40
+extern ElfW(auxv_t) _dl_auxvt[AUX_MAX_AT_ID]; /* Cache frequently accessed auxiliary vector entries */
+extern ElfW(auxv_t) *_dl_auxv_start; /* Start of the auxiliary vector */
+
+#endif /* _DL_AUXVT_H */
+
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index a2c3ec040..061d8a536 100755
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -34,7 +34,6 @@
#include <stdarg.h>
#include <stddef.h> /* for ptrdiff_t */
#include <stdbool.h>
-#if !defined(_FCNTL_H)
#define _FCNTL_H
/* We need this if arch has only new syscalls defined */
#ifndef AT_FDCWD
@@ -191,11 +190,8 @@ extern void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE loa
#include <dl-elf.h>
#endif
-#endif /* _FCNTL_H */
-#define AUX_MAX_AT_ID 40
-extern ElfW(auxv_t) _dl_auxvt[AUX_MAX_AT_ID]; /* Cache frequently accessed auxiliary vector entries */
-extern ElfW(auxv_t) *_dl_auxv_start; /* Start of the auxiliary vector */
+#include <dl-auxvt.h>
void load_vdso(void *sys_info_ehdr, char **envp );
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 87f80d4f2..60695b6ed 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -84,7 +84,7 @@ static void fdpic_init_array_jump(void *addr)
#ifndef SHARED
void *__libc_stack_end = NULL;
-#include "ldso.h" /* Needed for _dl_auxvt */
+#include "dl-auxvt.h"
# ifdef __UCLIBC_HAS_SSP__
# include <dl-osinfo.h>