Bug in shared libraries

Alan Modra alan@linuxcare.com.au
Tue, 24 Oct 2000 17:19:17 +1100 (EST)


On Tue, 24 Oct 2000, Alan Modra wrote:

> The problem occurs when ld.so is relocating itself, ie. during
> ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0).  I looked at fixing the
> dynamic linker, but it's a complete pain to do as a lot of things aren't
> set up at bootstrap stage.  _Much_ easier to fix the compiler as per the
> following diff.  I've tested this on hppa-linux, and a newly built glibc
> has no .rela.rodata in ld.so or libc.so.

Um, that's only half the problem solved.  The other difficulty is with the
.PARISC.unwind section which happens to be read-only and full of DIR32
relocs for hppa-linux.  hppa64-linux uses SEGREL relocs, which don't need
to be copied to shared libs since as their name implies, they are
relative.

I'm inclined to change the 32-bit ELF unwind section over to using SEGREL
relocs too.  Since gdb support isn't finished yet, we won't be breaking
anything.  Comments?

Alan Modra
-- 
Linuxcare.  Support for the Revolution.