public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* MIPS PCREL support without $gp dependency
@ 2024-01-20  7:18 YunQiang Su
  0 siblings, 0 replies; only message in thread
From: YunQiang Su @ 2024-01-20  7:18 UTC (permalink / raw)
  To: Libc-alpha

I am working on PCREL support for MIPS recently, and the GCC support
has almost finished.

For the new PCREL, I wish that we can drop the $gp dependency.
On the glibc side, in _dl_runtime_resolve , $gp is assumed to have the value of
GOT of our caller.

To be compatible with the current executable and the future executable, we
need to have a way to determine how to get the GOT value.

I have a proposal about it:
1. Use jalr $t6 to call _dl_runtime_resolve, instead of jalr $t6
     and pass the address of GOT with $t9.
2. if  $t6 == ADDR (_dl_runtime_resolve) then
        GOT = $t9
3. else
        GOT = $gp

This way, the old/new executables can work with new _dl_runtime_resolve,
and both old and new executables can work with old _dl_runtime_resolve.

Any better ideas?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-20  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20  7:18 MIPS PCREL support without $gp dependency YunQiang Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).