This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] BZ #14831: Segfault in _dl_profile_fixup with IRELATIVEand LD_AUDIT
On Tue, Nov 13, 2012 at 4:26 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> + if (l->l_reloc_result == NULL)
>> + {
>> + /* Skip audit if l_reloc_result is NULL which happens with
>> + IRELATIVE relocations in other DSOs, like libm.so. */
>> + *framesizep = -1;
>
> This needs a more extensive comment about how it arises that we get here
> with l_reloc_result NULL and why it is OK to short-circuit this way.
R_X86_IRELATIVE lazy relocation in libm.so leads to:
00042010 00000507 R_386_JUMP_SLOT 00000000 __get_cpu_features
But __get_cpu_features isn't set up yet and requires a lazy relocation.
That is why l_reloc_result is NULL. We don't want audit in R_X86_IRELATIVE
relocations. What is what my patch does.
>> + return _dl_fixup (l, reloc_arg);
>
> How can this be right when ELF_MACHINE_RUNTIME_FIXUP_ARGS is nonempty?
>
My post has
---
Targets which define ELF_MACHINE_RUNTIME_FIXUP_ARGS must find a way
to pass ELF_MACHINE_RUNTIME_FIXUP_ARGS from _dl_fixup/_dl_profile_fixup
to _dl_runtime_fixup.
---
Only
ports/sysdeps/m68k/dl-machine.h:#define ELF_MACHINE_RUNTIME_FIXUP_ARGS
long int save_a0, long int save_a1
sysdeps/sh/dl-machine.h:#define ELF_MACHINE_RUNTIME_FIXUP_ARGS int plt_type
I can work with sh and m68k maintainers on a solution. It shouldn't be
too hard.
--
H.J.