From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4658 invoked by alias); 22 Mar 2010 01:14:00 -0000 Received: (qmail 4642 invoked by uid 22791); 22 Mar 2010 01:13:58 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-px0-f193.google.com (HELO mail-px0-f193.google.com) (209.85.216.193) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Mar 2010 01:13:53 +0000 Received: by pxi31 with SMTP id 31so1581562pxi.3 for ; Sun, 21 Mar 2010 18:13:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.255.10 with SMTP id c10mr3477303rvi.289.1269220432129; Sun, 21 Mar 2010 18:13:52 -0700 (PDT) In-Reply-To: References: <302c6e641003190237t51b81746ob43db174f2d08bab@mail.gmail.com> From: kum Date: Mon, 22 Mar 2010 04:38:00 -0000 Message-ID: <302c6e641003211813m31d2d9a1l8c26c10c018c81c0@mail.gmail.com> Subject: Re: DSO: pc relative symbol address To: Ian Lance Taylor Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2010-03/txt/msg00247.txt.bz2 I am on mips and it neither supports PC relative load nor the PC can be read . You are correct, I should have looked up MIPS addressing modes before coming here... Thanks Ian. kumaresh On Fri, Mar 19, 2010 at 9:20 PM, Ian Lance Taylor wrote: > kum writes: > >> There are no direct invocation of my_foo1. What prevents the compiler >> from emitting a PC relative address to store in my_foo? Something like >> =A0 lw $2, PC - > > You need to get the address of my_foo1 into $2. =A0Using a PC relative > value only works if your processor has a PC-relative load instruction. > Not all processors have such an instruction. =A0If your processor has > one and gcc is not using it, then this may be a bug. > > Ian >