RFC: Should x86-64 support arbitrary calling conventions?
Florian Weimer
fw@deneb.enyo.de
Sun Mar 19 21:23:00 GMT 2017
* 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).
More information about the Libc-alpha
mailing list