All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Simon Ser <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: torvalds@linux-foundation.org, hpa@zytor.com,
	peterz@infradead.org, tglx@linutronix.de, contact@emersion.fr,
	mingo@kernel.org, linux-kernel@vger.kernel.org,
	jpoimboe@redhat.com
Subject: [tip:core/urgent] objtool: Fix seg fault with clang-compiled objects
Date: Sat, 30 Dec 2017 13:07:40 -0800	[thread overview]
Message-ID: <tip-ce90aaf5cde4ce057b297bb6c955caf16ef00ee6@git.kernel.org> (raw)
In-Reply-To: <c0f2231683e9bed40fac1f13ce2c33b8389854bc.1514666459.git.jpoimboe@redhat.com>

Commit-ID:  ce90aaf5cde4ce057b297bb6c955caf16ef00ee6
Gitweb:     https://git.kernel.org/tip/ce90aaf5cde4ce057b297bb6c955caf16ef00ee6
Author:     Simon Ser <contact@emersion.fr>
AuthorDate: Sat, 30 Dec 2017 14:43:32 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 30 Dec 2017 22:04:17 +0100

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 <contact@emersion.fr>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.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/c0f2231683e9bed40fac1f13ce2c33b8389854bc.1514666459.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/objtool/orc_gen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index e5ca314..e61fe70 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)

      reply	other threads:[~2017-12-30 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-30 20:43 [PATCH 0/2] objtool: two seg fault fixes Josh Poimboeuf
2017-12-30 20:43 ` [PATCH 1/2] objtool: Fix seg fault caused by missing parameter Josh Poimboeuf
2017-12-30 21:07   ` [tip:core/urgent] " tip-bot for Simon Ser
2017-12-30 20:43 ` [PATCH 2/2] objtool: Fix seg fault with clang-compiled objects Josh Poimboeuf
2017-12-30 21:07   ` tip-bot for Simon Ser [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ce90aaf5cde4ce057b297bb6c955caf16ef00ee6@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=contact@emersion.fr \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.