[PATCH] gas: ld: sframe: add new internal header
Jan Beulich
jbeulich@suse.com
Wed Jul 9 06:04:11 GMT 2025
On 08.07.2025 23:30, Indu Bhagat via Binutils wrote:
> for SFRAME_V2_GNU_GAS_LD_ENCODING_FLAGS.
>
> The intention of creating an abstraction like
> SFRAME_V2_GNU_GAS_LD_ENCODING_FLAGS is to address the concern that there
> should be a central place to enforce harmonious flags between GNU as and
> ld. At the moment, the only flag that needs to be enforced is
> SFRAME_F_FDE_FUNC_START_PCREL.
>
> sframe.h and sframe-api.h are installed headers by libsframe for the
> specification and implementation respectively. Adding a definition like
> SFRAME_V2_GNU_GAS_LD_ENCODING_FLAGS does not fit in either. Create a
> new internal header instead to keep the definition uncoupled from
> sframe.h and sframe-api.h.
>
> bfd/
> * elf-sframe.c (_bfd_elf_merge_section_sframe): Use the new
> internal header and SFRAME_V2_GNU_GAS_LD_ENCODING_FLAGS.
> gas/
> * gen-sframe.c (output_sframe_internal): Likewise.
> include/
> * sframe-api.h (SFRAME_F_LD_MUSTHAVE_FLAGS): Move from..
> * sframe-internal.h: ..to here. New file.
>
> ---
> Notes:
>
> This should hopefully help address the concerns Jens is running into
> currently
> https://sourceware.org/pipermail/binutils/2025-July/142322.html while
> still addressing the concerns raised earlier
> https://sourceware.org/pipermail/binutils/2025-July/142217.html
Nevertheless I'm not convinced this is a good move. But you're the
libsframe maintainer, so you know what's best under the circumstances.
> --- /dev/null
> +++ b/include/sframe-internal.h
> @@ -0,0 +1,30 @@
> +/* Internal header for SFrame.
> +
> + Used by GNU as and ld.
> +
> + Copyright (C) 2025 Free Software Foundation, Inc.
> +
> + 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 3 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/>. */
> +
> +#ifndef _SFRAME_INTERNAL_H
> +#define _SFRAME_INTERNAL_H
Just as a nit: I don't think we normally use tabs as separators here.
There are a few exceptions, yes, two of them being the existing sframe*.h.
Jan
More information about the Binutils
mailing list