[PATCH 2/3] bfd/ELF: Retain strong undefined symbols under -z dynamic-undefined-weak

Jan Beulich jbeulich@suse.com
Mon Sep 1 07:09:51 GMT 2025


On 16.07.2025 18:03, Hakan Candar wrote:
> --- a/bfd/bfd-in2.h
> +++ b/bfd/bfd-in2.h
> @@ -2924,6 +2924,14 @@ const char *bfd_format_string (bfd_format format);
>     && bfd_is_abs_section ((H)->u.def.section) \
>     && !(H)->rel_from_abs)
>  
> +/* Return TRUE if the symbol described by a linker hash entry H
> +   is undefined.  This includes both strong and weak undefined
> +   symbols.  Use this macro to check whether the symbol has not
> +   been resolved during the link.  */
> +#define bfd_is_undef_symbol(H) \
> +  ((H)->type == bfd_link_hash_undefined \
> +    || (H)->type == bfd_link_hash_undefweak)

This being linking-specific, may I suggest e.g. bfd_link_is_undef_symbol()?

Jan


More information about the Binutils mailing list