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

            Bug ID: 23644
           Summary: Gold emits relocations for hidden symbols
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: mh-sourceware at glandium dot org
                CC: ian at airs dot com
  Target Milestone: ---

$ cat test.c
__attribute__((weak, visibility("hidden"))) extern void foo();

int main() {
  if (foo)
    foo();
  return 0;
}
$ gcc -o test test.c -pie -O3 -fuse-ld=gold
$ objdump -t test | grep foo
0000000000000000  w      *UND*  0000000000000000              .hidden foo
$ readelf -r test | grep foo
000000001fe0  000200000006 R_X86_64_GLOB_DAT 0000000000000000 foo + 0
000000002008  000200000007 R_X86_64_JUMP_SLO 0000000000000000 foo + 0


Compare with BFD ld:
$ gcc -o test test.c -pie -O3
$ objdump -t test | grep foo
$ readelf -r test | grep foo

This causes subtle problems, such as
https://bugzilla.mozilla.org/show_bug.cgi?id=1490845#c3

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