public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Jan Beulich <jbeulich@suse.com>, Binutils <binutils@sourceware.org>
Cc: "richard.earnshaw@arm.com" <richard.earnshaw@arm.com>,
	Marcus Shawcroft <marcus.shawcroft@arm.com>
Subject: Re: [PATCH] Arm64: follow-on to PR gas/27217 fix
Date: Wed, 18 May 2022 16:03:25 +0100	[thread overview]
Message-ID: <444809ec-0090-9575-ab83-2ad9aea557a1@redhat.com> (raw)
In-Reply-To: <888bc642-4fba-fa20-0fd0-65965deaf80c@suse.com>

Hi Jan,

> Pre-dating the commit mentioned above, I further question the block of
> code in aarch64_force_reloc() commented
> 
>        /* Pseudo relocs that need to be fixed up according to
> 	 ilp32_p.  */
> 
> Like the placeholder types added here, these are also placeholders which
> are subsequently resolved (albeit later, hence this being independent of
> the issue addressed here). As for the resolved types 1 is returned, I'd
> assume 1 should also be returned for the placeholders (in particular
> with md_apply_fix() being invoked _after_ md_pcrel_from_section(), which
> is the only caller of aarch64_force_relocation()). Then
> 
> 	ldr	x0, [x0, :got_lo12:.]
> 
> would also be affected by PR gas/28888. Thoughts?

I agree with you here.  Especially since the comments in md_apply_fix()
indicate that these relocs do need to be generated.  A patch to correct
this is pre-approved.


> --- a/gas/config/tc-aarch64.c
> +++ b/gas/config/tc-aarch64.c

> @@ -3097,6 +3097,7 @@ aarch64_force_reloc (unsigned int type)
>       case BFD_RELOC_AARCH64_LDST32_LO12:
>       case BFD_RELOC_AARCH64_LDST64_LO12:
>       case BFD_RELOC_AARCH64_LDST8_LO12:
> +    case BFD_RELOC_AARCH64_LDST_LO12:
>       case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12:
>       case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
>       case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
> @@ -3130,6 +3131,8 @@ aarch64_force_reloc (unsigned int type)
>       case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC:
>       case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12:
>       case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC:
> +    case BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12:
> +    case BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC:
>       case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0:
>       case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC:
>       case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1:
> @@ -3143,6 +3146,8 @@ aarch64_force_reloc (unsigned int type)
>       case BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
>       case BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12:
>       case BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
> +    case BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12:
> +    case BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC:
>       case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
>       case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
>       case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
> @@ -3652,7 +3657,7 @@ parse_address_main (char **str, aarch64_
>   
>   	  /* #:<reloc_op>:  */
>   	  if (! aarch64_get_expression (exp, &p, GE_NO_PREFIX, REJECT_ABSENT,
> -					aarch64_force_reloc (entry->add_type) == 1))
> +					aarch64_force_reloc (ty) == 1))
>   	    {
>   	      set_syntax_error (_("invalid relocation expression"));
>   	      return false;
> @@ -3776,7 +3781,7 @@ parse_address_main (char **str, aarch64_
>   	         the name in the assembler source.  Next, we parse the
>   	         expression.  */
>   	      if (! aarch64_get_expression (exp, &p, GE_NO_PREFIX, REJECT_ABSENT,
> -					    aarch64_force_reloc (entry->add_type) == 1))
> +					    aarch64_force_reloc (entry->ldst_type) == 1))
>   		{
>   		  set_syntax_error (_("invalid relocation expression"));
>   		  return false;
> 
Approved - please apply.

Cheers
   Nick


      reply	other threads:[~2022-05-18 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03  7:31 Jan Beulich
2022-05-18 15:03 ` Nick Clifton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=444809ec-0090-9575-ab83-2ad9aea557a1@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=marcus.shawcroft@arm.com \
    --cc=richard.earnshaw@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).