[Top][All Lists]

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

[Bug ld/12761] New: .gnu.warning.* doesn't work when building shared lib

From: hjl.tools at gmail dot com
Subject: [Bug ld/12761] New: .gnu.warning.* doesn't work when building shared library
Date: Sat, 14 May 2011 16:59:00 +0000


           Summary: .gnu.warning.* doesn't work when building shared
           Product: binutils
           Version: 2.22 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden

address@hidden warn-5]$ cat foo.c
extern void bar ();

foo ()
  bar ();
address@hidden warn-5]$ cat bar.c
#define linker_warning(x, msg) \
    static const char __warn_##x[] \
    __attribute__((used, section(".gnu.warning." #x))) \
    = msg

void bar (void) {} 
linker_warning(bar, "Bad bar"); 
address@hidden warn-5]$ make
/usr/gcc-4.6/bin/gcc  -O2 -fPIC   -c -o foo.o foo.c
/usr/gcc-4.6/bin/gcc  -O2 -fPIC   -c -o bar.o bar.c
/usr/gcc-4.6/bin/gcc  -Wl,-e,foo -nostdlib -o x1 foo.o bar.o
foo.o: In function `foo':
foo.c:(.text+0x3): warning: Bad bar
/usr/gcc-4.6/bin/gcc  -shared -nostdlib -o x2 foo.o bar.o
address@hidden warn-5]$ ./ld.gold -shared -o x2 foo.o bar.o
foo.o:foo.c:function foo: warning: Bad bar
address@hidden warn-5]$

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]