Why do we emit ABI_PCS_RW_data, ABI_PCS_RW_data and ABI_PCS_GOT_use?

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 14:35:35 PDT 2016


I can't seem to find anything that actually uses it and gcc doesn't
produce them.

The attached patch changes llvm to not produce them.

If we do need to produce them for some reason, what are the correct
values for -fPIE?

Cheers,
Rafael
-------------- next part --------------
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index 1c4148f..76efb75 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -724,20 +724,6 @@ void ARMAsmPrinter::emitAttributes() {
       ATS.emitFPU(ARM::FK_VFPV2);
   }
 
-  if (TM.getRelocationModel() == Reloc::PIC_) {
-    // PIC specific attributes.
-    ATS.emitAttribute(ARMBuildAttrs::ABI_PCS_RW_data,
-                      ARMBuildAttrs::AddressRWPCRel);
-    ATS.emitAttribute(ARMBuildAttrs::ABI_PCS_RO_data,
-                      ARMBuildAttrs::AddressROPCRel);
-    ATS.emitAttribute(ARMBuildAttrs::ABI_PCS_GOT_use,
-                      ARMBuildAttrs::AddressGOT);
-  } else {
-    // Allow direct addressing of imported data for all other relocation models.
-    ATS.emitAttribute(ARMBuildAttrs::ABI_PCS_GOT_use,
-                      ARMBuildAttrs::AddressDirect);
-  }
-
   // Signal various FP modes.
   if (!TM.Options.UnsafeFPMath) {
     ATS.emitAttribute(ARMBuildAttrs::ABI_FP_denormal,
diff --git a/test/CodeGen/ARM/build-attributes.ll b/test/CodeGen/ARM/build-attributes.ll
index b3b39a0..af759e3 100644
--- a/test/CodeGen/ARM/build-attributes.ll
+++ b/test/CodeGen/ARM/build-attributes.ll
@@ -138,10 +138,6 @@
 ; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi -mcpu=cortex-a7 -enable-sign-dependent-rounding-fp-math | FileCheck %s --check-prefix=DYN-ROUNDING
 ; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi -mcpu=cortex-a7 -mattr=+vfp4,-neon  -enable-unsafe-fp-math -disable-fp-elim -enable-no-infs-fp-math -enable-no-nans-fp-math -fp-contract=fast | FileCheck %s --check-prefix=CORTEX-A7-FPUV4-FAST
 ; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi -mcpu=cortex-a7 -mattr=+vfp4,,+d16,-neon | FileCheck %s --check-prefix=CORTEX-A7-FPUV4
-; RUN: llc < %s -mtriple=arm-none-linux-gnueabi -mattr=+strict-align -relocation-model=pic | FileCheck %s --check-prefix=RELOC-PIC
-; RUN: llc < %s -mtriple=arm-none-linux-gnueabi -mattr=+strict-align -relocation-model=static | FileCheck %s --check-prefix=RELOC-OTHER
-; RUN: llc < %s -mtriple=arm-none-linux-gnueabi -mattr=+strict-align -relocation-model=dynamic-no-pic | FileCheck %s --check-prefix=RELOC-OTHER
-; RUN: llc < %s -mtriple=arm-none-linux-gnueabi -mattr=+strict-align | FileCheck %s --check-prefix=RELOC-OTHER
 ; RUN: llc < %s -mtriple=arm-none-linux-gnueabi -mattr=+strict-align | FileCheck %s --check-prefix=PCS-R9-USE
 ; RUN: llc < %s -mtriple=arm-none-linux-gnueabi -mattr=+reserve-r9,+strict-align | FileCheck %s --check-prefix=PCS-R9-RESERVE
 
@@ -1095,7 +1091,6 @@
 ; CORTEX-M7-SOFT-NOT: .fpu
 ; CORTEX-M7-SINGLE:  .fpu fpv5-sp-d16
 ; CORTEX-M7-DOUBLE:  .fpu fpv5-d16
-; CORTEX-M7:  .eabi_attribute 17, 1
 ; CORTEX-M7-NOT:   .eabi_attribute 19
 ;; We default to IEEE 754 compliance
 ; CORTEX-M7:  .eabi_attribute 20, 1
@@ -1490,11 +1485,6 @@
 ; GENERIC-ARMV8_1-A-FAST-NOT:  .eabi_attribute 22
 ; GENERIC-ARMV8_1-A-FAST:  .eabi_attribute 23, 1
 
-; RELOC-PIC:  .eabi_attribute 15, 1
-; RELOC-PIC:  .eabi_attribute 16, 1
-; RELOC-PIC:  .eabi_attribute 17, 2
-; RELOC-OTHER:  .eabi_attribute 17, 1
-
 ; PCS-R9-USE:  .eabi_attribute 14, 0
 ; PCS-R9-RESERVE:  .eabi_attribute 14, 3
 


More information about the llvm-commits mailing list