]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Sync ARMv8-M code from master branch
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Fri, 20 May 2016 16:16:44 +0000 (17:16 +0100)
committerThomas Preud'homme <thomas.preudhomme@arm.com>
Fri, 20 May 2016 16:18:39 +0000 (17:18 +0100)
2016-05-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* elf32-arm.c (enum elf32_arm_stub_type): Remove
arm_stub_a8_veneer_lwm enumerator.
(arm_stub_a8_veneer_lwm): New global constant.
(elf32_arm_size_stubs): Break if stub was only updated.

gas/
* NEWS: Document support for ARMv8-M and its DSP and Security
Extensions.

gdb/
* arm-tdep.c (arm_elf_make_msymbol_special): A newline after variable
declaration.

include/elf/
* arm.h (enum arm_st_branch_type): Add ST_BRANCH_ENUM_SIZE enumerator.
(NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS): Define macro.
(ENUM_ARM_ST_BRANCH_TYPE_BITMASK): Likewise.
(ARM_GET_SYM_BRANCH_TYPE): Use above variable to mask the bits for
branch type.
(ARM_SET_SYM_BRANCH_TYPE): Add a version with asserts used when
BFD_ASSERT is defined.

bfd/ChangeLog.arm
bfd/elf32-arm.c
gas/ChangeLog.arm
gas/NEWS
gdb/ChangeLog.arm
gdb/arm-tdep.c
include/elf/ChangeLog.arm
include/elf/arm.h

index 5b2d3e34acd8e591eabbf6df96628066dc00ddd2..0c7dbc37866e845346084734af7b761d3adcb12a 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * elf32-arm.c (enum elf32_arm_stub_type): Remove
+       arm_stub_a8_veneer_lwm enumerator.
+       (arm_stub_a8_veneer_lwm): New global constant.
+       (elf32_arm_size_stubs): Break if stub was only updated.
+
 2016-03-29  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * elf32-arm.c (elf32_arm_get_stub_entry): Assert that we don't access
index b36e0883c6ca7e925bf886e28dd465b2c160c76d..417b76ccc733401247a364515711fcb85ee38088 100644 (file)
@@ -2584,12 +2584,13 @@ enum elf32_arm_stub_type
 {
   arm_stub_none,
   DEF_STUBS
-  max_stub_type,
-  /* Note the first a8_veneer type.  */
-  arm_stub_a8_veneer_lwm = arm_stub_a8_veneer_b_cond,
+  max_stub_type
 };
 #undef DEF_STUB
 
+/* Note the first a8_veneer type.  */
+const unsigned arm_stub_a8_veneer_lwm = arm_stub_a8_veneer_b_cond;
+
 typedef struct
 {
   const insn_sequence* template_sequence;
@@ -6251,11 +6252,10 @@ elf32_arm_size_stubs (bfd *output_bfd,
                                               branch_type, &new_stub);
 
                      created_stub = stub_entry != NULL;
-                     if (!created_stub || !new_stub)
-                       {
-                         if (!created_stub)
-                           goto error_ret_free_internal;
-                       }
+                     if (!created_stub)
+                       goto error_ret_free_internal;
+                     else if (!new_stub)
+                       break;
                      else
                        stub_changed = TRUE;
                    }
index b4416605b9861309765a9906d12ad7ac115a68a0..a50d688b6e70becbf4ac82f0bd296ed536533a25 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * NEWS: Document support for ARMv8-M and its DSP and Security
+       Extensions.
+
 2016-03-29  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * config/tc-arm.c (arm_adjust_symtab): Use ARM_SET_SYM_BRANCH_TYPE to
index e20a073646ee8550e82cbfec32d176da0f9fb283..e3c690a127f455eb48c30f28ff64925067b18a4e 100644 (file)
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,4 +1,7 @@
 -*- text -*-
+* Support for the ARMv8-M architecture has been added to the ARM port.  Support
+  for the ARMv8-M Security and DSP Extensions has also been added to the ARM
+  port.
 
 * Add a configure option --enable-x86-relax-relocations to decide whether
   x86 assembler should generate relax relocations by default.  Default to
