From patchwork Tue May 10 14:39:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Preud'homme X-Patchwork-Id: 12184 Received: (qmail 62777 invoked by alias); 10 May 2016 14:40:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 62724 invoked by uid 89); 10 May 2016 14:40:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, KAM_STOCKGEN, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=sk:ARM_SYM, sk:st_bran, sk:arm_elf, sk:ST_BRAN X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 May 2016 14:39:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C18B43C for ; Tue, 10 May 2016 07:40:07 -0700 (PDT) Received: from e108577-lin.localnet (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30A973F252 for ; Tue, 10 May 2016 07:39:56 -0700 (PDT) From: Thomas Preudhomme To: gdb-patches@sourceware.org Subject: [PATCH, gdb, ARM] Use getters/setters to access ARM branch type Date: Tue, 10 May 2016 15:39:54 +0100 Message-ID: <3219422.otqiV2U3aN@e108577-lin> User-Agent: KMail/4.13.3 (Linux/3.13.0-85-generic; KDE/4.13.3; x86_64; ; ) MIME-Version: 1.0 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 * arm-tdep.c (arm_elf_make_msymbol_special): Use ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol. Is this ok for the master branch? Best regards, Thomas 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); }