[PATCH] ld: Set the is_linker_input field

Alan Modra amodra@gmail.com
Mon Aug 18 13:56:57 GMT 2025


On Mon, Aug 18, 2025 at 05:36:01AM -0700, H.J. Lu wrote:
> Set the is_linker_input field when adding object only section.
> 
> 	* ldlang.c (cmdline_add_object_only_section): Set the
> 	is_linker_input field.

Looks OK to me.

> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
> ---
>  ld/ldlang.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ld/ldlang.c b/ld/ldlang.c
> index 2e6d0108f98..048c8480786 100644
> --- a/ld/ldlang.c
> +++ b/ld/ldlang.c
> @@ -10713,6 +10713,9 @@ cmdline_add_object_only_section (bfd_byte *contents, size_t size)
>        goto loser;
>      }
>  
> +  /* This is a linker input BFD.  */
> +  ibfd->is_linker_input = 1;
> +
>    if (!bfd_check_format_matches (ibfd, bfd_object, &matching))
>      {
>        err = bfd_errmsg (bfd_get_error ());
> -- 
> 2.50.1

-- 
Alan Modra


More information about the Binutils mailing list