Re: [PATCH v3 1/1] aarch64: mingw: Prevent relocation types from being overwritten

Jan Beulich <[email protected]> Wed, 22 Jul 2026 13:43:19 +0200
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
On 22.07.2026 13:04, Evgeny Karpov wrote:
> --- a/bfd/cofflink.c
> +++ b/bfd/cofflink.c
> @@ -3115,6 +3115,9 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
>  
>        symndx = rel->r_symndx;
>  
> +      if (rel->r_vaddr == (bfd_vma) -1)
> +	continue;
> +
>        if (symndx == -1)
>  	{
>  	  h = NULL;

I have to admit that I have reservations against such a(n) (ab)use of a
particular value. Yes, -1 may be very unlikely to occur in this field,
but is it excluded by the spec? Alan, what's your take here?

In any event, if we go with something like this, imo a proper manifest
constant wants introducing, such that dissimilar uses of -1 can be
told apart.

Jan