bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/25458] --gc-sections removes _environ symbol since version 2.21


From: hjl.tools at gmail dot com
Subject: [Bug ld/25458] --gc-sections removes _environ symbol since version 2.21
Date: Fri, 24 Jan 2020 20:30:32 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25458

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 12229
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12229&action=edit
A testcase

[hjl@gnu-cfl-1 pr25458]$ make
cc    -c -o start.o start.c
cc  -c -o foo.o foo.S
ld -shared  -o libfoo.so foo.o --version-script foo.t
ld  -o x start.o libfoo.so
ld --gc-sections  -o y start.o libfoo.so
readelf -sW x | grep environ
     1: 0000000000403ef0     0 OBJECT  WEAK   DEFAULT   11 environ@FOO (2)
     2: 0000000000403ef0     0 OBJECT  WEAK   DEFAULT   11 _environ@FOO (2)
     3: 0000000000403ef0     0 OBJECT  GLOBAL DEFAULT   11 __environ@FOO (2)
    16: 0000000000403ef0     0 OBJECT  GLOBAL DEFAULT   11 __environ@@FOO
    17: 0000000000403ef0     0 OBJECT  WEAK   DEFAULT   11 environ@@FOO
readelf -sW y | grep environ
     1: 0000000000403ef0     0 OBJECT  GLOBAL DEFAULT   11 __environ@FOO (2)
     2: 0000000000403ef0     0 OBJECT  WEAK   DEFAULT   11 environ@FOO (2)
    16: 0000000000403ef0     0 OBJECT  GLOBAL DEFAULT   11 __environ@@FOO
    17: 0000000000403ef0     0 OBJECT  WEAK   DEFAULT   11 environ@@FOO
[hjl@gnu-cfl-1 pr25458]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]