This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] [ARM] FDPIC: Translate R_ARM_TARGET2 relocation into R_ARM_GOT32 relocation for FDPIC platform
- From: Christophe Lyon <clyon at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 25 Apr 2018 21:18:35 -0000
- Subject: [binutils-gdb] [ARM] FDPIC: Translate R_ARM_TARGET2 relocation into R_ARM_GOT32 relocation for FDPIC platform
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=29e9b073e3b356aae4c249bf3e265b2a608aea6c
commit 29e9b073e3b356aae4c249bf3e265b2a608aea6c
Author: Christophe Lyon <christophe.lyon@st.com>
Date: Tue Mar 20 10:55:45 2018 +0100
[ARM] FDPIC: Translate R_ARM_TARGET2 relocation into R_ARM_GOT32 relocation for FDPIC platform
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.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/elf32-arm.c | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bd7c6ae..766341a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,6 +1,12 @@
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>
+
* elf32-arm.c (DEFAULT_STACK_SIZE): New.
(elf32_arm_always_size_sections): Create stack segment.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 35b60ed..c2f4804 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;