From: Matt Helsley <mhelsley@vmware.com>
To: <linux-kernel@vger.kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Julien Thierry <jthierry@redhat.com>,
Miroslav Benes <mbenes@suse.cz>,
Steven Rostedt <rostedt@goodmis.org>,
Matt Helsley <mhelsley@vmware.com>
Subject: [RFC][PATCH 0/5] Enable objtool multiarch build
Date: Mon, 11 May 2020 10:35:08 -0700 [thread overview]
Message-ID: <cover.1588888003.git.mhelsley@vmware.com> (raw)
My previous RFC[1] tried to add recordmcount as the mcount subcommand
of objtool. As a necessary first step that required enabling building
of objtool for more than the x86 architecture.
Some folks have been working on enabling objtool checking functionality
for arm64. Rather than repeat that work here I aim to show a minimal
set which ensures that objtool builds for any architecture. This
will allow for not only building the check and ORC subcommands
but also incorporating more subcommands -- such as recordmcount.
I changed the Makefile to use the SRCARCH to determine which subcommands
should be available and set the appropriate SUBCMD_ variables. Those
variables then get used in the Build file to conditionally build them into
objtool. When the files are missing suitable empty definitions are located
in arch/missing so that the compilation will succeed while also allowing
objtool to report that the command is unavailable on the architecture.
Since the series does not add support for stack validation or checking
to any new architectures there's no reason to make KConfig or Makefile
changes which would normally be used to test this. So I've been forcing
builds of objtool with:
make O=build-ARCH ARCH=foo CROSS_COMPILE=foo-linux-gnu- defconfig
make O=build-ARCH ARCH=foo CROSS_COMPILE=foo-linux-gnu- tools/objtool
And running the resulting binary in qemu-static to verify that it
shows all objtool subcommands are supported on x86 and unsupported on
another arch.
[1] https://lore.kernel.org/lkml/cover.1586468801.git.mhelsley@vmware.com/
Matt Helsley (5):
objtool: Exit successfully when requesting help
objtool: Move struct objtool_file into arch-independent header
objtool: Add support for relocations without addends
objtool: Enable compilation of objtool for all architectures
objtool: Report missing support for subcommands
tools/objtool/Build | 10 +++--
tools/objtool/Makefile | 11 +++++-
tools/objtool/arch.h | 40 +++++++++++++++++++
tools/objtool/arch/missing/Build | 3 ++
tools/objtool/arch/missing/check.c | 16 ++++++++
tools/objtool/arch/missing/orc_dump.c | 13 ++++++
tools/objtool/arch/missing/orc_gen.c | 16 ++++++++
tools/objtool/arch/x86/Build | 1 +
tools/objtool/{ => arch/x86}/special.c | 4 +-
tools/objtool/{ => arch/x86}/special.h | 2 +-
tools/objtool/builtin-check.c | 5 +++
tools/objtool/builtin-orc.c | 9 ++++-
tools/objtool/builtin.h | 2 +
tools/objtool/check.c | 5 ++-
tools/objtool/check.h | 48 +---------------------
tools/objtool/elf.c | 55 +++++++++++++++++++++-----
tools/objtool/elf.h | 5 ++-
tools/objtool/objtool.c | 39 +++++++++++++++---
tools/objtool/objtool.h | 20 ++++++++++
tools/objtool/orc.h | 3 +-
tools/objtool/orc_dump.c | 1 +
tools/objtool/orc_gen.c | 3 ++
22 files changed, 235 insertions(+), 76 deletions(-)
create mode 100644 tools/objtool/arch/missing/Build
create mode 100644 tools/objtool/arch/missing/check.c
create mode 100644 tools/objtool/arch/missing/orc_dump.c
create mode 100644 tools/objtool/arch/missing/orc_gen.c
rename tools/objtool/{ => arch/x86}/special.c (98%)
rename tools/objtool/{ => arch/x86}/special.h (95%)
create mode 100644 tools/objtool/objtool.h
base-commit: 6e7f2eacf09811d092c1b41263108ac7fe0d089d
--
2.20.1
next reply other threads:[~2020-05-11 17:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 17:35 Matt Helsley [this message]
2020-05-11 17:35 ` [RFC][PATCH 1/5] objtool: Exit successfully when requesting help Matt Helsley
2020-05-15 19:52 ` Josh Poimboeuf
2020-05-18 18:33 ` Matt Helsley
2020-05-11 17:35 ` [RFC][PATCH 2/5] objtool: Move struct objtool_file into arch-independent header Matt Helsley
2020-05-12 17:04 ` Julien Thierry
2020-05-12 18:07 ` Matt Helsley
2020-05-11 17:35 ` [RFC][PATCH 3/5] objtool: Add support for relocations without addends Matt Helsley
2020-05-12 17:04 ` Julien Thierry
2020-05-13 16:26 ` Matt Helsley
2020-05-13 16:55 ` Julien Thierry
2020-05-14 21:09 ` Matt Helsley
2020-05-15 20:33 ` Josh Poimboeuf
2020-05-18 19:14 ` Matt Helsley
2020-05-11 17:35 ` [RFC][PATCH 4/5] objtool: Enable compilation of objtool for all architectures Matt Helsley
2020-05-12 17:04 ` Julien Thierry
2020-05-13 15:59 ` Matt Helsley
2020-05-13 16:55 ` Julien Thierry
2020-05-15 20:51 ` Josh Poimboeuf
2020-05-18 18:26 ` Matt Helsley
2020-05-15 20:56 ` Josh Poimboeuf
2020-05-18 19:20 ` Matt Helsley
2020-05-18 19:50 ` Matt Helsley
2020-05-18 22:27 ` Josh Poimboeuf
2020-05-19 17:48 ` Matt Helsley
2020-05-11 17:35 ` [RFC][PATCH 5/5] objtool: Report missing support for subcommands Matt Helsley
2020-05-15 21:04 ` Josh Poimboeuf
2020-05-18 18:29 ` Matt Helsley
2020-05-12 17:04 ` [RFC][PATCH 0/5] Enable objtool multiarch build Julien Thierry
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=cover.1588888003.git.mhelsley@vmware.com \
--to=mhelsley@vmware.com \
--cc=jpoimboe@redhat.com \
--cc=jthierry@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox