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

            Bug ID: 20507
           Summary: version-script refuses to hide symbols called
                    malloc/calloc
           Product: binutils
           Version: 2.24
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: primiano at google dot com
                CC: ian at airs dot com
  Target Milestone: ---

The behavior of gold seems to diverge from the bfd linker when trying to hide
malloc/calloc symbols using a version script.

Minified repro:

$ cat<<EOF > test.cc
extern "C" void* malloc(unsigned long size) { return 0; }
extern "C" void* calloc(unsigned long size) { return 0; }
extern "C" void* foobar(unsigned long size) { return 0; }
int main() { return 0; }
EOF

$ cat<<EOF > test.lst
{ local: *; };
EOF

$ g++ -fuse-ld=gold -o out.gold test.cc -Wl,--version-script=test.lst
$ g++ -fuse-ld=bfd -o out.bfd test.cc -Wl,--version-script=test.lst

$ nm -C -D --defined-only out.bfd
$ nm -C -D --defined-only out.gold
00000000004005dc T calloc
00000000004005cd T malloc

I'd expect out.gold to not leak out the malloc/calloc symbols.

-- 
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