This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/20274] New: -fvisibility=hidden has no effect on calling undefined function


bash-3.00$ cat x.c
#if 1
extern void foo ();
#else
extern void foo () __attribute__((visibility ("hidden")));
#endif

void
bar ()
{
  foo ();
}
bash-3.00$ ./xgcc -B./ -fPIC -O2 x.c -S -fvisibility=hidden
bash-3.00$ more x.s
        .file   "x.c"
        .text
        .p2align 4,,15
.globl bar
        .hidden bar
        .type   bar, @function
bar:
.LFB2:
        xorl    %eax, %eax
        jmp     foo@PLT
.LFE2:
        .size   bar, .-bar

foo is defined in a different file. Why doesn't gcc use "jmp foo" instead of
"jmp foo@PLT"? Use

extern void foo () __attribute__((visibility ("hidden")));

works.

-- 
           Summary: -fvisibility=hidden has no effect on calling undefined
                    function
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20274


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]