[PATCH]gold: Fix missing armv8 from may_use_v5t_interworking()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH]gold: Fix missing armv8 from may_use_v5t_interworking()

Sourceware - binutils list mailing list
Hello,

As reported in the bug
https://sourceware.org/bugzilla/show_bug.cgi?id=24642, in arm.cc the
code that permits v5t interworking instructions is missing a case for
TAG_CPU_ARCH_V8 and the various V8_M mainline and baseline. This
results in less efficient code in armv8 cpus to use v4t stubs. This
patch is an effort to fix it and change the condition to allow any cpu
architectures above armv7.

----------------------
diff --git a/gold/arm.cc b/gold/arm.cc
index 55b8d31368..8258ca5c9e 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -2216,10 +2216,8 @@ class Target_arm : public Sized_target<32, big_endian>
     int arch = attr->int_value();
     if (parameters->options().fix_arm1176())
       return (arch == elfcpp::TAG_CPU_ARCH_V6T2
-             || arch == elfcpp::TAG_CPU_ARCH_V7
-             || arch == elfcpp::TAG_CPU_ARCH_V6_M
-             || arch == elfcpp::TAG_CPU_ARCH_V6S_M
-             || arch == elfcpp::TAG_CPU_ARCH_V7E_M);
+              || (arch >= elfcpp::TAG_CPU_ARCH_V7
+                  && arch <= elfcpp::MAX_TAG_CPU_ARCH));
     else
       return (arch != elfcpp::TAG_CPU_ARCH_PRE_V4
              && arch != elfcpp::TAG_CPU_ARCH_V4
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH]gold: Fix missing armv8 from may_use_v5t_interworking()

Sourceware - binutils list mailing list
Also, the patch is tested on Android NDK and Chrome OS.

On Wed, Jul 17, 2019 at 10:40 AM Tiancong Wang <[hidden email]> wrote:

>
> Hello,
>
> As reported in the bug
> https://sourceware.org/bugzilla/show_bug.cgi?id=24642, in arm.cc the
> code that permits v5t interworking instructions is missing a case for
> TAG_CPU_ARCH_V8 and the various V8_M mainline and baseline. This
> results in less efficient code in armv8 cpus to use v4t stubs. This
> patch is an effort to fix it and change the condition to allow any cpu
> architectures above armv7.
>
> ----------------------
> diff --git a/gold/arm.cc b/gold/arm.cc
> index 55b8d31368..8258ca5c9e 100644
> --- a/gold/arm.cc
> +++ b/gold/arm.cc
> @@ -2216,10 +2216,8 @@ class Target_arm : public Sized_target<32, big_endian>
>      int arch = attr->int_value();
>      if (parameters->options().fix_arm1176())
>        return (arch == elfcpp::TAG_CPU_ARCH_V6T2
> -             || arch == elfcpp::TAG_CPU_ARCH_V7
> -             || arch == elfcpp::TAG_CPU_ARCH_V6_M
> -             || arch == elfcpp::TAG_CPU_ARCH_V6S_M
> -             || arch == elfcpp::TAG_CPU_ARCH_V7E_M);
> +              || (arch >= elfcpp::TAG_CPU_ARCH_V7
> +                  && arch <= elfcpp::MAX_TAG_CPU_ARCH));
>      else
>        return (arch != elfcpp::TAG_CPU_ARCH_PRE_V4
>               && arch != elfcpp::TAG_CPU_ARCH_V4