diff options
author | Simon Ser <[email protected]> | 2017-12-30 14:43:32 -0600 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2017-12-30 22:04:17 +0100 |
commit | ce90aaf5cde4ce057b297bb6c955caf16ef00ee6 (patch) | |
tree | 70b8105963826293a1a65d1271d3162ef91c4dba | |
parent | d89e426499cf36b96161bd32970d6783f1fbcb0e (diff) |
objtool: Fix seg fault with clang-compiled objects
Fix a seg fault which happens when an input file provided to 'objtool
orc generate' doesn't have a '.shstrtab' section (for instance, object
files produced by clang don't have this section).
Signed-off-by: Simon Ser <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/c0f2231683e9bed40fac1f13ce2c33b8389854bc.1514666459.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r-- | tools/objtool/orc_gen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c index e5ca31429c9b..e61fe703197b 100644 --- a/tools/objtool/orc_gen.c +++ b/tools/objtool/orc_gen.c @@ -165,6 +165,8 @@ int create_orc_sections(struct objtool_file *file) /* create .orc_unwind_ip and .rela.orc_unwind_ip sections */ sec = elf_create_section(file->elf, ".orc_unwind_ip", sizeof(int), idx); + if (!sec) + return -1; ip_relasec = elf_create_rela_section(file->elf, sec); if (!ip_relasec) |