aarch64-pe can't fill 16 bytes in section .text

zac.walker@linaro.org zac.walker@linaro.org
Fri Nov 18 09:35:04 GMT 2022


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



More information about the Binutils mailing list