This is the mail archive of the 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]

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


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 <>

	* 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.

Carlos O'Donell
Mentor Graphics / CodeSourcery
+1 (613) 963 1026

Attachment: fdesc-2011-05-31.diff
Description: Text document

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