• Josh Poimboeuf's avatar
    objtool: Fix object file corruption · 97dab2ae
    Josh Poimboeuf authored
    Arnd Bergmann reported that a randconfig build was failing with the
    following link error:
    
      built-in.o: member arch/x86/kernel/time.o in archive is not an object
    
    It turns out the link failed because the time.o file had been corrupted
    by objtool:
    
      nm: arch/x86/kernel/time.o: File format not recognized
    
    In certain rare cases, when a .o file's ORC table is very small, the
    .data section size doesn't change because it's page aligned.  Because
    all the existing sections haven't changed size, libelf doesn't detect
    any section header changes, and so it doesn't update the section header
    table properly.  Instead it writes junk in the section header entries
    for the new ORC sections.
    
    Make sure libelf properly updates the section header table by setting
    the ELF_F_DIRTY flag in the top level elf struct.
    Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 627fce14 ("objtool: Add ORC unwind table generation")
    Link: http://lkml.kernel.org/r/e650fd0f2d8a209d1409a9785deb101fdaed55fb.1505459813.git.jpoimboe@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    97dab2ae
Name
Last commit
Last update
..
Documentation Loading commit data...
arch/x86 Loading commit data...
.gitignore Loading commit data...
Build Loading commit data...
Makefile Loading commit data...
arch.h Loading commit data...
builtin-check.c Loading commit data...
builtin-orc.c Loading commit data...
builtin.h Loading commit data...
cfi.h Loading commit data...
check.c Loading commit data...
check.h Loading commit data...
elf.c Loading commit data...
elf.h Loading commit data...
objtool.c Loading commit data...
orc.h Loading commit data...
orc_dump.c Loading commit data...
orc_gen.c Loading commit data...
orc_types.h Loading commit data...
special.c Loading commit data...
special.h Loading commit data...
warn.h Loading commit data...