From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: Making a syscall before ld.so self-relocation on MIPS
Date: Wed, 17 May 2023 11:29:18 +0200 [thread overview]
Message-ID: <87wn17jogh.fsf@oldenburg3.str.redhat.com> (raw)
I'm reviewing HIDDEN_VAR_NEEDS_DYNAMIC_RELOC if they support inline
system calls (without function calls), so that I can make a system call
(mmap actually) before initial self-relocation of the dynamic loader.
So far, it looks good in theory, except on MIPS. First there is MIPS16:
/* There's no MIPS16 syscall instruction, so we go through out-of-line
standard MIPS wrappers. These do use inline snippets below though,
through INTERNAL_SYSCALL_MIPS16. Spilling the syscall number to
memory gives the best code in that case, avoiding the need to save
and restore a static register. */
Is MIPS16 the default in GCC? We don't build for explicitly in
scripts/build-many-glibcs.py.
Without MIPS16, many arguments use out-of-line function calls. But it
seems that the effective relative address range for branches is fairly
large. Maybe we can call a hidden function in ld.so without a
relocation dependency after all?
Thanks,
Florian
next reply other threads:[~2023-05-17 9:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 9:29 Florian Weimer [this message]
2023-05-17 19:01 ` Joseph Myers
2023-05-17 19:30 ` Florian Weimer
2023-05-17 19:41 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wn17jogh.fsf@oldenburg3.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).