[ARM] FDPIC: Translate R_ARM_TARGET2 relocation into R_ARM_GOT32 relocation for FDPIC...
authorChristophe Lyon <christophe.lyon@st.com>
Tue, 20 Mar 2018 09:55:45 +0000 (10:55 +0100)
committerChristophe Lyon <christophe.lyon@linaro.org>
Wed, 25 Apr 2018 20:58:17 +0000 (20:58 +0000)
2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
Mickaël Guêné  <mickael.guene@st.com>

bfd/
* elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
for R_ARM_TARGET2.

bfd/ChangeLog
bfd/elf32-arm.c

index bd7c6aeea40b835d0a34a918675eb44d75574290..766341a54f851cf89afc293c375278b4c024d33d 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
+       Mickaël Guêné  <mickael.guene@st.com>
+
+       * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
+       for R_ARM_TARGET2.
+
 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
        Mickaël Guêné  <mickael.guene@st.com>
 
index 35b60ed9f5bff2a0e04b07fc65017221df1be877..c2f48046200d21fde015d0ec16fdb1e4f8abc9cf 100644 (file)
@@ -8957,7 +8957,9 @@ bfd_elf32_arm_set_target_params (struct bfd *output_bfd,
     return;
 
   globals->target1_is_rel = params->target1_is_rel;
-  if (strcmp (params->target2_type, "rel") == 0)
+  if (globals->fdpic_p)
+    globals->target2_reloc = R_ARM_GOT32;
+  else if (strcmp (params->target2_type, "rel") == 0)
     globals->target2_reloc = R_ARM_REL32;
   else if (strcmp (params->target2_type, "abs") == 0)
     globals->target2_reloc = R_ARM_ABS32;