aboutsummaryrefslogtreecommitdiffstats
path: root/tools/objtool
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2018-01-29 23:00:41 -0500
committerIngo Molnar <mingo@kernel.org>2018-01-30 09:09:23 -0500
commit830c1e3d16b2c1733cd1ec9c8f4d47a398ae31bc (patch)
treee2e3d74ab82e1feb83e22dd9ce502f993de479d9 /tools/objtool
parent17bc33914bcc98ba3c6b426fd1c49587a25c0597 (diff)
objtool: Warn on stripped section symbol
With the following fix: 2a0098d70640 ("objtool: Fix seg fault with gold linker") ... a seg fault was avoided, but the original seg fault condition in objtool wasn't fixed. Replace the seg fault with an error message. Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Guenter Roeck <linux@roeck-us.net> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/dc4585a70d6b975c99fc51d1957ccdde7bd52f3a.1517284349.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/orc_gen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index e61fe703197b..18384d9be4e1 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -98,6 +98,11 @@ static int create_orc_entry(struct section *u_sec, struct section *ip_relasec,
98 struct orc_entry *orc; 98 struct orc_entry *orc;
99 struct rela *rela; 99 struct rela *rela;
100 100
101 if (!insn_sec->sym) {
102 WARN("missing symbol for section %s", insn_sec->name);
103 return -1;
104 }
105
101 /* populate ORC data */ 106 /* populate ORC data */
102 orc = (struct orc_entry *)u_sec->data->d_buf + idx; 107 orc = (struct orc_entry *)u_sec->data->d_buf + idx;
103 memcpy(orc, o, sizeof(*orc)); 108 memcpy(orc, o, sizeof(*orc));