Skip to content
  • Masahiro Yamada's avatar
    7657f60e
    kbuild: remove partial section mismatch detection for built-in.a · 7657f60e
    Masahiro Yamada authored
    
    
    When built-in.o was incrementally linked with 'ld -r', the section
    mismatch analysis for the individual built-in.o was possible when
    CONFIG_DEBUG_SECTION_MISMATCH was enabled.
    
    With the migration to the thin archive, built-in.a (former, built-in.o)
    is no longer an ELF file.  So, the modpost does nothing useful.
    scripts/mod/modpost.c just checks the header to bail out, as follows:
    
            /* Is this a valid ELF file? */
            if ((hdr->e_ident[EI_MAG0] != ELFMAG0) ||
                (hdr->e_ident[EI_MAG1] != ELFMAG1) ||
                (hdr->e_ident[EI_MAG2] != ELFMAG2) ||
                (hdr->e_ident[EI_MAG3] != ELFMAG3)) {
                    /* Not an ELF file - silently ignore it */
                    return 0;
            }
    
    We have the full analysis in the final link stage anyway, so we would
    not miss the section mismatching.
    
    I do not see a good reason to require extra linking only for the
    purpose of the per-directory analysis.  Just get rid of this part.
    
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    7657f60e
    kbuild: remove partial section mismatch detection for built-in.a
    Masahiro Yamada authored
    
    
    When built-in.o was incrementally linked with 'ld -r', the section
    mismatch analysis for the individual built-in.o was possible when
    CONFIG_DEBUG_SECTION_MISMATCH was enabled.
    
    With the migration to the thin archive, built-in.a (former, built-in.o)
    is no longer an ELF file.  So, the modpost does nothing useful.
    scripts/mod/modpost.c just checks the header to bail out, as follows:
    
            /* Is this a valid ELF file? */
            if ((hdr->e_ident[EI_MAG0] != ELFMAG0) ||
                (hdr->e_ident[EI_MAG1] != ELFMAG1) ||
                (hdr->e_ident[EI_MAG2] != ELFMAG2) ||
                (hdr->e_ident[EI_MAG3] != ELFMAG3)) {
                    /* Not an ELF file - silently ignore it */
                    return 0;
            }
    
    We have the full analysis in the final link stage anyway, so we would
    not miss the section mismatching.
    
    I do not see a good reason to require extra linking only for the
    purpose of the per-directory analysis.  Just get rid of this part.
    
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Loading