diff options
author | Christophe Lyon <christophe.lyon@st.com> | 2018-03-20 10:54:50 +0100 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2018-04-25 20:49:57 +0000 |
commit | 18a203380502fb3ee75633fd464faa3c83cec710 (patch) | |
tree | 38db2664e147980721410e17587c5ec056dba4d7 /gas | |
parent | 617a5ada88c7d4b6aae201ad5b295f3d2ef07c10 (diff) | |
download | gdb-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 'gas')
-rw-r--r-- | gas/ChangeLog | 10 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 34 |
2 files changed, 41 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index e8c0f7d..5db76c9 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +2018-04-25 Christophe Lyon <christophe.lyon@st.com> + Mickaël Guêné <mickael.guene@st.com> + + * 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. + 2018-04-25 Tamar Christina <tamar.christina@arm.com> * testsuite/gas/aarch64/rdma.s: Test for larger register numbers. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index f7bddd7..d735609 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -75,6 +75,9 @@ static struct unsigned sp_restored:1; } unwind; +/* Whether --fdpic was given. */ +static int arm_fdpic; + #endif /* OBJ_ELF */ /* Results from operand parsing worker functions. */ @@ -25079,10 +25082,20 @@ elf32_arm_target_format (void) ? "elf32-bigarm-nacl" : "elf32-littlearm-nacl"); #else - if (target_big_endian) - return "elf32-bigarm"; + if (arm_fdpic) + { + if (target_big_endian) + return "elf32-bigarm-fdpic"; + else + return "elf32-littlearm-fdpic"; + } else - return "elf32-littlearm"; + { + if (target_big_endian) + return "elf32-bigarm"; + else + return "elf32-littlearm"; + } #endif } @@ -25602,6 +25615,7 @@ const char * md_shortopts = "m:k"; #endif #endif #define OPTION_FIX_V4BX (OPTION_MD_BASE + 2) +#define OPTION_FDPIC (OPTION_MD_BASE + 3) struct option md_longopts[] = { @@ -25612,6 +25626,9 @@ struct option md_longopts[] = {"EL", no_argument, NULL, OPTION_EL}, #endif {"fix-v4bx", no_argument, NULL, OPTION_FIX_V4BX}, +#ifdef OBJ_ELF + {"fdpic", no_argument, NULL, OPTION_FDPIC}, +#endif {NULL, no_argument, NULL, 0} }; @@ -26783,6 +26800,12 @@ md_parse_option (int c, const char * arg) fix_v4bx = TRUE; break; +#ifdef OBJ_ELF + case OPTION_FDPIC: + arm_fdpic = TRUE; + break; +#endif /* OBJ_ELF */ + case 'a': /* Listing option. Just ignore these, we don't support additional ones. */ @@ -26877,6 +26900,11 @@ md_show_usage (FILE * fp) fprintf (fp, _("\ --fix-v4bx Allow BX in ARMv4 code\n")); + +#ifdef OBJ_ELF + fprintf (fp, _("\ + --fdpic generate an FDPIC object file\n")); +#endif /* OBJ_ELF */ } #ifdef OBJ_ELF |