• Andrew Morton's avatar
    [PATCH] Fix endianess in modpost when cross-compiling for sparc on i386 · 42f0e8f2
    Andrew Morton authored
    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.
    42f0e8f2
modpost.c 16 KB