This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH, gdb, ARM] Use getters/setters to access ARM branch type
- From: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 10 May 2016 15:39:54 +0100
- Subject: [PATCH, gdb, ARM] Use getters/setters to access ARM branch type
- Authentication-results: sourceware.org; auth=none
This patch is part of a patch series to add support for ARMv8-M security
extension[1] to GNU ld. This specific patch changes all accesses to the
branch type stored in the st_target_internal field of a Elf_Internal_Sym
structure or in the target_internal field of a elf_link_hash_entry
structure by getter and setters. This is required by subsequent patches to
also store in these fields whether a symbol is a special symbol indicating
a secure entry function.
[1] Software requirements for ARMv8-M security extension are described in
document ARM-ECM-0359818 [2] [2] Available on http://infocenter.arm.com in
Developer guides and articles > Software development > ARMÂv8-M Security
Extensions: Requirements on Development Tools
Please find below the gdb part of the ChangeLog and patch. For the full
version, please see [2].
[2] https://sourceware.org/ml/binutils/2016-05/msg00040.html
*** gdb/ChangeLog ***
2015-12-16 Thomas Preud'homme <thomas.preudhomme@arm.com>
* arm-tdep.c (arm_elf_make_msymbol_special): Use
ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index
5a2d490df77905d6cf6a82041c7304b57581a82d..d02bdb27b99d7fc4d179e8e51c1a421c7c101da8
100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -8467,7 +8467,8 @@ coff_sym_is_thumb (int val)
static void
arm_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
{
- if (ARM_SYM_BRANCH_TYPE (&((elf_symbol_type *)sym)->internal_elf_sym)
+ 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);
}
Is this ok for the master branch?
Best regards,
Thomas