mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Felix Janda <felix.janda@posteo.de>
To: musl@lists.openwall.com
Subject: Re: debugging problem with musl ld and qemu-ppc
Date: Sun, 19 Oct 2014 22:29:35 +0200	[thread overview]
Message-ID: <20141019202934.GA11042@euler> (raw)
In-Reply-To: <20141016165839.GA1257@euler>

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


  reply	other threads:[~2014-10-19 20:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16  6:09 Felix Janda
2014-10-16 15:34 ` Rich Felker
2014-10-16 16:58   ` Felix Janda
2014-10-19 20:29     ` Felix Janda [this message]
2014-10-19 21:13       ` Rich Felker
2014-11-01 21:41         ` Felix Janda
2014-11-01 21:47           ` Rich Felker
2014-11-01 22:01             ` Felix Janda
2014-11-03 23:11               ` stephen Turner
2014-11-04 18:34                 ` Felix Janda
2014-10-17 19:30   ` Felix Janda
2014-10-17 20:17     ` Rich Felker
2014-10-17 21:15       ` Felix Janda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141019202934.GA11042@euler \
    --to=felix.janda@posteo.de \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).