All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Thierry <jthierry@redhat.com>
To: Matt Helsley <mhelsley@vmware.com>, linux-kernel@vger.kernel.org
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Miroslav Benes <mbenes@suse.cz>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC][PATCH 2/5] objtool: Move struct objtool_file into arch-independent header
Date: Tue, 12 May 2020 18:04:43 +0100	[thread overview]
Message-ID: <f7e08aba-03cc-b57a-6122-3801091b1387@redhat.com> (raw)
In-Reply-To: <dfa8c8aaf75493d739ef4f8feabf99bbb3f5d195.1588888003.git.mhelsley@vmware.com>

Hi Matt,

On 5/11/20 6:35 PM, Matt Helsley wrote:
> The objtool_file structure describing the files objtool works on is
> not architecture dependent -- it's not x86 only -- and it will be useful
> for any future commands that might not be part of the check / orc
> tooling. So we move it from the check.h header  into the objtool.h header.
> 

The change itself looks alright to me, however I'd say the justification 
is more about the fact the more subcommands dealing with object files 
are going to be added to objtool, and all those subcommand will likely 
use the objtool_file representation.

I think it doesn't have much to do with arch specificity. (But this is 
really about the commit message, otherwise the changes make sense)

> Signed-off-by: Matt Helsley <mhelsley@vmware.com>
> ---
>   tools/objtool/check.h   | 10 +---------
>   tools/objtool/objtool.h | 20 ++++++++++++++++++++
>   2 files changed, 21 insertions(+), 9 deletions(-)
>   create mode 100644 tools/objtool/objtool.h
> 
> diff --git a/tools/objtool/check.h b/tools/objtool/check.h
> index f0ce8ffe7135..ec6ff7f0970c 100644
> --- a/tools/objtool/check.h
> +++ b/tools/objtool/check.h
> @@ -7,11 +7,10 @@
>   #define _CHECK_H
>   
>   #include <stdbool.h>
> -#include "elf.h"
> +#include "objtool.h"
>   #include "cfi.h"
>   #include "arch.h"
>   #include "orc.h"
> -#include <linux/hashtable.h>
>   
>   struct insn_state {
>   	struct cfi_reg cfa;
> @@ -47,13 +46,6 @@ struct instruction {
>   	struct orc_entry orc;
>   };
>   
> -struct objtool_file {
> -	struct elf *elf;
> -	struct list_head insn_list;
> -	DECLARE_HASHTABLE(insn_hash, 20);
> -	bool ignore_unreachables, c_file, hints, rodata;
> -};
> -
>   int check(const char *objname, bool orc);
>   
>   struct instruction *find_insn(struct objtool_file *file,
> diff --git a/tools/objtool/objtool.h b/tools/objtool/objtool.h
> new file mode 100644
> index 000000000000..afa52fe6f644
> --- /dev/null
> +++ b/tools/objtool/objtool.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com>
> + */
> +
> +#ifndef _OBJTOOL_H
> +#define _OBJTOOL_H
> +#include <stdbool.h>
> +#include <linux/list.h>
> +#include <linux/hashtable.h>
> +
> +#include "elf.h"
> +
> +struct objtool_file {
> +	struct elf *elf;
> +	struct list_head insn_list;
> +	DECLARE_HASHTABLE(insn_hash, 20);
> +	bool ignore_unreachables, c_file, hints, rodata;
> +};
> +#endif
> 

-- 
Julien Thierry


  reply	other threads:[~2020-05-12 17:04 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 17:35 [RFC][PATCH 0/5] Enable objtool multiarch build Matt Helsley
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 [this message]
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-12  2:11   ` kbuild test robot
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=f7e08aba-03cc-b57a-6122-3801091b1387@redhat.com \
    --to=jthierry@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mhelsley@vmware.com \
    --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 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.