[CRIU] Re: [PATCH 5/8] util: Add strlcpy helper

Cyrill Gorcunov gorcunov at openvz.org
Thu May 10 06:39:34 EDT 2012


On Thu, May 10, 2012 at 02:15:14PM +0400, Pavel Emelyanov wrote:
> On 05/05/2012 07:20 PM, Cyrill Gorcunov wrote:
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  include/compiler.h |    1 +
> >  include/util.h     |    2 ++
> >  util.c             |   13 +++++++++++++
> >  3 files changed, 16 insertions(+), 0 deletions(-)
> > 
> 
> AFAIK most of the glibc's functions are weak. Is glibc's strlcpy weak?
> What happens if linker links two weak functions?

There is no strlcpy in glibc I'm using (2.14.90). As to weak symbols
per se -- if non-weak symbol found then it become implementation, but
if say you have two object files with __weak definition, the function
which will be used is ordered by object files linking.

Ie if src1.c has __weak func (1) and src2.c has __weak func (2),
then if linked as src1.o src2.o -- the (1) will be used, and
reverse.

	Cyrill


More information about the CRIU mailing list