Skip to content

Commit 0c67181

Browse files
jpoimboeKAGA-KOKO
authored andcommitted
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: 042ba73 ("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
1 parent 9e98c67 commit 0c67181

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/objtool/check.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2184,9 +2184,10 @@ static void cleanup(struct objtool_file *file)
21842184
elf_close(file->elf);
21852185
}
21862186

2187+
static struct objtool_file file;
2188+
21872189
int check(const char *_objname, bool orc)
21882190
{
2189-
struct objtool_file file;
21902191
int ret, warnings = 0;
21912192

21922193
objname = _objname;

0 commit comments

Comments
 (0)