summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiancong Wang <tcwang@google.com>2019-06-14 09:57:38 -0700
committerTiancong Wang <tcwang@google.com>2019-07-02 20:58:56 +0000
commit71b0f9d8c88783f15c51dbb4ebeed38744adbdab (patch)
treef7be769354b544093e21d9bc1b9813aa13f996ae
parent5006aa6dbc5a2918cc5c69f090178df4ea64adb2 (diff)
downloadbinutils-71b0f9d8c88783f15c51dbb4ebeed38744adbdab.tar.gz
Fix a bug on gold linker.android-o-mr1-iot-release-1.0.14
Gold linker by default turns on the --fix-arm1176 option. It has missing cases for TAG_CPU_ARCH_V8 and various other arm v8 architectures. The result of this causes gold using v4t stubs for arm v8 cpus, which results in measurable code-size and performance impact. See https://sourceware.org/bugzilla/show_bug.cgi?id=24642 for more details on the bug. This patches extend the condition to be any TAGs larger than v7, instead of checking the tag individually. It enables any future updates on the tags. All the tag are defined in include/elf/arm.h. Bug: b/134709902 Test: ./checkbuild.by passes, after the ../prebuilt/ndk/binutils is updated with newly built binutils. Change-Id: I66277f62db1b1377b19f0e6d056f3b2d0a6f129b
-rw-r--r--binutils-2.27/gold/arm.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/binutils-2.27/gold/arm.cc b/binutils-2.27/gold/arm.cc
index a56d71d6..953bc5b7 100644
--- a/binutils-2.27/gold/arm.cc
+++ b/binutils-2.27/gold/arm.cc
@@ -2220,10 +2220,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