This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: Should x86-64 support arbitrary calling conventions?
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: "Kreitzer\, David L" <david dot l dot kreitzer at intel dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>, "Maslov\, Sergey V" <sergey dot v dot maslov at intel dot com>
- Date: Sun, 19 Mar 2017 22:23:34 +0100
- Subject: Re: RFC: Should x86-64 support arbitrary calling conventions?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOoLSU=zfhdS1DqKQVr-5Hr9jqBjoR_CMUyFHQ8JKJfwZw@mail.gmail.com> <20170316232737.GD24205@vapier> <CAMe9rOrx5Kzwniv+UqQ+xi2FpDBf8sFeogimwcS6YUHuT2pk+Q@mail.gmail.com> <100440FED7798443A51E0730E25E29E85AAC14B5@fmsmsx117.amr.corp.intel.com>
* David L. Kreitzer:
> Ideally, _dl_runtime_resolve should preserve any registers that it uses,
> similar to an interrupt handler.
That's not really feasible due to the way ELF lazy binding works.
> Otherwise, we leave significant performance potential on the table
> in situations where the "one size fits all" calling convention is
> inefficient.
You could just have the __regcall convention imply the noplt
attribute. Then things would just work even today.
Please document in the ABI that noplt calls preserve all registers,
but still need a valid stack. They clobber both the red zone and the
unused portion of the stack. The latter leaves open the option to
eventually add audit support for noplt calls (via dynamic stub
generation).