[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 |
http://sourceware.org/bugzilla/show_bug.cgi?id=12761
Summary: .gnu.warning.* doesn't work when building shared
library
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 ();
void
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.
- [Bug ld/12761] New: .gnu.warning.* doesn't work when building shared library,
hjl.tools at gmail dot com <=
- [Bug ld/12761] .gnu.warning.* doesn't work when building shared library, nickc at redhat dot com, 2011/05/18
- [Bug ld/12761] .gnu.warning.* doesn't work when building shared library, nickc at redhat dot com, 2011/05/18
- [Bug ld/12761] .gnu.warning.* doesn't work when building shared library, hjl.tools at gmail dot com, 2011/05/18
- [Bug ld/12761] .gnu.warning.* doesn't work when building shared library, cvs-commit at gcc dot gnu.org, 2011/05/18
- [Bug ld/12761] .gnu.warning.* doesn't work when building shared library, nickc at redhat dot com, 2011/05/18