This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, ARM] PR ld/19368: Add missing relocation type class for R_ARM_IRELATIVE


We should map R_ARM_IRELATIVE to reloc_class_ifunc so the generic code
will sort it at the last of .rel.dyn.

OK for master and 2.26 branch?

2016-01-05  Richard Sandiford  <richard.sandiford@arm.com>
            Jiong Wang  <jiong.wang@arm.com>

bfd/
  PR ld/19368
  * elf32-arm.c (elf32_arm_reloc_type_class): Map R_ARM_IRELATIVE to
  reloc_class_ifunc.

ld/testsuite/
  PR ld/19368
  * ld-arm/ifunc-3.rd: Update expected result.
  * ld-arm/ifunc-4.rd: Likewise.
  * ld-arm/ifunc-9.rd: Likewise.
  * ld-arm/ifunc-10.rd: Likewise.
  * ld-arm/ifunc-12.rd: Likewise.
  * ld-arm/ifunc-13.rd: Likewise.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index f059950..c594e65 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -15535,6 +15535,8 @@ elf32_arm_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
       return reloc_class_plt;
     case R_ARM_COPY:
       return reloc_class_copy;
+    case R_ARM_IRELATIVE:
+      return reloc_class_ifunc;
     default:
       return reloc_class_normal;
     }
diff --git a/ld/testsuite/ld-arm/ifunc-10.rd b/ld/testsuite/ld-arm/ifunc-10.rd
index 8846197..250def8 100644
--- a/ld/testsuite/ld-arm/ifunc-10.rd
+++ b/ld/testsuite/ld-arm/ifunc-10.rd
@@ -1,18 +1,6 @@
 
 Relocation section '\.rel\.dyn' at offset 0x8000 contains 24 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
-0001103c  ......a0 R_ARM_IRELATIVE  
-00011040  ......a0 R_ARM_IRELATIVE  
-00011044  ......a0 R_ARM_IRELATIVE  
-00011048  ......a0 R_ARM_IRELATIVE  
-0001104c  ......a0 R_ARM_IRELATIVE  
-00011050  ......a0 R_ARM_IRELATIVE  
-00011054  ......a0 R_ARM_IRELATIVE  
-00011058  ......a0 R_ARM_IRELATIVE  
-0001105c  ......a0 R_ARM_IRELATIVE  
-00011060  ......a0 R_ARM_IRELATIVE  
-00011064  ......a0 R_ARM_IRELATIVE  
-00011068  ......a0 R_ARM_IRELATIVE  
 0001108c  ......15 R_ARM_GLOB_DAT    00009018   atf2
 00011090  ......15 R_ARM_GLOB_DAT    00009024   aaf4
 00011094  ......15 R_ARM_GLOB_DAT    00009034   ttf2
@@ -25,6 +13,18 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 24 entries:
 000110c8  ......15 R_ARM_GLOB_DAT    0000909c   atf4
 000110cc  ......15 R_ARM_GLOB_DAT    000090a8   taf4
 000110d0  ......15 R_ARM_GLOB_DAT    000090b8   abf2
+0001103c  ......a0 R_ARM_IRELATIVE  
+00011040  ......a0 R_ARM_IRELATIVE  
+00011044  ......a0 R_ARM_IRELATIVE  
+00011048  ......a0 R_ARM_IRELATIVE  
+0001104c  ......a0 R_ARM_IRELATIVE  
+00011050  ......a0 R_ARM_IRELATIVE  
+00011054  ......a0 R_ARM_IRELATIVE  
+00011058  ......a0 R_ARM_IRELATIVE  
+0001105c  ......a0 R_ARM_IRELATIVE  
+00011060  ......a0 R_ARM_IRELATIVE  
+00011064  ......a0 R_ARM_IRELATIVE  
+00011068  ......a0 R_ARM_IRELATIVE  
 
 Relocation section '\.rel\.plt' at offset 0x80c0 contains 12 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
diff --git a/ld/testsuite/ld-arm/ifunc-12.rd b/ld/testsuite/ld-arm/ifunc-12.rd
index c5d62c1..69ed420 100644
--- a/ld/testsuite/ld-arm/ifunc-12.rd
+++ b/ld/testsuite/ld-arm/ifunc-12.rd
@@ -5,6 +5,10 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 16 entries:
 00010020  ......17 R_ARM_RELATIVE   
 0001100c  ......17 R_ARM_RELATIVE   
 00011018  ......17 R_ARM_RELATIVE   
