bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/13600] New: protected visibility creates bogus relocation


From: rguenth at gcc dot gnu.org
Subject: [Bug ld/13600] New: protected visibility creates bogus relocation
Date: Tue, 17 Jan 2012 12:32:11 +0000

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

             Bug #: 13600
           Summary: protected visibility creates bogus relocation
           Product: binutils
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


.file   "t1.c"
        .text
        .globl  foo
        .protected      foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        leaq    foo(%rip), %rax
        popq    %rbp
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 4.7.0 20120116 (experimental)"
        .section        .note.GNU-stack,"",@progbits

does not link:

/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:
/tmp/cc43SbHJ.o: relocation R_X86_64_PC32 against protected symbol `foo' can
not be used when making a shared object
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status


C testcase:

__attribute__((visibility("protected"))) void * foo (void) { return (void
*)foo; }

gcc t1.c -o libt1.so -shared -fPIC.

Sounds similar to PR584, but this time with a self-reference.

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



reply via email to

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