aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2017-05-08 15:26:51 +0100
committerThomas Preud'homme <thomas.preudhomme@arm.com>2017-05-08 15:26:51 +0100
commit046734ff424bc5a4c1b6a69630d5bb31aa67165c (patch)
tree96a6f114e33082729b916a70f1c5da6c76df7629 /bfd/elf32-arm.c
parent313c59612298b022a408ca390bd5f73f28708015 (diff)
downloadgdb-046734ff424bc5a4c1b6a69630d5bb31aa67165c.zip
gdb-046734ff424bc5a4c1b6a69630d5bb31aa67165c.tar.gz
gdb-046734ff424bc5a4c1b6a69630d5bb31aa67165c.tar.bz2
Make import libraries relocatable objects
For ELF targets --out-implib currently generates an executable file (e_type is ET_EXEC) despite the file being expected to be linked against some other object file to make an executable later. It seems therefore more sensible to make the import library a relocatable object file (e_type set to ET_REL). Incidentally, as dicted by requirement 8 of "ARM v8-M Security Extensions: Requirements on Development Tools" (document ARM-ECM-0359818) version 1.0, import libraries generated when using --cmse-implib *must* be relocatable object file so this commit also adds an assert there in case the type of ELF import library is changed again in the future. 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com> bfd/ * elflink.c (elf_output_implib): Remove executable flag from import library bfd. * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import library is a relocatable object file. ld/ * testsuite/ld-arm/arm-elf.exp (Secure gateway import library generation): Check e_type field of import library and executable produced. * testsuite/ld-arm/cmse-implib.type: Expectations for e_type field.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 434649f..8dcaf45 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -17498,6 +17498,10 @@ elf32_arm_filter_implib_symbols (bfd *abfd ATTRIBUTE_UNUSED,
{
struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (info);
+ /* Requirement 8 of "ARM v8-M Security Extensions: Requirements on
+ Development Tools" (ARM-ECM-0359818) mandates Secure Gateway import
+ library to be a relocatable object file. */
+ BFD_ASSERT (!(bfd_get_file_flags (info->out_implib_bfd) & EXEC_P));
if (globals->cmse_implib)
return elf32_arm_filter_cmse_symbols (abfd, info, syms, symcount);
else