This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid relocation in fptr code used by rtld.


On Tue, May 31, 2011 at 3:07 PM, Carlos O'Donell
<carlos@codesourcery.com> wrote:
> The fptr code as written causes a relocation against the rtld's text section
> to fixup the value written into local.root (elf/dl-fptr.c).
>
> This causes rtld to crash on hppa-linux-gnu when trying to access local.root
> during relocation processing.
>
> There should be no relocations in any of the code used before rtld
> relocates. The easiest way to solve this is to initialize local.root at
> runtime.
>
> This patch moves the initialization of local.root into _dl_fptr_init, but
> only in the shared case since the non-shared case has no such problem.
>
> Tested on i686-pc-linux-gnu with no regressions.
>
> Tested on hppa-linux-gnu with no regressions, and it fixes the rtld crash.
>
> Fixed up ia64 code to match, but did not test.
>
> Please apply.
>
> 2011-05-31 ?Carlos O'Donell ?<carlos@codesourcery.com>
>
> ? ? ? ?* elf/dl-fptr.c: Update copyright year.
> ? ? ? ?(struct local) [SHARED]: Set root to zero.
> ? ? ? ?(_dl_fptr_init): New function.
> ? ? ? ?* sysdeps/generic/dl-fptr.h: Update copyright year.
> ? ? ? ?(_dl_fptr_init): New prototype.
> ? ? ? ?* sysdeps/ia64/dl-machine.h: Update copyright year.
> ? ? ? ?(ELF_MACHINE_BEFORE_RTLD_RELOC): Call _dl_fptr_init.

Ping?

Any comments?

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]