index 39f5d0e982e2f19690f16cdabc8307c9c7f58331..6aed5ac574525f08aae6543f697bf1d4042631f0 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * arm-tdep.c (arm_elf_make_msymbol_special): A newline after variable
+       declaration.
+
 2016-03-29  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * arm-tdep.c (arm_elf_make_msymbol_special): Use
index 32ee07cb82ea8c37847e5cd0e7f0dbb81fda00d6..cfdc74d021ce6075f4e56db21e41878b40be0e1c 100644 (file)
@@ -9567,6 +9567,7 @@ static void
 arm_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
 {
   elf_symbol_type *elfsym = (elf_symbol_type *) sym;
+
   if (ARM_GET_SYM_BRANCH_TYPE (elfsym->internal_elf_sym.st_target_internal)
       == ST_BRANCH_TO_THUMB)
     MSYMBOL_SET_SPECIAL (msym);
index 6472f542eb5eda217b8891e96252fa8ae7388329..87268d284b7f04061229707df9fed9d06b01a7b5 100644 (file)
@@ -1,3 +1,13 @@
+2016-05-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * arm.h (enum arm_st_branch_type): Add ST_BRANCH_ENUM_SIZE enumerator.
+       (NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS): Define macro.
+       (ENUM_ARM_ST_BRANCH_TYPE_BITMASK): Likewise.
+       (ARM_GET_SYM_BRANCH_TYPE): Use above variable to mask the bits for
+       branch type.
+       (ARM_SET_SYM_BRANCH_TYPE): Add a version with asserts used when
+       BFD_ASSERT is defined.
+
 2016-03-29  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * arm.h (ARM_GET_SYM_CMSE_SPCL): Define macro.
index a1cc42cc02002e76cab71462beb3f1d7724c6cb4..e5127056334d64ce38ec21ecdf0b2d047548a991 100644 (file)
@@ -353,13 +353,30 @@ enum arm_st_branch_type {
   ST_BRANCH_TO_ARM,
   ST_BRANCH_TO_THUMB,
   ST_BRANCH_LONG,
-  ST_BRANCH_UNKNOWN
+  ST_BRANCH_UNKNOWN,
+  ST_BRANCH_ENUM_SIZE
 };
 
-#define ARM_GET_SYM_BRANCH_TYPE(SYM_TARGET_INTERNAL) \
-  ((enum arm_st_branch_type) ((SYM_TARGET_INTERNAL) & 3))
-#define ARM_SET_SYM_BRANCH_TYPE(SYM_TARGET_INTERNAL,TYPE) \
-  ((SYM_TARGET_INTERNAL) = ((SYM_TARGET_INTERNAL) & ~3) | ((TYPE) & 3))
+#define NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS 2
+#define ENUM_ARM_ST_BRANCH_TYPE_BITMASK        \
+  ((1 << NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS) - 1)
+
+#define ARM_GET_SYM_BRANCH_TYPE(STI) \
+  ((enum arm_st_branch_type) ((STI) & ENUM_ARM_ST_BRANCH_TYPE_BITMASK))
+#ifdef BFD_ASSERT
+#define ARM_SET_SYM_BRANCH_TYPE(STI, TYPE)                     \
+  do {                                                         \
+    BFD_ASSERT (TYPE <= ST_BRANCH_ENUM_SIZE);                  \
+    BFD_ASSERT ((1 << NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS)                \
+               >= ST_BRANCH_ENUM_SIZE);                        \
+    (STI) = (((STI) & ~ENUM_ARM_ST_BRANCH_TYPE_BITMASK)                \
+            | ((TYPE) & ENUM_ARM_ST_BRANCH_TYPE_BITMASK));     \
+  } while (0)
+#else
+#define ARM_SET_SYM_BRANCH_TYPE(STI, TYPE)                     \
+  (STI) = (((STI) & ~ENUM_ARM_ST_BRANCH_TYPE_BITMASK)          \
+          | ((TYPE) & ENUM_ARM_ST_BRANCH_TYPE_BITMASK))
+#endif
 
 /* Get or set whether a symbol is a special symbol of an entry function of CMSE
    secure code.  */