http://sourceware.org/bugzilla/show_bug.cgi?id=12975

           Summary: --gc-sections doesn't remove symbols hidden with
                    version scripts
           Product: binutils
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: mh-sourcew...@glandium.org


(This applies to both ld and gold)

Take the following source code as test.c:
-----8<-----
int foo() { return 42; }

int bar() { return 0; }

#pragma GCC visibility push(hidden)
int baz() { return 1; }
#pragma GCC visibility pop
----->8-----

Take the following version script as ver:
-----8<-----
{
global:
  foo;
local:
  *;
};
----->8-----

Build with:
gcc -o test.so -shared test.c -Wl,--gc-sections -ffunction-sections
-Wl,--version-script,ver

The baz function, hidden with visibility, is removed from the resulting
test.so, but not bar, as one could expect, since it's effectively hidden
through the version script.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to