From patchwork Mon Jun 20 13:36:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 637970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3rYBjF6WHyz9sdn for ; Mon, 20 Jun 2016 23:36:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=KqPDV9P0; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=T8VOKaKTeoieUKVrlZ9dkZEvw8HLdFBJLBZ3Slx0RYVY+VV+7A 83PmkgvWhKTWzw1zp6Nz/XYOg3w81rVAFnU6HHfk4obXm1vsQcCWsfdMfbEIK9lz j5Mba5+505zF24Dhd7BNcbosFGRvt7PrK9tF7iCl5zLFbuqKQ+53Rw8Xo= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=gdyg4rh6uH16YElDLsdQjIW46sY=; b=KqPDV9P0hONW9WSjTRrE xe7v+QvEIAQ60WsJREi355Cn54ELSuwXLKKbrXeac4sEi2o8dbnpnLQ6UrY/klCD L0nuJnAaF0vyDLTz3sRgvGmZooM1DNWqJS4GxPLbXy4FrR1xRP1WMzI61Pp4xZJH pCbZjwKkArCkwLjVCjMspFg= Received: (qmail 2093 invoked by alias); 20 Jun 2016 13:36:42 -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 2042 invoked by uid 89); 20 Jun 2016 13:36:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=24213 X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.220) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 20 Jun 2016 13:36:31 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwTPLBCxG2PQt7BpaBF2I= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.123] (ip5f5871e3.dynamic.kabel-deutschland.de [95.88.113.227]) by smtp.strato.de (RZmta 38.6 DYNA|AUTH) with ESMTPSA id i07cd7s5KDaPZDv (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Mon, 20 Jun 2016 15:36:25 +0200 (CEST) To: GCC Patches Cc: Denis Chertykov From: Georg-Johann Lay Subject: [patch, avr] Fix PR30417: Wrap -Tdata into %{!Tdata:...}. Message-ID: <4ed641e0-6de8-5c95-794a-842f75b7a2af@gjlay.de> Date: Mon, 20 Jun 2016 15:36:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 X-IsSubscribed: yes This patch allows to specify -Tdata and -Ttext on the command line for MCUs where the specs file sets these options. For -mmcu=atmega88 for example, the respective specs reads: *link_data_start: -Tdata 0x800100 and the patch changes this to *link_data_start: %{!Tdata:-Tdata 0x800100} Same for *link_text_start and -Ttext. Ok for trunk and backport? Johann PR target/30417 * config/avr/gen-avr-mmcu-specs.c (print_mcu): [*link_data_start]: Wrap -Tdata into %{!Tdata:...}. [*link_text_start]: Wrap -Ttext into %{!Ttext:...}. Index: config/avr/gen-avr-mmcu-specs.c =================================================================== --- config/avr/gen-avr-mmcu-specs.c (revision 237587) +++ config/avr/gen-avr-mmcu-specs.c (working copy) @@ -242,12 +242,13 @@ bool is_arch = NULL == mcu->macro; fprintf (f, "*link_data_start:\n"); if (mcu->data_section_start != arch->default_data_section_start) - fprintf (f, "\t-Tdata 0x%lX", 0x800000UL + mcu->data_section_start); + fprintf (f, "\t%%{!Tdata:-Tdata 0x%lX}", + 0x800000UL + mcu->data_section_start); fprintf (f, "\n\n"); fprintf (f, "*link_text_start:\n"); if (mcu->text_section_start != 0x0) - fprintf (f, "\t-Ttext 0x%lX", 0UL + mcu->text_section_start); + fprintf (f, "\t%%{!Ttext:-Ttext 0x%lX}", 0UL + mcu->text_section_start); fprintf (f, "\n\n"); }