Re: [RFC v4 03/18] objtool: Move registers and control flow to arch-dependent code

From: Josh Poimboeuf
Date: Thu Aug 22 2019 - 16:00:32 EST


On Fri, Aug 16, 2019 at 01:23:48PM +0100, Raphael Gault wrote:
> The control flow information and register macro definitions were based on
> the x86_64 architecture but should be abstract so that each architecture
> can define the correct values for the registers, especially the registers
> related to the stack frame (Frame Pointer, Stack Pointer and possibly
> Return Address).
>
> Signed-off-by: Raphael Gault <raphael.gault@xxxxxxx>
> ---
> tools/objtool/arch/x86/include/arch_special.h | 36 +++++++++++++++++++
> tools/objtool/{ => arch/x86/include}/cfi.h | 0
> tools/objtool/check.h | 1 +
> tools/objtool/special.c | 19 +---------
> 4 files changed, 38 insertions(+), 18 deletions(-)
> create mode 100644 tools/objtool/arch/x86/include/arch_special.h
> rename tools/objtool/{ => arch/x86/include}/cfi.h (100%)
>
> diff --git a/tools/objtool/arch/x86/include/arch_special.h b/tools/objtool/arch/x86/include/arch_special.h
> new file mode 100644
> index 000000000000..424ce47013e3
> --- /dev/null
> +++ b/tools/objtool/arch/x86/include/arch_special.h

The arch in the filename is redundant. It would be a bit nicer if it
were named "special.h" but I guess that would conflict with the non-arch
special.h, unless we put non-arch headers and arch headers in separate
namespaces somehow. Maybe it's ok for now unless anybody has a better
idea.

> @@ -0,0 +1,36 @@
> +/*
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, see <http://www.gnu.org/licenses/>.
> + */

Instead of the above can you use the SPDX identifier?

/* SPDX-License-Identifier: GPL-2.0-or-later */

And the same comment for the other headers in the patch set.

--
Josh