This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Adding a new function to memcpy.c
- From: "Ryan Arnold" <ryan dot arnold at gmail dot com>
- To: "Rodrigo Dominguez" <roddomi at hotmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Thu, 7 Aug 2008 15:05:12 -0500
- Subject: Re: Adding a new function to memcpy.c
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=IgZo6jZcZtg9/WgcsgQK3Ir+tSsIBLQ8Ntm+5133NYQ=; b=VHDlXASf/nzWkT533M6z0HXb9VR2UDoILMKggIBTx1YS+LFvwACE7Rd4s4vgDEgn9N gnsHEIxQtqlNt23/IP2Go6KmHn1jTRk3tTAcYfFMUep+8bqGjs/05VIvvmShg4ndu3l0 bzq70Zd0aq5z8h/DbImWkKonbVxQSbdrlTKRg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=BdRay0gRQuOfxxkFk+v8jGzYr4YVVo/urxNknhqPoXSuXRt7EJ8gL2pqiTy/UkeodE gjxpGhDJD6KS/zNSGJoUMsPE8IKofRTEEilJ0CD3whRPnBF4kHnHtRKB5IgEfBpzXK8z a7okbtM36RPNM61FTti57sTatUMn4cLYItJ3Q=
- References: <BAY109-F356BFA6DE1928B9E068FEEB9750@phx.gbl>
On Thu, Aug 7, 2008 at 2:40 PM, Rodrigo Dominguez <roddomi@hotmail.com> wrote:
> Hi,
>
> I am trying to create a new library function which I want to call memcpy_TC.
> I want memcpy_TC to be an exact clone of memcpy. I made the corresponding
> modifications to string/memcpy.c, string/string.h and include/string.h to
> include my new function. I also removed sysdeps/.../memcpy.S. However, after
> I build, memcpy_TC is defined as a local symbol in libc.so:
>
> $nm ../glibc-obj/libc.so | grep memcpy
> 0006ebc0 t __GI_memcpy
> 0006ec10 t __GI_memcpy_TC
> 0006ebc0 T memcpy
> 0006ec10 t memcpy_TC
>
> I tracked back the build process and I found that libc.so is built from
> libc_pic.os. What I find very strange is that memcpy_TC is defined as a
> global symbol in libc_pic.os. How can it change from global to local during
> the linking of libc.so? Am I missing something here?
You need to export it in the string/Versions file.
Ryan