Re: [PATCH] Rename progname as it is provided by libc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 03, 2017 at 08:20:03AM +1000, Dave Chinner wrote:
> On Sat, Sep 02, 2017 at 02:54:51PM -0700, Khem Raj wrote:
> > Rename local variable progname to avoid a clash with libc
> > global symbols
> 
> What libc is causing this problem?
> 
> And why is it considered ok for that libc to pollute the global
> variable namespace with it's own internal variables?

A closer look reveals that its getting the function from another local library which is used
on the linker commandline. below is full cmdline

../arm-bec-linux-musleabi-libtool --quiet --tag=CC --mode=link ../../recipe-sysroot-native/usr/bin/arm-bec-linux-musleabi/arm-bec-linux-musleabi-clang -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -mlittle-endian -D__extern_always_inline=inline -no-integrated-as -Wno-error=unused-command-line-argument -Qunused-arguments -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/xfsprogs/4.12.0-r0/recipe-sysroot -o xfs_io -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -static-libtool-libs  init.o attr.o bmap.o cowextsize.o encrypt.o file.o freeze.o fsync.o getrusage.o imap.o link.o mmap.o open.o parent.o pread.o prealloc.o pwrite.o reflink.o seek.o shutdown.o stat.o sync.o truncate.o utimes.o fadvise.o madvise.o mincore.o sendfile.o fiemap.o inject.o resblks.o copy_file_range.o sync_file_range.o readdir.o fsmap.o   ../libxcmd/libxcmd.la ../libhandle/libhandle.la -luuid -lpthread -lreadline


libxfs.so.0                   init.o (progname)

and also from init.o object from current directory

$ readelf -sW init.o | grep progname                                                                                                                                                                                            (09-03 00:17)
    56: 00000004     4 OBJECT  GLOBAL DEFAULT  COM progname

readelf -sW ../libxfs/.libs/libxfs.so.0 | grep progname                                                                                                                                                                       (09-03 00:19)
   214: 0005d004     4 OBJECT  GLOBAL DEFAULT   18 progname

Thats what is causing the conflict.

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux