Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GNU libc hacker <libc-hacker@sources.redhat.com>,
	binutils@sourceware.cygnus.com, linux-mips@oss.sgi.com
Subject: Re: Prelink for mips (Re: MIPS broken in 2.3)
Date: Mon, 7 Jan 2002 13:16:04 -0800	[thread overview]
Message-ID: <20020107131604.A6383@lucon.org> (raw)
In-Reply-To: <20011217185215.K542@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Mon, Dec 17, 2001 at 06:52:15PM +0100

On Mon, Dec 17, 2001 at 06:52:15PM +0100, Jakub Jelinek wrote:
> On Mon, Dec 17, 2001 at 09:10:32AM -0800, H . J . Lu wrote:
> > On Mon, Dec 17, 2001 at 12:36:31PM +0100, Jakub Jelinek wrote:
> > 
> > > instead (well, best would be if somebody ported prelink to mips;
> > > I'll try to answer any questions and help).
> > 
> > Do you have some documentations how prelink works?
> 
> So far not too much. Some info is in prelink(8) man page, some info
> was posted to binutils mailing list.

I have prelink-20011010.tar.bz2. Is that current?

> 
> > > I skipped mips because it is way too different from how any other ELF
> > > architecture works (e.g. using a single dynamic reloc type for everything
> > > with various meanings, etc.) and I have no access to it.
> > 
> > That is what I am afraid of. The MIPS ABI supports "quickstart".
> 
> I know, but from what I understood, quickstart e.g. just assumes there won't
> be conflicts and if there are, their handling is very costly (their
> conflicts are just symbol indices which need to be checked out).
> prelink conflicts are ElfW(Rela) relocs against r_symndx 0.
> 
> To port prelink to a new architecture, you need basically:
> 1) determine what you need to do with relocations and special CPU sections
>    when relocating a shared library from one address to another one
>    (e.g. you can link a shared libs once at VMA 0, once at VMA 0xdeadb000
>    and see what changed) - these are *_adjust_* functions
> 2) write routines which apply relocs (*_prelink_rel*)
> 3) write routines which create conflict relocs
> 4) as MIPS is rel, it needs to be figured out when it is needed to convert
>    from Rel to Rela (in i386/arm case in most cases it can be avoided,
>    the only relocs which require it are (on i386): R_386_32 with nonzero
>    addend (otherwise R_386_GLOB_DAT does exactly the same thing) and
>    R_386_PC32). This is needed, because otherwise the information about the
>    original addend is lost when the final relocated value is stored at
>    r_offset address. Original addend is needed, if prelink cannot be used,
>    during dynamic linking. If MIPS has some place where it stashes this
>    for Quickstart, then it could be reused, otherwise I'm afraid REL->RELA will
>    happen more often on MIPS than on IA-32/ARM.
> 5) write routines which apply relocs to a buffer or apply a conflict
>    to a buffer (these are used when doing comparisons on relocated content)
> 

As I unsterstand, MIPS only has R_MIPS_REL32 for GOT in DSO and EXE. Do you
have any suggestions? 


H.J.

  reply	other threads:[~2002-01-07 22:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <u8ellzsg3q.fsf@gromit.moeb>
     [not found] ` <20011213093958.A6057@lucon.org>
     [not found]   ` <hou1uqclnk.fsf@gee.suse.de>
     [not found]     ` <20011217123631.G542@sunsite.ms.mff.cuni.cz>
2001-12-17 17:10       ` Prelink for mips (Re: MIPS broken in 2.3) H . J . Lu
2001-12-17 17:52         ` Jakub Jelinek
2002-01-07 21:16           ` H . J . Lu [this message]
2002-01-08  2:29             ` H . J . Lu

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=20020107131604.A6383@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sourceware.cygnus.com \
    --cc=jakub@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=linux-mips@oss.sgi.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox