[1/2][AArch64, gas] Support ILP32 triplet aarch64*-linux-gnu_ilp32

Jiong Wang jiong.wang@foss.arm.com
Mon May 22 10:05:00 GMT 2017


On 18/05/17 16:53, Nick Clifton wrote:
> Hi Jiong,
>
>> +void
>> +aarch64_after_parse_args (void)
>> +{
>> +  if (aarch64_abi != AARCH64_ABI_NONE)
>> +    return;
>> +
>> +  if (default_arch[7] == '\0')
>> +    aarch64_abi = AARCH64_ABI_LP64;
>> +  else
>> +    aarch64_abi = AARCH64_ABI_ILP32;
> The test here strikes me as being rather obtuse.  Presumably you are
> checking to see if the default_arch string has the :32 extension,

That's exactly what I am doing.

> but
> this is not obvious from the code.  Plus it will break if there are
> ever any other qualifiers added to the architecture string.  I would
> suggest at least testing for:
>
>    strlen (default_arch) > 7 && strcmp (default_arch + 7, ":32") == 0

I was borrowing check from i386_target_format, above suggestion make 
sense do look better.

I have updated the patch to use above condition.  Qualified triplet will
be treated as ILP32, otherwise simply defaulting to LP64.

Please review.

Thanks.

2017-05-22  Jiong Wang  <jiong.wang@arm.com>

gas/
          * configure.tgt: Set "arch" to "aarch64" if ${cpu} equals 
"aarch64".
          Recognize the new triplet name aarch64*-linux-gnu_ilp32.
          * configure.ac: Output DEFAULT_ARCH macro for AArch64.
          * configure: Regenerate.
          * config/tc-aarch64.h (aarch64_after_parse_args): New declaration.
          (md_after_parse_args): New define.
          * config/tc-aarch64.c (aarch64_abi_type): New enumeration
          AARCH64_ABI_NONE.
          (DEFAULT_ARCH): New define.
          (aarch64_abi): Set default value to AARCH64_ABI_NONE.
          (aarch64_after_parse_args): New function.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: new-gas.patch
Type: text/x-diff
Size: 3935 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170522/1b73cc90/attachment.bin>


More information about the Binutils mailing list