This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Avoid relocation in fptr code used by rtld.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Sun, 26 Jun 2011 13:11:52 -0400
- Subject: Re: [PATCH] Avoid relocation in fptr code used by rtld.
- References: <4DE53C5B.firstname.lastname@example.org>
On Tue, May 31, 2011 at 3:07 PM, Carlos O'Donell
> 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
> 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 ?<email@example.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.