From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26884 invoked by alias); 10 Jun 2013 22:51:29 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26834 invoked by uid 89); 10 Jun 2013 22:51:28 -0000 X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 10 Jun 2013 22:51:28 +0000 Received: by mail-ob0-f178.google.com with SMTP id fb19so10866543obc.37 for ; Mon, 10 Jun 2013 15:51:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=Am00bp78OIakAwsU4g9m9jj547VwcxfQFGN0uoPT8SQ=; b=NkAYd68NWJDUUwKi5l7PaOQmU3rf2yF71pWgvULrM9Qjo97CvVFBC3Ial6Soz1co1P NUPxjUGfKBFln4LQpOQLnLnjox5vwIfaiW0ypiMK7hN7ECa5ANvOM23T+DtgQDWVpCVw BjTmNPlbclVOSYAqBR75It6VGWBYEW2vYdk6S4vt9CpLgZzYyQdzoLrZBb7c22PJ/LNp cOmeiqWPjnzN4i3Hv5EKn7i0wAMurVmmgvAimMgg0DVM7OJWyn2dUkgiPrJIewXd1rAq LidyLuAbq3IpHHhiM4f33NgSbZztMKZUSSropLLII0J9XGpRQxrpQ2CLnBI1Sn8YGg1N 8ldw== MIME-Version: 1.0 X-Received: by 10.182.92.225 with SMTP id cp1mr9853933obb.97.1370904686846; Mon, 10 Jun 2013 15:51:26 -0700 (PDT) Received: by 10.60.4.74 with HTTP; Mon, 10 Jun 2013 15:51:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 10 Jun 2013 22:51:00 -0000 Message-ID: Subject: Re: Thumb inline assembly From: Ian Lance Taylor To: Kalai Rajah N Cc: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQm9RAyUkuJtee/JjDI2v7Abp1WBTw5WdI/SY0aBR6obtfRWN7C5WjknqigGbkyRb75Wi38KsUZh5OJFu+cYzj1BrAL1dhfnj3/oxGi5yElkc+0avKL/+xfJ6H/YM2Woq/F4GfsqTjXqSIZg//N0hJnkfP5M0HwR1gHSbnJkpcblAYDhyI9FNm2jCVPkOBUnJ5GDtUow X-SW-Source: 2013-06/txt/msg00059.txt.bz2 On Mon, Jun 10, 2013 at 2:41 PM, Kalai Rajah N wrote: > I'm trying to do a simple register read through ARM inline assembly. > If I embed the asm in the function directly, it works ... ... > I see the following errors: > /tmp/ccYu7aUS.ltrans0.ltrans.o: In function `read_reg_ok': > ccYu7aUS.ltrans0.o:(.text.check_reset_value.4010+0x60): undefined > reference to `r6' > ccYu7aUS.ltrans0.o:(.text.check_reset_value.4010+0x64): undefined > reference to `r4' > ccYu7aUS.ltrans0.o:(.text.check_reset_value.4010+0x68): undefined > reference to `r5' > collect2: error: ld returned 1 exit status > > What am I doing wrong? Your test case has no mention of r4, r5, or r6. It always helps to show a complete standalone test case. The error messages indicate some confusion: there are references to symbols using the names of registers. But I don't know where those are coming from. Ian