[ARM-FDPIC,08/12,ARM] FDPIC: Translate R_ARM_TARGET2 relocation into R_ARM_GOT32 relocation for FDPIC platform

Message ID 20180322143850.1766-9-christophe.lyon@st.com
State New
Headers show
Series
  • FDPIC ABI for ARM
Related show

Commit Message

Christophe Lyon March 22, 2018, 2:38 p.m.
2018-XX-XX  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/elf32-arm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.6.3

Patch

diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 6ba4ee4..72d25c8 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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;