Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thomas Preudhomme <thomas.preudhomme@foss.arm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH, gdb, ARM] Use getters/setters to access ARM branch type
Date: Tue, 10 May 2016 14:40:00 -0000	[thread overview]
Message-ID: <3219422.otqiV2U3aN@e108577-lin> (raw)

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


             reply	other threads:[~2016-05-10 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 14:40 Thomas Preudhomme [this message]
2016-05-10 15:12 ` Yao Qi
2016-05-10 15:32   ` Thomas Preudhomme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3219422.otqiV2U3aN@e108577-lin \
    --to=thomas.preudhomme@foss.arm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox