From patchwork Thu Jan 11 13:54:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 859139 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-470837-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vxwLsyGb"; 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 3zHS6s735dz9s8J for ; Fri, 12 Jan 2018 00:54:45 +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:date :message-id:from:to:cc:subject:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=Af0EBCJhsNOkwwVt E7guexPTGh9V94FA+CoH+EGcC8OBYIeVu36zcRGF9x6pFn04/b0lt1Vb2wdSFxI8 y5sQV2IhJ2vFTBli1DDwiO6XAR9YO2atnLNx96yLOSnUdd9L/Ct9/ClKKVL5vwew azE0GWUE9f9Y621l+ohfYy4nHx8= 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:date :message-id:from:to:cc:subject:mime-version:content-type :content-transfer-encoding; s=default; bh=cSwYRkaqbFzF3ZGuD7/0z6 chFo8=; b=vxwLsyGbbS95r13bJU/Lp7+whzFdn/JpNfAAbNBbMMo7H94MEFbrqB WOmNMKuWmN/z27BPFZLEmcheA+YdNFVREJq0xwmuEOKEOTGkXML31ujN8PV403Y4 7GqF2X0KeNpzA+A+DEPZE+WQY4HqfXR+dVtq+Q6Ad8wx8E5d6tRqI= Received: (qmail 95632 invoked by alias); 11 Jan 2018 13:54:39 -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 94930 invoked by uid 89); 11 Jan 2018 13:54:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:10.98.206.1, Hx-languages-length:1497, H*Ad:D*xilinx.com X-HELO: mail-pf0-f171.google.com Received: from mail-pf0-f171.google.com (HELO mail-pf0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Jan 2018 13:54:35 +0000 Received: by mail-pf0-f171.google.com with SMTP id k19so1692974pfj.5 for ; Thu, 11 Jan 2018 05:54:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:to:cc:subject:mime-version :content-transfer-encoding; bh=00Qv0Xy3vCMfGPlXYrP9y3zxh5eZUrm82SLi+Yam72w=; b=NRt4hEGTrmR4uKx+lquLctwmSbPt/1gDCwhA4uq4kf/lJgZwYjCEhOYw5A7QrJzDqI vl8syJnWhkXQm32YUnI7GkM07Bew6hk8gmiobOT6sNQrgGVOOlXqEgtfSIQc5n1vMCBx TWA/0F21znbS68WiQBwZ8POz5rGL/sODvsMX9dT2+sRKdrs9tKLLZLm+f4b7G3HSlt5r 2K2PwJfOIUuWpBvNH26Ai/bXLZjRw2CB87mvEnJBWunSeZK2fNqV5PLaAuyofl78+wdX sfyHi1fGxQ3IdupRlU1TvwJoQrTvBP/jCRT3Quw7YQAQVzUOLxmPUfVuYBhUOI0MsAwr NsEw== X-Gm-Message-State: AKwxytd5EEcmwxgk5lCXMPy26dGkf2NVZ/07Kfo9NvDc4cA8kHdv0xCm WycEnwSgLjdYXWCfJSycDmEwXG8tEUo= X-Google-Smtp-Source: ACJfBotrdmRSnXD2PFPes1hHjfecVBq9L3qWLisciyi4tIIgeuqMaZI4LmX1RXY3scxDlH36kbgt0g== X-Received: by 10.98.206.1 with SMTP id y1mr9169843pfg.136.1515678873253; Thu, 11 Jan 2018 05:54:33 -0800 (PST) Received: from [127.0.1.1] (CPE-123-211-139-147.lnse3.woo.bigpond.net.au. [123.211.139.147]) by smtp.gmail.com with ESMTPSA id z13sm12447237pgp.28.2018.01.11.05.54.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 05:54:32 -0800 (PST) Date: Thu, 11 Jan 2018 23:54:23 +1000 Message-Id: <20180111135423.31423-1-nathan@nathanrossi.com> From: Nathan Rossi To: gcc-patches@gcc.gnu.org Cc: Nathan Rossi , Jeff Law , Michael Eager , Nagaraju Mekala Subject: [PATCH] MicroBlaze resolve section change issues for ident output MIME-Version: 1.0 X-IsSubscribed: yes Change 'microblaze_asm_output_ident' so that instead of just switching section to .sdata2/.rodata it uses the assembler .pushsection and .popsection directives to preserve the section context when emitting the ident string content. This resolves issues associated with the use of the .sdata2/.rodata operation in cases where emitted assembly after the ident output is incorrectly in the .sdata2/.rodata section instead of .text or any other expected section. This results in assembly failures including operations with symbols across different segments. gcc/ChangeLog 2018-01-11 Nathan Rossi PR target/83013 * config/microblaze/microblaze.c (microblaze_asm_output_ident): Use .pushsection/.popsection --- gcc/config/microblaze/microblaze.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 51511ca2fc..9a4a287be2 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -3394,7 +3394,9 @@ microblaze_asm_output_ident (const char *string) else section_asm_op = READONLY_DATA_SECTION_ASM_OP; - buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\0\"\n", NULL)); + buf = ACONCAT (("\t.pushsection", section_asm_op, + "\n\t.ascii \"", string, "\\0\"\n", + "\t.popsection\n", NULL)); symtab->finalize_toplevel_asm (build_string (strlen (buf), buf)); }