Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/lib/libsa Capture the endianness of the ELF file loaded ...
details: https://anonhg.NetBSD.org/src/rev/6b838b0ceb54
branches: trunk
changeset: 1021266:6b838b0ceb54
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri May 21 21:52:15 2021 +0000
description:
Capture the endianness of the ELF file loaded in 'netbsd_elf_data', the
same way we do already for the class in 'netbsd_elf_class'.
diffstat:
sys/lib/libsa/loadfile.c | 5 ++++-
sys/lib/libsa/loadfile.h | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r b562618f3ddc -r 6b838b0ceb54 sys/lib/libsa/loadfile.c
--- a/sys/lib/libsa/loadfile.c Fri May 21 21:21:01 2021 +0000
+++ b/sys/lib/libsa/loadfile.c Fri May 21 21:52:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile.c,v 1.32 2019/04/05 20:09:29 christos Exp $ */
+/* $NetBSD: loadfile.c,v 1.33 2021/05/21 21:52:15 jmcneill Exp $ */
/*-
* Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -84,6 +84,7 @@
uint32_t netbsd_version;
u_int netbsd_elf_class;
+u_int netbsd_elf_data;
/*
* Open 'filename', read in program and return the opened file
@@ -159,6 +160,7 @@
if (memcmp(hdr.elf32.e_ident, ELFMAG, SELFMAG) == 0 &&
hdr.elf32.e_ident[EI_CLASS] == ELFCLASS32) {
netbsd_elf_class = ELFCLASS32;
+ netbsd_elf_data = hdr.elf32.e_ident[EI_DATA];
rval = loadfile_elf32(fd, &hdr.elf32, marks, flags);
} else
#endif
@@ -166,6 +168,7 @@
if (memcmp(hdr.elf64.e_ident, ELFMAG, SELFMAG) == 0 &&
hdr.elf64.e_ident[EI_CLASS] == ELFCLASS64) {
netbsd_elf_class = ELFCLASS64;
+ netbsd_elf_data = hdr.elf64.e_ident[EI_DATA];
rval = loadfile_elf64(fd, &hdr.elf64, marks, flags);
} else
#endif
diff -r b562618f3ddc -r 6b838b0ceb54 sys/lib/libsa/loadfile.h
--- a/sys/lib/libsa/loadfile.h Fri May 21 21:21:01 2021 +0000
+++ b/sys/lib/libsa/loadfile.h Fri May 21 21:52:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile.h,v 1.14 2017/10/07 10:26:39 maxv Exp $ */
+/* $NetBSD: loadfile.h,v 1.15 2021/05/21 21:52:15 jmcneill Exp $ */
/*-
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -93,3 +93,4 @@
extern uint32_t netbsd_version;
extern u_int netbsd_elf_class;
+extern u_int netbsd_elf_data;
Home |
Main Index |
Thread Index |
Old Index