git: 61c9a00f8e5c - stable/13 - stand/elf: Only support swapping headers on powerpc.

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 24 Jan 2023 22:12:43 UTC
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=61c9a00f8e5c17ffbabf46710c2dcdec32acbe3a

commit 61c9a00f8e5c17ffbabf46710c2dcdec32acbe3a
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-09-16 15:10:14 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:35 +0000

    stand/elf: Only support swapping headers on powerpc.
    
    Powerpc is currently the only architecture that we support more than one
    endian. It's the only one that benefits from this swapping, so restrict
    the code to there. This saves about 1k in the i386 BIOS loader.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D36577
    
    (cherry picked from commit c0ecae78abbe5c925cd05d5e218aa6f038cd03c7)
---
 stand/common/load_elf.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c
index 363da4756c1d..81b9e3e7ee9f 100644
--- a/stand/common/load_elf.c
+++ b/stand/common/load_elf.c
@@ -98,6 +98,7 @@ const char	*__elfN(moduletype) = "elf module";
 
 uint64_t	__elfN(relocation_offset) = 0;
 
+#ifdef __powerpc__
 extern void elf_wrong_field_size(void);
 #define CONVERT_FIELD(b, f, e)			\
 	switch (sizeof((b)->f)) {		\
@@ -203,7 +204,22 @@ static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr)
 }
 #undef CONVERT_SWITCH
 #undef CONVERT_FIELD
+#else
+static int elf_header_convert(Elf_Ehdr *ehdr)
+{
+	return (0);
+}
+
+static int elf_program_header_convert(const Elf_Ehdr *ehdr, Elf_Phdr *phdr)
+{
+	return (0);
+}
 
+static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr)
+{
+	return (0);
+}
+#endif
 
 #ifdef __amd64__
 static bool