Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Move objtool_file struct off the stack

Objtool uses over 512k of stack, thanks to the hash table embedded in
the objtool_file struct. This causes an unnecessarily large stack
allocation and breaks users with low stack limits.

Move the struct off the stack.

Fixes: 042ba73fe7eb ("objtool: Add several performance improvements")
Reported-by: Vassili Karpov <moosotc@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/df92dcbc4b84b02ffa252f46876df125fb56e2d7.1552954176.git.jpoimboe@redhat.com

authored by

Josh Poimboeuf and committed by
Thomas Gleixner
0c671812 9e98c678

+2 -1
+2 -1
tools/objtool/check.c
··· 2184 2184 elf_close(file->elf); 2185 2185 } 2186 2186 2187 + static struct objtool_file file; 2188 + 2187 2189 int check(const char *_objname, bool orc) 2188 2190 { 2189 - struct objtool_file file; 2190 2191 int ret, warnings = 0; 2191 2192 2192 2193 objname = _objname;