aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2018-03-20 10:54:50 +0100
committerChristophe Lyon <christophe.lyon@linaro.org>2018-04-25 20:49:57 +0000
commit18a203380502fb3ee75633fd464faa3c83cec710 (patch)
tree38db2664e147980721410e17587c5ec056dba4d7 /bfd
parent617a5ada88c7d4b6aae201ad5b295f3d2ef07c10 (diff)
downloadgdb-18a203380502fb3ee75633fd464faa3c83cec710.zip
gdb-18a203380502fb3ee75633fd464faa3c83cec710.tar.gz
gdb-18a203380502fb3ee75633fd464faa3c83cec710.tar.bz2
[ARM] Add FDPIC OSABI flag support.
ELF files targetting ARM FDPIC use the ELFOSABI_ARM_FDPIC flag. Set it appropriately in file generators (eg. gas), and handle it in readers (eg. readelf). 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (elf32_arm_print_private_bfd_data): Support EF_ARM_PIC and ELFOSABI_ARM_FDPIC. (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC. (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC. binutils/ * readelf.c (decode_ARM_machine_flags): Support EF_ARM_PIC. (get_osabi_name): Support ELFOSABI_ARM_FDPIC. gas/ * config/tc-arm.c (arm_fdpic): New. (elf32_arm_target_format): Support FDPIC. (OPTION_FDPIC): New. (md_longopts): Support FDPIC. (md_parse_option): Likewise. (md_show_usage): Likewise. include/ * elf/arm.h (EF_ARM_FDPIC): New.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf32-arm.c14
2 files changed, 21 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ed96fcd..dd28d04 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,6 +1,14 @@
2018-04-25 Christophe Lyon <christophe.lyon@st.com>
Mickaël Guêné <mickael.guene@st.com>
+ * elf32-arm.c (elf32_arm_print_private_bfd_data): Support
+ EF_ARM_PIC and ELFOSABI_ARM_FDPIC.
+ (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC.
+ (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC.
+
+2018-04-25 Christophe Lyon <christophe.lyon@st.com>
+ Mickaël Guêné <mickael.guene@st.com>
+
* config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and
arm_elf32_fdpic_le_vec to targ_selvecs. Accept
arm*-*-uclinuxfdpiceabi.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 565bb40..a0b0be3 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -14280,7 +14280,13 @@ elf32_arm_print_private_bfd_data (bfd *abfd, void * ptr)
if (flags & EF_ARM_RELEXEC)
fprintf (file, _(" [relocatable executable]"));
- flags &= ~EF_ARM_RELEXEC;
+ if (flags & EF_ARM_PIC)
+ fprintf (file, _(" [position independent]"));
+
+ if (elf_elfheader (abfd)->e_ident[EI_OSABI] == ELFOSABI_ARM_FDPIC)
+ fprintf (file, _(" [FDPIC ABI supplement]"));
+
+ flags &= ~ (EF_ARM_RELEXEC | EF_ARM_PIC);
if (flags)
fprintf (file, _("<Unrecognised flag bits set>"));
@@ -16642,6 +16648,9 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
globals = elf32_arm_hash_table (link_info);
if (globals != NULL && globals->byteswap_code)
i_ehdrp->e_flags |= EF_ARM_BE8;
+
+ if (globals->fdpic_p)
+ i_ehdrp->e_ident[EI_OSABI] |= ELFOSABI_ARM_FDPIC;
}
if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_VER5
@@ -19427,6 +19436,8 @@ elf32_arm_nacl_plt_sym_val (bfd_vma i, const asection *plt,
#define TARGET_BIG_NAME "elf32-bigarm-fdpic"
#undef elf_match_priority
#define elf_match_priority 128
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_ARM_FDPIC
/* Like elf32_arm_link_hash_table_create -- but overrides
appropriately for FDPIC. */
@@ -19454,6 +19465,7 @@ elf32_arm_fdpic_link_hash_table_create (bfd *abfd)
#include "elf32-target.h"
#undef elf_match_priority
+#undef ELF_OSABI
/* VxWorks Targets. */