public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: Making a syscall before ld.so self-relocation on MIPS
Date: Wed, 17 May 2023 21:30:24 +0200	[thread overview]
Message-ID: <87jzx6hi27.fsf@oldenburg3.str.redhat.com> (raw)
In-Reply-To: <e2de7e84-9a3a-bc9c-2a19-7d1554870f0@codesourcery.com> (Joseph Myers's message of "Wed, 17 May 2023 19:01:26 +0000")

* Joseph Myers:

> On Wed, 17 May 2023, Florian Weimer via Libc-alpha wrote:
>
>> 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.
>
> No, it's not the default; you need to use the -mips16 option.

And apparently this is expected to work for building glibc?  We have
some support code for it.

I guess I could override that for elf/rtld.c with -mno-mips16.  Would it
be okay to do that, and rely on GCC generating a direct bal instruction
for invoking the system call helper?

Thanks,
Florian


  reply	other threads:[~2023-05-17 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17  9:29 Florian Weimer
2023-05-17 19:01 ` Joseph Myers
2023-05-17 19:30   ` Florian Weimer [this message]
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=87jzx6hi27.fsf@oldenburg3.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=joseph@codesourcery.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).