public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: <zac.walker@linaro.org>
To: "'Jan Beulich'" <jbeulich@suse.com>
Cc: "'Nick Clifton'" <nickc@redhat.com>, <binutils@sourceware.org>,
	"'Alan Modra'" <amodra@gmail.com>
Subject: RE: aarch64-pe can't fill 16 bytes in section .text
Date: Fri, 18 Nov 2022 10:35:04 +0100	[thread overview]
Message-ID: <022f01d8fb31$0a66fb00$1f34f100$@linaro.org> (raw)
In-Reply-To: <e25aff57-bf94-9111-3f3a-0d1315c86cc8@suse.com>

Thanks for the help Jan. Adding a similar override to "tc-arm.c" fixes it:

#ifdef OBJ_ELF
 ...
#else
  { "word", cons, 4},
#endif

I will do some testing on other pseudo types in case I am missing more. 

Zac

-----Original Message-----
From: Jan Beulich <jbeulich@suse.com> 
Sent: 18 November 2022 10:09
To: zac.walker@linaro.org
Cc: 'Nick Clifton' <nickc@redhat.com>; binutils@sourceware.org; 'Alan Modra' <amodra@gmail.com>
Subject: Re: aarch64-pe can't fill 16 bytes in section .text

On 18.11.2022 09:52, Zac Walker via Binutils wrote:
> Patch merged just now. (Was a holiday here yesterday)
> 
> I am still investigating another alignment problem so might be another follow up patch. This code from OpenBLAS:
> 
> data_ar:
>  .word 0x3e44fae6
> data_ai:
>  .word 0x3d320fa2
> start:
>  ldr s20, data_ar
>  ldr s21, data_ai
> 
> Produces:
> 
> zscal-min.s:2: Warning: value 0x3e44fae6 truncated to 0xfae6
> zscal-min.s:4: Warning: value 0x3d320fa2 truncated to 0xfa2
> zscal-min.s:7: Error: pc-relative load offset not word aligned
> 
> Works ok with clang. I am not sure if .word data should be aligned by default in gas or this is just a difference in behaviour.

.word is overridden by tc-aarch64.c only for ELF. So in your COFF (aiui) case .word emits just two bytes instead of the expected four. Hence also the warnings, not just the error.

Jan


      reply	other threads:[~2022-11-18  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 17:24 [PATCH V2] GAS fix alignment for aarch64-pe Zac Walker
2022-11-15 10:50 ` Nick Clifton
2022-11-15 11:23   ` Zac Walker
2022-11-15 21:53     ` aarch64-pe can't fill 16 bytes in section .text Alan Modra
2022-11-16 17:03       ` Zac Walker
2022-11-17  3:01         ` Alan Modra
2022-11-18  8:52           ` zac.walker
2022-11-18  9:08             ` Jan Beulich
2022-11-18  9:35               ` zac.walker [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='022f01d8fb31$0a66fb00$1f34f100$@linaro.org' \
    --to=zac.walker@linaro.org \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=nickc@redhat.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).