libc: Complete conversion to _getprogname from __progname
authorJohn Marino <draco@marino.st>
Wed, 9 Sep 2015 09:54:17 +0000 (11:54 +0200)
committerJohn Marino <draco@marino.st>
Wed, 9 Sep 2015 09:55:31 +0000 (11:55 +0200)
commit482bded760722f83973b9509cb8b04d594a81ec7
tree9d65ef09f4a78f736e210c0e7fa7779023555a3c
parent1a3f33f1f01a6bd58a18d49ce378cf1e03d9e5a4
libc: Complete conversion to _getprogname from __progname

The initial work to eliminate direct use of __progname was done years ago,
but two items were missed: an extern keyword and libc_r conversion.  As a
result, the symbol was classified as an object.  Before commit (R4.2):

> readelf -a /lib/libc.so.8 | grep __progname
00000032ac80  077600000006 R_X86_64_GLOB_DAT 00000000003506d0 __progname+0
  1910: 00000000003506d0     8 OBJECT  GLOBAL DEFAULT   24 __progname
   537: 00000000003506d0     8 OBJECT  GLOBAL DEFAULT   24 __progname

After commit:

>  readelf -a /lib/libc.so.8 | grep __progname
0000003309c0  000400000006 R_X86_64_GLOB_DAT 0000000000000000 __progname+0
     4: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND __progname
   545: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND __progname

The issue was reveal with libc symbol version testing, which also revealed
the "environ" symbol has a similar issue.  The change matches how the
FreeBSD analog works.
lib/libc/include/libc_private.h
lib/libc_r/uthread/uthread_spinlock.c