public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: Alan Modra <amodra@bigpond.net.au>,
	Jakub Jelinek <jakub@redhat.com>,
	John David Anglin <dave@hiauly1.hia.nrc.ca>,
	parisc-linux@parisc-linux.org, binutils@sources.redhat.com
Subject: Re: [parisc-linux] binutils 2.15?
Date: Mon, 21 Jun 2004 15:18:00 -0000	[thread overview]
Message-ID: <20040621151800.GC16360@baldric.uwo.ca> (raw)
In-Reply-To: <20040614120820.GG28716@bubble.modra.org>

> There's a lazy linking stub inserted at the end of the .plt section that
> loads the .got address by
> 
>   b,l	1b,%r20
>   depi	0,31,2,%r20
> 
> ie. it depends on .got immediately following these instructions.

My apologies for a tardy reply.

We don't *have* to depend on the .got immediately following these
instructions. Technically we look for a signature at the end of the PLT.
The code in glibc looks beyond the last relocation in the following 
equation:

ptr = reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB

And if it finds the signature at ptr[-2] and ptr[-1], then it
acknowledges that as the PLT stub. It then by proxy knows that the GOT
should be at ptr[0], but it doesn't have to rely strictly on this, I'm
more than willing to add more code to glibc to remove this restriction.

I just don't really know how other arches find the GOT at this early 
stage in ld.so's startup (e.g. elf_machine_runtime_setup()).

The only reason we use the GOT here is because we want to identify the
shared object by storing a pointer to the DSO link_map into GOT[1]. 
Which to tell you the truth, I'm sure has to do with something in 
binutils that I currently don't understand.

I'm slowly reviewing the binutils hppa code because I'd like to clean it
up / understand it enough to add TLS.

Jakub, I hope this helps, if someone has an idea then I would be more
than happy to implement the change and test the resulting
binutils/glibc.

Cheers,
Carlos.

  reply	other threads:[~2004-06-21 15:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <40BDA020000074B9@ocpmta3.freegates.net>
2004-06-14  4:09 ` John David Anglin
2004-06-14  5:39   ` Jakub Jelinek
2004-06-14 12:08     ` Alan Modra
2004-06-21 15:18       ` Carlos O'Donell [this message]
2004-06-28  3:25         ` John David Anglin
2004-07-01 22:50       ` John David Anglin
2004-07-01 23:00         ` Jakub Jelinek
2004-07-22 10:09           ` Joel Soete
     [not found] <20040702040316.GL21696@bubble.modra.org>
2004-07-05 20:18 ` John David Anglin
2004-07-05 20:34 ` John David Anglin

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=20040621151800.GC16360@baldric.uwo.ca \
    --to=carlos@baldric.uwo.ca \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=jakub@redhat.com \
    --cc=parisc-linux@parisc-linux.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).