The patch titled Subject: objtool: do not retrieve data from empty sections has been removed from the -mm tree. Its filename was objtool-do-not-retrieve-data-from-empty-sections.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Petr Vandrovec <petr@xxxxxxxxxxxxxx> Subject: objtool: do not retrieve data from empty sections Binutils 2.29-9 in Debian returns an error when elf_getdata is invoked on empty section (.note.GNU-stack in all kernel files), causing immediate failure of kernel build with: elf_getdata: can't manipulate null section As nothing is done with sections that have zero size, just do not retrieve their data at all. Link: http://lkml.kernel.org/r/20170914191111.embq3bfkppem3l5u@xxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Petr Vandrovec <petr@xxxxxxxxxxxxxx> Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/objtool/elf.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff -puN tools/objtool/elf.c~objtool-do-not-retrieve-data-from-empty-sections tools/objtool/elf.c --- a/tools/objtool/elf.c~objtool-do-not-retrieve-data-from-empty-sections +++ a/tools/objtool/elf.c @@ -175,19 +175,20 @@ static int read_sections(struct elf *elf return -1; } - sec->data = elf_getdata(s, NULL); - if (!sec->data) { - WARN_ELF("elf_getdata"); - return -1; + if (sec->sh.sh_size != 0) { + sec->data = elf_getdata(s, NULL); + if (!sec->data) { + WARN_ELF("elf_getdata"); + return -1; + } + if (sec->data->d_off != 0 || + sec->data->d_size != sec->sh.sh_size) { + WARN("unexpected data attributes for %s", + sec->name); + return -1; + } } - - if (sec->data->d_off != 0 || - sec->data->d_size != sec->sh.sh_size) { - WARN("unexpected data attributes for %s", sec->name); - return -1; - } - - sec->len = sec->data->d_size; + sec->len = sec->sh.sh_size; } /* sanity check, one more call to elf_nextscn() should return NULL */ _ Patches currently in -mm which might be from petr@xxxxxxxxxxxxxx are -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html