This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [RFC] Fix LD_PROFILE for ia64 and hppa (any arch using function descriptors)
On Tue, Jan 06, 2004 at 01:57:49AM -0800, Roland McGrath wrote:
> I see what you mean. I think your approach is reasonable, though your code
> needs some cleanup. Is your patch sufficient to make LD_BIND_NOT work?
> It seems to me that we need something like ELF_MACHINE_FIXUP_RETURN_VALUE:
It is not sufficient to make LD_BIND_NOT work, but it could do so with
slight modifications. I had endeavoured to keep it simple. My previous
patch has a bug.
> if (__builtin_expect (GL(dl_bind_not), 0))
> {
> #ifdef ELF_MACHINE_FIXUP_RETURN_VALUE
> return ELF_MACHINE_FIXUP_RETURN_VALUE (l, result,
> reloc, rel_addr, value);
> #else
> return value;
> #endif
> }
>
> return elf_machine_fixup_plt (l, result, reloc, rel_addr, value);
>
> Or else have elf_machine_fixup_plt check dl_bind_not, which would require
> changing every dl-machine.h file.
I assume you want to say "(GL(dl_bind_not), 1))"? Going with that, yes,
we do need something like ELF_MACHINE_FIXUP_RETURN_VALUE for
architectures that return more than just "value" for their trampoline to
work. However, in the non-profiling case ia64 and hppa need to store two
Elf32_Addr's for long enough that the trampoline can use the value,
where do I get the space for this? I imagine that
ELF_MACHINE_FIXUP_RETURN_VAULE could point to a function that creates a
temporary function descriptor, the generic function descriptor code
handles checking for unique descriptors and allocating only once (boy
would it be slow). In that case it would fix LD_BIND_NOT for ia64 and
hppa aswell.
c.