This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[MIPS] ld.so accepting both REL and RELA relocations
- From: Jack Carter <Jack dot Carter at imgtec dot com>
- To: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: Rich Fuhler <Rich dot Fuhler at imgtec dot com>, "rdsandiford at googlemail dot com" <rdsandiford at googlemail dot com>
- Date: Tue, 11 Mar 2014 23:57:51 +0000
- Subject: [MIPS] ld.so accepting both REL and RELA relocations
- Authentication-results: sourceware.org; auth=none
We're doing some work that needs run-time relocation of a currently loaded dso.
This requires RELA since the original addend of a REL will be lost.
We need this functionality for 32-bit O32, as well as N32/N64.
I have done some preliminary work in both the linker to produce
RELA and then ld.so to receive RELA relocations. I have 3 questions:
1) Can ld.so be easily set to accept both REL and RELA? If so, is there
an existing example?
2) Is there specific changes needed to get static executables to accept RELA
relocations? In particular, I have R_MIPS_IRELATIVE relocations that are
used to update a table of IFUNC functions. I understand that this is not
ld.so exactly, but I thought it used the same code such as dl_machine.h.
I had it working for REL and with RELA it just seems to ignore the relocations.
3) Why doesn't the dynamic linker just handle both RELA and REL by their dynamic
section tags? Why do we have to rely on defines in the dynamic linker code?
Thanks,
Jack