public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Jack Carter <Jack.Carter@imgtec.com>
Cc: "libc-ports@sourceware.org" <libc-ports@sourceware.org>
Subject: RE: [RFC][PATCH] MIPS ifunc for glibc
Date: Tue, 20 Aug 2013 14:03:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1308201344580.15834@digraph.polyomino.org.uk> (raw)
In-Reply-To: <4CEFBC1BE64A8048869F799EF2D2EEEE01AAEA08@BADAG02.ba.imgtec.org>

On Tue, 20 Aug 2013, Jack Carter wrote:

> Is this enough? If not, could you point me to an example I could model after?

What you have doesn't really look like an ABI document at all; it looks 
like an implementation sketch.  I don't know what you mean by "a.outs" at 
all, let alone "Non-shared a.outs" and "Shared a.outs".  Please use the 
appropriate terminology from the gABI and existing psABI documents.  For 
example, if you mean ET_EXEC (which of course excludes PIEs, which are 
ET_DYN objects that can also be executed directory), then say so.  If you 
mean a particular subset of ET_EXEC objects, be clear about what subset 
(again, in standard terms).  If you mean some ET_EXEC and some ET_DYN 
objects, again, make that clear.

The specification should ideally be sufficient for someone to write an 
interoperable static or dynamic linker without needing to refer to an 
existing implementation.

As an example, you could always look at the existing MIPS o32 ABI document 
(from SCO, last updated 1996).  Like many such documents, it is of limited 
current value for reliably describing any ABI in current use.  But it 
indicates the sort of level of detail in such specifications, and thinking 
in terms of what text should be inserted where in the document is a good 
starting point for thinking about how to specify an ABI extension.  Or see 
the non-PIC ABI specification 
<http://gcc.gnu.org/ml/gcc/2008-07/txt00000.txt>.

Among other things, the specification needs to state the values of any new 
relocations....  (Your text mentions both R_MIPS_IRELOCATE and 
R_MIPS_IRELATIVE but never gives them numeric values.)

> > Why aren't you consistently passing the HWCAP value to resolver functions
> > (it seems some places pass it but others don't)?  If you don't pass it
> > from the start, it could be problematic to change the ABI later to start
> > passing it, as applications' IFUNC resolvers wouldn't know if they are
> > being run with a glibc version that passes the HWCAP value to them or not.
> > The ABI document should presumably specify what arguments get passed to
> > the resolver function....
> 
> I am not sure what you mean by passing the HWCAP value to the resolver. 
> The resolver contains logic that determines the HWCAP and from that 
> picks the actual function that is most appropriate for the hardware 
> being run on, returning the address to said function.

In elf_ifunc_invoke, you do

> +  return ((ElfW(Addr) (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap));

but in other places you do e.g.

> +	value = ((ElfW(Addr) (*) (void)) value) ();

and there is no apparent reason for the difference, or any comments 
explaining why it's OK not to pass the argument in some cases - how you 
can know that the resolver functions don't need the argument when called 
in those cases.

> Does the rough ABI I gave above answer your question?

No.  It doesn't seem to say anything about what the type of the resolver 
function is and the significance of its arguments / return value.  
(Regarding the return value, I guess it should also be explicit how 
addresses of MIPS16 / microMIPS functions are returned.)

-- 
Joseph S. Myers
joseph@codesourcery.com

      reply	other threads:[~2013-08-20 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-17  0:31 Jack Carter
2013-08-18 20:39 ` Joseph S. Myers
2013-08-20  0:38   ` Jack Carter
2013-08-20 14:03     ` Joseph S. Myers [this message]

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=Pine.LNX.4.64.1308201344580.15834@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=Jack.Carter@imgtec.com \
    --cc=libc-ports@sourceware.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).