Module Name: src
Committed By: jmcneill
Date: Thu Sep 30 19:09:10 UTC 2021
Modified Files:
src/sys/external/bsd/gnu-efi/dist/gnuefi: reloc_riscv64.c
src/sys/external/bsd/gnu-efi/dist/inc/riscv64: efibind.h
Log Message:
gnu-efi: riscv64 build fixes for NetBSD
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c
diff -u src/sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c:1.1.1.1 src/sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c:1.2
--- src/sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c:1.1.1.1 Thu Sep 30 18:50:09 2021
+++ src/sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c Thu Sep 30 19:09:10 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: reloc_riscv64.c,v 1.1.1.1 2021/09/30 18:50:09 jmcneill Exp $ */
+/* $NetBSD: reloc_riscv64.c,v 1.2 2021/09/30 19:09:10 jmcneill Exp $ */
// SPDX-License-Identifier: GPL-2.0+
/* reloc_riscv.c - position independent ELF shared object relocator
@@ -40,12 +40,19 @@
#include <efi.h>
+#ifdef __NetBSD__
+#include <sys/types.h>
+#include <sys/exec_elf.h>
+#else
#include <elf.h>
+#endif
#define Elf_Dyn Elf64_Dyn
#define Elf_Rela Elf64_Rela
#define ELF_R_TYPE ELF64_R_TYPE
+EFI_STATUS EFIAPI _relocate(long, Elf_Dyn *);
+
EFI_STATUS EFIAPI _relocate(long ldbase, Elf_Dyn *dyn)
{
long relsz = 0, relent = 0;
Index: src/sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h
diff -u src/sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h:1.1.1.1 src/sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h:1.2
--- src/sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h:1.1.1.1 Thu Sep 30 18:50:09 2021
+++ src/sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h Thu Sep 30 19:09:10 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: efibind.h,v 1.1.1.1 2021/09/30 18:50:09 jmcneill Exp $ */
+/* $NetBSD: efibind.h,v 1.2 2021/09/30 19:09:10 jmcneill Exp $ */
/*
* Copright (C) 2014 - 2015 Linaro Ltd.
@@ -17,7 +17,11 @@
* either version 2 of the License, or (at your option) any later version.
*/
+#if defined(__NetBSD__)
+#include <sys/stdint.h>
+#else
#include <stdint.h>
+#endif
//
// Basic EFI types of various widths