Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH, gdb, ARM] Use getters/setters to access ARM branch type
@ 2016-05-10 14:40 Thomas Preudhomme
  2016-05-10 15:12 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Preudhomme @ 2016-05-10 14:40 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, gdb, ARM] Use getters/setters to access ARM branch type
  2016-05-10 14:40 [PATCH, gdb, ARM] Use getters/setters to access ARM branch type Thomas Preudhomme
@ 2016-05-10 15:12 ` Yao Qi
  2016-05-10 15:32   ` Thomas Preudhomme
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2016-05-10 15:12 UTC (permalink / raw)
  To: Thomas Preudhomme; +Cc: gdb-patches

Thomas Preudhomme <thomas.preudhomme@foss.arm.com> writes:

> @@ -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;

We need a blank line here.

> +  if (ARM_GET_SYM_BRANCH_TYPE (elfsym->internal_elf_sym.st_target_internal)
>        == ST_BRANCH_TO_THUMB)
>      MSYMBOL_SET_SPECIAL (msym);

Patch is OK to me.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, gdb, ARM] Use getters/setters to access ARM branch type
  2016-05-10 15:12 ` Yao Qi
@ 2016-05-10 15:32   ` Thomas Preudhomme
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Preudhomme @ 2016-05-10 15:32 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On Tuesday 10 May 2016 16:11:51 Yao Qi wrote:
> Thomas Preudhomme <thomas.preudhomme@foss.arm.com> writes:
> > @@ -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;
> 
> We need a blank line here.
> 
> > +  if (ARM_GET_SYM_BRANCH_TYPE
> > (elfsym->internal_elf_sym.st_target_internal)> 
> >        == ST_BRANCH_TO_THUMB)
> >      
> >      MSYMBOL_SET_SPECIAL (msym);
> 
> Patch is OK to me.

Committed with the above changes.

Thanks. Best regards,

Thomas


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-10 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10 14:40 [PATCH, gdb, ARM] Use getters/setters to access ARM branch type Thomas Preudhomme
2016-05-10 15:12 ` Yao Qi
2016-05-10 15:32   ` Thomas Preudhomme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox