From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6373 Path: news.gmane.org!not-for-mail From: Felix Janda Newsgroups: gmane.linux.lib.musl.general Subject: Re: debugging problem with musl ld and qemu-ppc Date: Sun, 19 Oct 2014 22:29:35 +0200 Message-ID: <20141019202934.GA11042@euler> References: <20141016060741.GA3707@euler> <20141016153448.GY32028@brightrain.aerifal.cx> <20141016165839.GA1257@euler> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1413750621 15516 80.91.229.3 (19 Oct 2014 20:30:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Oct 2014 20:30:21 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6386-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 19 22:30:16 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Xfx7G-0002C0-RR for gllmg-musl@plane.gmane.org; Sun, 19 Oct 2014 22:30:14 +0200 Original-Received: (qmail 10090 invoked by uid 550); 19 Oct 2014 20:30:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 10047 invoked from network); 19 Oct 2014 20:29:59 -0000 X-Virus-Scanned: amavisd-new at posteo.de Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20141016165839.GA1257@euler> User-Agent: Mutt/1.5.22 (2013-10-16) Xref: news.gmane.org gmane.linux.lib.musl.general:6373 Archived-At: Felix Janda wrote: > Rich Felker wrote: [..] > > What I'm not clear about is the cause for why the linker is forcing > > you back to the bss-plt model. It might be a matter of the strange > > relocation type you put in a.s: > > > > 00000000 <.text>: > > 0: 48 00 00 00 b 0x0 > > 0: R_PPC_LOCAL24PC _GLOBAL_OFFSET_TABLE_ > > The problem caused a self-compiled native gcc to crash because the file > "mpn/powerpc32/elf.m4" (used to generate some assembly) in the gmp tree > contains a similar instruction. > > I've found the part in binutils emitting the warning and will try to see > why it forces bss-plt. This seems to be caused by the part starting from lines 4267 in [1] /* This refers only to functions defined in the shared library. */ case R_PPC_LOCAL24PC: if (h != NULL && h == htab->elf.hgot && htab->plt_type == PLT_UNSET) { htab->plt_type = PLT_OLD; htab->old_bfd = abfd; } I think it was added to be helpful and detect the construction bl _GLOBAL_OFFSET_TABLE_@local-4 mflr r30 intended to load a pointer to the got into r30, which no longer works with secure-plt. See [2]. Felix [1]: http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/elf32-ppc.c;h=04c2d6ad60b4122eb1727e932cfcda035feeac68;hb=HEAD [2]: http://www.sourceware.org/ml/binutils/2005-05/txt00011.txt