bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/14885] New: Options --warn-unresolved-symbols/--unresolved-symbo


From: d.g.gorbachev at gmail dot com
Subject: [Bug ld/14885] New: Options --warn-unresolved-symbols/--unresolved-symbols=ignore-all do not affect hidden/internal/protected symbols
Date: Wed, 28 Nov 2012 00:10:56 +0000

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

             Bug #: 14885
           Summary: Options
                    --warn-unresolved-symbols/--unresolved-symbols=ignore-
                    all do not affect hidden/internal/protected symbols
           Product: binutils
           Version: 2.24 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


$ cat > 1.c
extern void foo(void) __attribute__((visibility("hidden")));
extern void bar(void);

int main(void)
{
  foo();
  bar();
  return 0;
}
^D
$ gcc -flto -Wl,--warn-unresolved-symbols 1.c
/tmp/cc6wTQ0k.ltrans0.ltrans.o: In function `main':
cc6wTQ0k.ltrans0.o:(.text+0x7): undefined reference to `foo'
cc6wTQ0k.ltrans0.o:(.text+0xc): warning: undefined reference to `bar'
collect2: error: ld returned 1 exit status
$ gcc -Wl,--warn-unresolved-symbols 1.c
/tmp/cccRrmca.o: In function `main':
1.c:(.text+0x7): undefined reference to `foo'
1.c:(.text+0xc): warning: undefined reference to `bar'
/usr/local/bin/ld: a.out: hidden symbol `foo' isn't defined
/usr/local/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Gold seemed to work:

$ gcc -flto -Wl,--warn-unresolved-symbols 1.c
/tmp/ccMFuDUR.ltrans0.ltrans.o:ccMFuDUR.ltrans0.o:function main: warning:
undefined reference to 'foo'
/tmp/ccMFuDUR.ltrans0.ltrans.o:ccMFuDUR.ltrans0.o:function main: warning:
undefined reference to 'bar'
$ gcc -Wl,--warn-unresolved-symbols 1.c
/tmp/cckgy5o7.o:1.c:function main: warning: undefined reference to 'foo'
/tmp/cckgy5o7.o:1.c:function main: warning: undefined reference to 'bar'

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