[PATCH v5 02/20] gas: move code for object attribute parsing into obj-elf-attr.c

Jan Beulich jbeulich@suse.com
Wed Jul 9 14:07:36 GMT 2025


On 07.07.2025 18:49, Matthieu Longo wrote:
> --- /dev/null
> +++ b/gas/config/obj-elf-attr.h
> @@ -0,0 +1,52 @@
> +/* Object attributes parsing.
> +   Copyright (C) 2025 Free Software Foundation, Inc.
> +
> +   This file is part of GAS, the GNU Assembler.
> +
> +   GAS 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 3, or (at your option)
> +   any later version.
> +
> +   GAS 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 GAS; see the file COPYING.  If not, write to the Free
> +   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
> +   02110-1301, USA.  */
> +
> +#ifndef _OBJ_ELF_ATTR_H
> +#define _OBJ_ELF_ATTR_H
> +
> +#include "as.h"
> +#include "bfd/elf-bfd.h"
> +
> +/* The target supports Object Attributes v1.  */
> +#if OBJ_ELF \
> + && (defined (TC_ARC) \
> +  || defined (TC_ARM) \
> +  || defined (TC_CSKY) \
> +  || defined (TC_M68K) \
> +  || defined (TC_MIPS) \
> +  || defined (TC_MSP430) \
> +  || defined (TC_PPC) \
> +  || defined (TC_RISCV) \
> +  || defined (TC_S390) \
> +  || defined (TC_SPARC) \
> +  || defined (TC_TIC6X))
> +#define TC_OBJ_ATTR 1
> +#endif

Now things are even less correct, according to my understanding. TC_*
should not be defined outside of tc-*.h, except to provide a fallback
definition (if / when necessary).

(I didn't look at the patch as a whole yet, I just noticed this when
reading through Richard's comments.)

Jan


More information about the Binutils mailing list