aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-14 20:23:22 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-14 20:23:22 -0700
commit42f0e8f2b7a34d40fba6ef64c2023a47f3189a44 (patch)
treec9da06948809f681d497745bc74cf8629016ac2d /scripts
parent7d0c5f9a63c1d0e43bfe2d83a14d52e4e384bd83 (diff)
downloadhistory-42f0e8f2b7a34d40fba6ef64c2023a47f3189a44.tar.gz
[PATCH] Fix endianess in modpost when cross-compiling for sparc on i386
From: Mathieu Chouquet-Stringer <mchouque@online.fr> This patch makes the following code work again: #ifdef STT_REGISTER if (info->hdr->e_machine == EM_SPARC || info->hdr->e_machine == EM_SPARCV9) { /* Ignore register directives. */ if (ELF_ST_TYPE(sym->st_info) == STT_REGISTER) break; } #endif This portion of code is sparc specific and nothing else in modpost.c uses e_machine meaning cross-compiling for sparc on i386 (or any little endian machine) is the only way to experience the bug. Without it, e_machine has the wrong value and modpost then generates a lot of "*** Warning: \"symbol\" [filename.ko] undefined" messages.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/modpost.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/modpost.c b/scripts/modpost.c
index 5205c2bf80cd1f..662e75b2f780bb 100644
--- a/scripts/modpost.c
+++ b/scripts/modpost.c
@@ -267,6 +267,7 @@ parse_elf(struct elf_info *info, const char *filename)
hdr->e_shoff = TO_NATIVE(hdr->e_shoff);
hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx);
hdr->e_shnum = TO_NATIVE(hdr->e_shnum);
+ hdr->e_machine = TO_NATIVE(hdr->e_machine);
sechdrs = (void *)hdr + hdr->e_shoff;
info->sechdrs = sechdrs;