[RFC 2.0] Implementing hwcap2
Mike Frysinger
vapier@gentoo.org
Thu Mar 28 23:58:00 GMT 2013
On Thursday 28 March 2013 19:40:33 Roland McGrath wrote:
> > how ? resolve_* are not exported symbols, and they're not in the header
> > files.
>
> Those are just the users of the changed ABI. The ABI in question is the
> convention by which the dynamic linker calls IFUNC resolver entry points.
> Richard quoted the an example of the affected callees because Ryan's change
> didn't change the callers, which are elf_ifunc_invoke in dl-irel.h. Those
> that pass GLRO(dl_hwcap) (arm, powerpc, s390, sparc) do so using a cast to
> a hand-written function pointer type, which takes 'unsigned long int' for
> arm, powerpc, and s390, and 'int' for sparc. Though GLRO(dl_hwcap) already
> has type uint64_t, the prototypes in those casts (for sparc, arm,
> powerpc32, and s390-32) will truncate the value being passed. So in fact,
> Ryan hasn't changed the ABI, but he intends to and needs to for the purpose
> of his change to take effect.
makes sense, thanks. does this mean the only way to change that ABI is to
introduce a new reloc type (or subtly alter the existing one) ?
for most arches, we could probably split the values and pass as two args and
things would continue to work since either they're passed by the stack (and
the caller takes care of managing that), or they're in pre-reserved arg
registers. i don't know enough about the existing ABIs (x86, sparc, ppc,
s390, arm, plus the 64bit variants of each) to say if this would fly.
> IMHO the change to the dl-irel.h files should also include adding a typedef
> for the function type of IFUNC selectors, so those elf_ifunc_invoke
> implementations read:
> return (*(ifunc_selector_t *) addr) (GLRO(dl_hwcap));
> Then every selector's definition should be preceded by a forward
> declaration using ifunc_selector_t (perhaps not the ideal name)
> so that prototype mismatches will be caught.
this sounds like a good idea too.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130328/b1bef2d6/attachment.sig>
More information about the Libc-alpha
mailing list