> Date: Fri, 23 Dec 2016 18:13:45 +0100
> From: Joerg Sonnenberger <jo...@bec.de>
> 
> On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote:
> > I'm assuming clang handles asm names like gcc, such that declaring
> >    void  *memcpy(void *__restrict, const void *__restrict, __size_t)
> > __dso_hidden __asm("_dl_memcpy");
> > 
> > will make even internally generated calls go to _dl_memcpy instead.
> 
> No. The backend normally has no idea about assembler names. What problem
> are you trying to solve, really?

Right.  The solution gere is probably to rename _dl_memcpy back to
memcpy.  One of the reasons why _dl_memcpy exists is that we wanted to
prevent exporting ld.so's memcpy implementation such that nothing else
would accidentally pick it up.  But now that we explicitly control
which symbols we export from ld.so, that risk doesn't exist anymore.

The downside that we will have functions named memcpy in a dynamic
executable still makes debugging a little bit harder, but I'll get
over it.

We probably should not rename all _dl_-prefixed versions of standard C
functions just yet.  Especially those that don't fully implement the
standard C functionality.

Cheers,

Mark

Reply via email to