aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2018-03-20 10:54:26 +0100
committerChristophe Lyon <christophe.lyon@linaro.org>2018-04-25 20:47:43 +0000
commit617a5ada88c7d4b6aae201ad5b295f3d2ef07c10 (patch)
treef827954e3595fb42d32cde87ade864e6b918d2b1 /bfd/elf32-arm.c
parent249b57335279b1051456884f1a908cdec907f43a (diff)
downloadgdb-617a5ada88c7d4b6aae201ad5b295f3d2ef07c10.zip
gdb-617a5ada88c7d4b6aae201ad5b295f3d2ef07c10.tar.gz
gdb-617a5ada88c7d4b6aae201ad5b295f3d2ef07c10.tar.bz2
[ARM] Add armelf_linux_fdpiceabi and armelfb_linux_fdpiceabi BFD backends
Initial definition of these new backends. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and arm_elf32_fdpic_le_vec to targ_selvecs. Accept arm*-*-uclinuxfdpiceabi. * configure.ac: Add support for arm_elf32_fdpic_be_vec and arm_elf32_fdpic_le_vec. * configure: Regenerate. * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p. (elf32_arm_link_hash_table_create): Initialize fdpic_p. (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM) (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets. (elf32_arm_fdpic_link_hash_table_create): New. * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and arm_elf32_fdpic_le_vec. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Add earmelf_linux_fdpiceabi.c and earmelfb_linux_fdpiceabi.c. (earmelf_linux_fdpiceabi.c, earmelfb_linux_fdpiceabi.c): New rules. * Makefile.in: Regenerate. * configure.tgt (arm*-*-uclinuxfdpiceabi): Handle new target. * emulparams/armelf_linux_fdpiceabi.sh: New. * emulparams/armelfb_linux_fdpiceabi.sh: New.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index ce9c2f2..565bb40 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -3228,6 +3228,9 @@ struct elf32_arm_link_hash_table
unsigned int bfd_count;
unsigned int top_index;
asection **input_list;
+
+ /* True if the target system uses FDPIC. */
+ int fdpic_p;
};
static inline int
@@ -3806,6 +3809,7 @@ elf32_arm_link_hash_table_create (bfd *abfd)
#endif
ret->use_rel = TRUE;
ret->obfd = abfd;
+ ret->fdpic_p = 0;
if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc,
sizeof (struct elf32_arm_stub_hash_entry)))
@@ -19411,6 +19415,46 @@ elf32_arm_nacl_plt_sym_val (bfd_vma i, const asection *plt,
#define ELF_COMMONPAGESIZE 0x1000
+/* FDPIC Targets. */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM arm_elf32_fdpic_le_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-littlearm-fdpic"
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM arm_elf32_fdpic_be_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-bigarm-fdpic"
+#undef elf_match_priority
+#define elf_match_priority 128
+
+/* Like elf32_arm_link_hash_table_create -- but overrides
+ appropriately for FDPIC. */
+
+static struct bfd_link_hash_table *
+elf32_arm_fdpic_link_hash_table_create (bfd *abfd)
+{
+ struct bfd_link_hash_table *ret;
+
+ ret = elf32_arm_link_hash_table_create (abfd);
+ if (ret)
+ {
+ struct elf32_arm_link_hash_table *htab = (struct elf32_arm_link_hash_table *) ret;
+
+ htab->fdpic_p = 1;
+ }
+ return ret;
+}
+
+#undef elf32_bed
+#define elf32_bed elf32_arm_fdpic_bed
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create elf32_arm_fdpic_link_hash_table_create
+
+#include "elf32-target.h"
+#undef elf_match_priority
+
/* VxWorks Targets. */
#undef TARGET_LITTLE_SYM