From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4448 invoked by alias); 14 May 2012 16:57:13 -0000 Received: (qmail 4407 invoked by uid 22791); 14 May 2012 16:57:07 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_BJ X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 May 2012 16:56:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 15E8A1C6EFD; Mon, 14 May 2012 12:56:45 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Kmp766v0P96Q; Mon, 14 May 2012 12:56:45 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id DA08D1C6EFB; Mon, 14 May 2012 12:56:44 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 0F24D145616; Mon, 14 May 2012 09:56:37 -0700 (PDT) Date: Mon, 14 May 2012 16:57:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: Regression for gdb.fortran/library-module.exp [Re: [RFA] choose symbol from given block's objfile first.] Message-ID: <20120514165637.GK10253@adacore.com> References: <1336430581-11262-1-git-send-email-brobecker@adacore.com> <874nrqvbeh.fsf@fleche.redhat.com> <20120509190529.GI15555@adacore.com> <20120511072606.GA25458@host2.jankratochvil.net> <20120514143927.GB10253@adacore.com> <20120514145151.GA30451@host2.jankratochvil.net> <20120514150552.GH10253@adacore.com> <20120514151447.GA31010@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120514151447.GA31010@host2.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00521.txt.bz2 > Works for me, it is also perfectly defined this way: > > echo -e '#include \nint x=1;void f(void){printf("lib:%d\\n",x);}'|gcc -x c -fPIC -Wall -shared -o var.so -;echo -e '#include \nint x=2;extern void f(void);int main(void){printf("main:%d\\n",x);f();return 0;}'|gcc ./var.so -x c -Wall -o var -;./var > main:2 > lib:2 [Mumbling something about the guy who invented the notion that one-liners are cool and witty... Your one-liners are easy to understand, but always extremely labour intenstive to read] That being said, thanks for setting me straight. I don't understand why the linker rejected it for me, and I don't have the code anymore. So this is another example of copy-relocation? When you say this is perfectly defined, this looks horrifying to me. It feels like you can break a shared library's code that way... -- Joel