git: libc: fix environ symbol by syncing getenv.c with FreeBSD

John Marino marino at crater.dragonflybsd.org
Wed Sep 9 03:51:04 PDT 2015


commit a0ba0189b9089fb6630d9e0244b373af683cbe9c
Author: John Marino <draco at marino.st>
Date:   Wed Sep 9 12:49:38 2015 +0200

    libc: fix environ symbol by syncing getenv.c with FreeBSD
    
    The environ symbol can't be found by rtld with libc symbol versioning.
    On Release 4.2, readelf produces this output, indicating "environ" is
    classified as an object:
    
    > readelf -a /lib/libc.so.8 | grep environ
    00000032af20  01ed00000006 R_X86_64_GLOB_DAT 0000000000351380 environ + 0
       493: 0000000000351380     8 OBJECT  GLOBAL DEFAULT   24 environ
      1636: 0000000000351380     8 OBJECT  GLOBAL DEFAULT   24 environ
    
    After this commit:
    
    > readelf -a /lib/libc.so.8 | grep environ
    000000330c78  000700000006 R_X86_64_GLOB_DAT 0000000000000000 environ + 0
         7: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND environ
      1660: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND environ
    
    The above is the desired output.

Summary of changes:
 lib/libc/stdlib/getenv.3 | 26 +++++++++++++-------------
 lib/libc/stdlib/getenv.c | 36 +++++++++++++++++++++---------------
 2 files changed, 34 insertions(+), 28 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a0ba0189b9089fb6630d9e0244b373af683cbe9c


-- 
DragonFly BSD source repository



More information about the Commits mailing list