summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2022-01-16 02:17:06 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2022-01-16 02:17:06 +0000
commit3cb278b3598c1941554e76de3c4c6aaf59d47762 (patch)
tree987019f19a4d11c9405fb3251043febff5d36f8f /libexec/ld.so
parent914617d2e7dc04614244ef69f5f79a0eeece668e (diff)
Nothing depends on archdep.h pulling in other #includes anymore,
so delete the #includes and hide the RELOC_* functions that are only used by lib/csu behind "#ifdef RCRT0" ok jca@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/riscv64/archdep.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/libexec/ld.so/riscv64/archdep.h b/libexec/ld.so/riscv64/archdep.h
index ec29775dc74..5e090c73a82 100644
--- a/libexec/ld.so/riscv64/archdep.h
+++ b/libexec/ld.so/riscv64/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.3 2021/11/14 22:07:39 guenther Exp $ */
+/* $OpenBSD: archdep.h,v 1.4 2022/01/16 02:17:05 guenther Exp $ */
/*
* Copyright (c) 2021 Dale Rahn <drahn@openbsd.org>
@@ -33,15 +33,11 @@
#define RELOC_TAG DT_RELA
#define MACHID EM_RISCV /* ELF e_machine ID value checked */
-#include <elf.h>
-#include <machine/reloc.h>
-#include "syscall.h"
-#include "util.h"
-
-
/* Only used in lib/csu/boot.h */
+#ifdef RCRT0
+
static inline void
-RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
+RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
{
if (ELF_R_TYPE(r->r_info) == R_RISCV_RELATIVE) {
*p = v + r->r_addend;
@@ -52,4 +48,5 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
}
}
+#endif /* RCRT0 */
#endif /* _AARCH64_ARCHDEP_H_ */