From patchwork Tue Oct 8 15:20:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andre Vieira (lists)" X-Patchwork-Id: 1173386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510474-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="xEPI1fIB"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46ngyv2xlFz9sPT for ; Wed, 9 Oct 2019 02:20:37 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=ZEzRB2CP4mbEsSfw V8HoA4Y5bBQilay5WnoODLPWNEyCgEyk9i74Ej6KUfljSFGOXg+JzgtX9g8Ahgu+ VXoTjNQyi7ljPJMYaPBZVJYWIV/tWOfmkuXyh76w8TfCNDqTHvPgjOpVn4DJV84v CA66Uth+wWc2w4EmU7ovsSDDMRY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=r/Yhi0Ra8QWls5U2888SYx egJmM=; b=xEPI1fIB88KbhQn/4rzmd0oDEyfukcO6eX+RYqty8r11AMC/aUgg8I +4urRI2smYU4KQapKZGQs7mg5o38pgTWuHDTec7iIlMI3503T7+NjnUIUDdxy/sA ocFZ1qyYF3BfO1+P3jSAixpsSRdxc7Z8HWwFhK0JdpN/nmUlu0E0E= Received: (qmail 98099 invoked by alias); 8 Oct 2019 15:20:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 98091 invoked by uid 89); 8 Oct 2019 15:20:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.1 spammy=arms X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Oct 2019 15:20:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 449161570 for ; Tue, 8 Oct 2019 08:20:26 -0700 (PDT) Received: from [10.2.206.37] (e107157-lin.cambridge.arm.com [10.2.206.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0B2733F68E for ; Tue, 8 Oct 2019 08:20:25 -0700 (PDT) From: "Andre Vieira (lists)" Subject: [Patch 0/2][ipa, Arm] Fix cloning of 'cmse_nonsecure_entry' functions To: gcc-patches Message-ID: <712b0e9d-0d6a-c6de-07bf-f70799d0417a@arm.com> Date: Tue, 8 Oct 2019 16:20:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, This patch series is aimed at fixing an issue when cloning a function with 'cmse_nonsecure_entry' attribute. Currently if gcc determines to clone a function with this attribute, both the cloned and original declarations will be compiled as nonsecure entry functions. The linker eventually complains about a non-global cmse entry function and errors out. It is legal to clone these functions, since the clone will only be used directly by the same translation unit as the original cmse entry function. However, the clones should not be marked as entry functions. So in patch 1 I'll add a target hook that allows each target to sanitize the cloned declaration's attributes and in patch 2 I'll make the arm's implementation of it remove 'cmse_nonsecure_entry' from the cloned declaration's attribute list. Andre Vieira (2) [Patch 1/2][ipa] Add target hook to sanitize cloned declaration's attributes [Patch 2/2][Arm] Implement TARGET_HOOK_SANITIZE_CLONE_ATTRIBUTES to remove cmse_nonsecure_entry Bootstrapped the series on x86_64 and built arm-none-eabi, running the cmse testsuite for armv8-m.main and armv8-m.base. Cheers, Andre