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: Alexander Monakov <amonakov at ispras dot ru>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Zack Weinberg <zackw at panix dot com>, Florian Weimer <fw at deneb dot enyo dot de>, nd at arm dot com, "H.J. Lu" <hjl dot tools at gmail dot com>, "Kreitzer, David L" <david dot l dot kreitzer at intel dot com>, Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jeff Law <law at redhat dot com>, "Maslov, Sergey V" <sergey dot v dot maslov at intel dot com>
- Date: Mon, 27 Mar 2017 14:12:40 +0300 (MSK)
- 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> <a6e085c3-884d-3156-9b43-35094dfbc042@redhat.com> <100440FED7798443A51E0730E25E29E85AAD9939@fmsmsx117.amr.corp.intel.com> <CAMe9rOrfoekW=gu8_sWTiTECedJCVs1xZ7byZFT15a_Kxk6LAw@mail.gmail.com> <87shm3f2bj.fsf@mid.deneb.enyo.de> <CAMe9rOpve0gyP6a-3zjzTJFpzxG-qVW0ycrCLzEYyC56U3LfbA@mail.gmail.com> <871stmaalw.fsf@mid.deneb.enyo.de> <CAKCAbMg2a6u_14VijWH+Jycnr4NHZkNMq0Y9EGT39ko0qjmsaQ@mail.gmail.com> <87r31m8uyk.fsf@mid.deneb.enyo.de> <CAKCAbMj1m+d+QdOD8nGewcEe=-1RFjCz=nJS0tdD_hva5995FA@mail.gmail.com> <58D8EC19.6030505@arm.com>
On Mon, 27 Mar 2017, Szabolcs Nagy wrote:
> even if the dynamic linker was careful not to
> clobber certain registers in memcpy/strcmp/..,
> ifunc resolvers follow the normal pcs, so they
> are allowed to clobber them anyway.
>
> so in general 'the dynamic linker is careful'
> argument does not work in the presence of
> user defined ifunc.
As said in an adjacent subthread, the dynamic linker knows exactly when it is
about to call back to external code (ifunc resolver, LD_AUDIT handlers), and
it can save/restore additional registers just around those points.
I believe a bigger issue is usage of [optimized] string functions in the linker.
Alexander