+00010008  ......02 R_ARM_ABS32       f2\(\)       f2
+00011024  ......15 R_ARM_GLOB_DAT    f2\(\)       f2
+00010014  ......02 R_ARM_ABS32       f2t\(\)      f2t
+0001101c  ......15 R_ARM_GLOB_DAT    f2t\(\)      f2t
 00010004  ......a0 R_ARM_IRELATIVE  
 0001000c  ......a0 R_ARM_IRELATIVE  
 00010010  ......a0 R_ARM_IRELATIVE  
@@ -13,7 +17,3 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 16 entries:
 00011014  ......a0 R_ARM_IRELATIVE  
 00011020  ......a0 R_ARM_IRELATIVE  
 00011028  ......a0 R_ARM_IRELATIVE  
-00010008  ......02 R_ARM_ABS32       f2\(\)       f2
-00011024  ......15 R_ARM_GLOB_DAT    f2\(\)       f2
-00010014  ......02 R_ARM_ABS32       f2t\(\)      f2t
-0001101c  ......15 R_ARM_GLOB_DAT    f2t\(\)      f2t
diff --git a/ld/testsuite/ld-arm/ifunc-13.rd b/ld/testsuite/ld-arm/ifunc-13.rd
index c58ab8a..f4394fa 100644
--- a/ld/testsuite/ld-arm/ifunc-13.rd
+++ b/ld/testsuite/ld-arm/ifunc-13.rd
@@ -1,9 +1,9 @@
 
 Relocation section '\.rel\.dyn' at offset 0x8000 contains 6 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
+0001101c  ......15 R_ARM_GLOB_DAT    00000000   f2t
+00011024  ......15 R_ARM_GLOB_DAT    00000000   f2
 00011010  ......a0 R_ARM_IRELATIVE  
 00011014  ......a0 R_ARM_IRELATIVE  
 00011020  ......a0 R_ARM_IRELATIVE  
 00011028  ......a0 R_ARM_IRELATIVE  
-0001101c  ......15 R_ARM_GLOB_DAT    00000000   f2t
-00011024  ......15 R_ARM_GLOB_DAT    00000000   f2
diff --git a/ld/testsuite/ld-arm/ifunc-3.rd b/ld/testsuite/ld-arm/ifunc-3.rd
index 4acb314..0ac011a 100644
--- a/ld/testsuite/ld-arm/ifunc-3.rd
+++ b/ld/testsuite/ld-arm/ifunc-3.rd
@@ -4,16 +4,16 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 13 entries:
 00010004  ......17 R_ARM_RELATIVE   
 0001101c  ......17 R_ARM_RELATIVE   
 00011020  ......17 R_ARM_RELATIVE   
-0001000c  ......a0 R_ARM_IRELATIVE  
-0001001c  ......a0 R_ARM_IRELATIVE  
-00011010  ......a0 R_ARM_IRELATIVE  
-00011014  ......a0 R_ARM_IRELATIVE  
-00011018  ......a0 R_ARM_IRELATIVE  
 00010014  ......02 R_ARM_ABS32       f2\(\)       f2
 00010018  ......03 R_ARM_REL32       f2\(\)       f2
 00011024  ......15 R_ARM_GLOB_DAT    f2\(\)       f2
 00010024  ......02 R_ARM_ABS32       f4\(\)       f4
 00011028  ......15 R_ARM_GLOB_DAT    f4\(\)       f4
+0001000c  ......a0 R_ARM_IRELATIVE  
+0001001c  ......a0 R_ARM_IRELATIVE  
+00011010  ......a0 R_ARM_IRELATIVE  
+00011014  ......a0 R_ARM_IRELATIVE  
+00011018  ......a0 R_ARM_IRELATIVE  
 
 Relocation section '\.rel\.plt' at offset 0x8068 contains 1 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
diff --git a/ld/testsuite/ld-arm/ifunc-4.rd b/ld/testsuite/ld-arm/ifunc-4.rd
index b8079d5..43a0019 100644
--- a/ld/testsuite/ld-arm/ifunc-4.rd
+++ b/ld/testsuite/ld-arm/ifunc-4.rd
@@ -3,36 +3,6 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 62 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
 0001106c  ......17 R_ARM_RELATIVE   
 00011070  ......17 R_ARM_RELATIVE   
-00010004  ......a0 R_ARM_IRELATIVE  
-0001000c  ......a0 R_ARM_IRELATIVE  
-00010014  ......a0 R_ARM_IRELATIVE  
-0001001c  ......a0 R_ARM_IRELATIVE  
-00010024  ......a0 R_ARM_IRELATIVE  
-0001002c  ......a0 R_ARM_IRELATIVE  
-00010064  ......a0 R_ARM_IRELATIVE  
-0001006c  ......a0 R_ARM_IRELATIVE  
-00010074  ......a0 R_ARM_IRELATIVE  
-0001007c  ......a0 R_ARM_IRELATIVE  
-00010084  ......a0 R_ARM_IRELATIVE  
-0001008c  ......a0 R_ARM_IRELATIVE  
-00011024  ......a0 R_ARM_IRELATIVE  
-00011028  ......a0 R_ARM_IRELATIVE  
-0001102c  ......a0 R_ARM_IRELATIVE  
-00011030  ......a0 R_ARM_IRELATIVE  
-00011034  ......a0 R_ARM_IRELATIVE  
-00011038  ......a0 R_ARM_IRELATIVE  
-0001103c  ......a0 R_ARM_IRELATIVE  
-00011040  ......a0 R_ARM_IRELATIVE  
-00011044  ......a0 R_ARM_IRELATIVE  
-00011048  ......a0 R_ARM_IRELATIVE  
-0001104c  ......a0 R_ARM_IRELATIVE  
-00011050  ......a0 R_ARM_IRELATIVE  
-00011054  ......a0 R_ARM_IRELATIVE  
-00011058  ......a0 R_ARM_IRELATIVE  
-0001105c  ......a0 R_ARM_IRELATIVE  
-00011060  ......a0 R_ARM_IRELATIVE  
-00011064  ......a0 R_ARM_IRELATIVE  
-00011068  ......a0 R_ARM_IRELATIVE  
 00010034  ......02 R_ARM_ABS32       aaf2\(\)     aaf2
 00010038  ......03 R_ARM_REL32       aaf2\(\)     aaf2
 00011088  ......15 R_ARM_GLOB_DAT    aaf2\(\)     aaf2
@@ -63,6 +33,36 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 62 entries:
 00011094  ......15 R_ARM_GLOB_DAT    ttf4\(\)     ttf4
 000100bc  ......02 R_ARM_ABS32       tbf4\(\)     tbf4
 00011090  ......15 R_ARM_GLOB_DAT    tbf4\(\)     tbf4
+00010004  ......a0 R_ARM_IRELATIVE  
+0001000c  ......a0 R_ARM_IRELATIVE  
+00010014  ......a0 R_ARM_IRELATIVE  
+0001001c  ......a0 R_ARM_IRELATIVE  
+00010024  ......a0 R_ARM_IRELATIVE  
+0001002c  ......a0 R_ARM_IRELATIVE  
+00010064  ......a0 R_ARM_IRELATIVE  
+0001006c  ......a0 R_ARM_IRELATIVE  
+00010074  ......a0 R_ARM_IRELATIVE  
+0001007c  ......a0 R_ARM_IRELATIVE  
+00010084  ......a0 R_ARM_IRELATIVE  
+0001008c  ......a0 R_ARM_IRELATIVE  
+00011024  ......a0 R_ARM_IRELATIVE  
+00011028  ......a0 R_ARM_IRELATIVE  
+0001102c  ......a0 R_ARM_IRELATIVE  
+00011030  ......a0 R_ARM_IRELATIVE  
+00011034  ......a0 R_ARM_IRELATIVE  
+00011038  ......a0 R_ARM_IRELATIVE  
+0001103c  ......a0 R_ARM_IRELATIVE  
+00011040  ......a0 R_ARM_IRELATIVE  
+00011044  ......a0 R_ARM_IRELATIVE  
+00011048  ......a0 R_ARM_IRELATIVE  
+0001104c  ......a0 R_ARM_IRELATIVE  
+00011050  ......a0 R_ARM_IRELATIVE  
+00011054  ......a0 R_ARM_IRELATIVE  
+00011058  ......a0 R_ARM_IRELATIVE  
+0001105c  ......a0 R_ARM_IRELATIVE  
+00011060  ......a0 R_ARM_IRELATIVE  
+00011064  ......a0 R_ARM_IRELATIVE  
+00011068  ......a0 R_ARM_IRELATIVE  
 
 Relocation section '\.rel\.plt' at offset 0x81f0 contains 6 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
diff --git a/ld/testsuite/ld-arm/ifunc-9.rd b/ld/testsuite/ld-arm/ifunc-9.rd
index 689f663..e1ceb54 100644
--- a/ld/testsuite/ld-arm/ifunc-9.rd
+++ b/ld/testsuite/ld-arm/ifunc-9.rd
@@ -1,9 +1,9 @@
 
 Relocation section '\.rel\.dyn' at offset 0x8000 contains 3 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
+00011028  ......15 R_ARM_GLOB_DAT    00009014   f2
 00011010  ......a0 R_ARM_IRELATIVE  
 00011014  ......a0 R_ARM_IRELATIVE  
-00011028  ......15 R_ARM_GLOB_DAT    00009014   f2
 
 Relocation section '\.rel\.plt' at offset 0x8018 contains 1 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]