bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/16756] New: Incorrect warning message


From: hjl.tools at gmail dot com
Subject: [Bug ld/16756] New: Incorrect warning message
Date: Tue, 25 Mar 2014 19:27:16 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16756

            Bug ID: 16756
           Summary: Incorrect warning message
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com

This testcase is derived from PR 12760 since we only see the warning
section after the LTO IR symbols have been loaded.  Since we don't
keep the undefined reference when seeing a definition, we lose the
reference info:

address@hidden warn-6]$ cat foo.c
void foo () { }
address@hidden warn-6]$ cat bar.c
static const char _evoke_link_warning_foo[]
  __attribute__ ((used, section (".gnu.warning.foo")))
  = "function foo is deprecated";
address@hidden warn-6]$ cat main.c 
extern void foo ();
int
main ()
{
  foo ();
  return 0;
}
address@hidden warn-6]$ make
gcc  -B./ -O2 -g   -c -o main.o main.c
gcc  -B./ -O2 -g   -c -o foo.o foo.c
gcc  -B./ -O2 -g   -c -o bar.o bar.c
gcc  -B./ -nostdlib -Wl,-e,main -o x main.o foo.o bar.o
foo.o: warning: function foo is deprecated
^^^ It should be main.c, not foo.o.

address@hidden warn-6]$ gcc  -B./ -nostdlib -Wl,-e,main -o x main.o bar.o foo.o
main.o: In function `main':
/export/home/hjl/bugs/binutils/warn-6/main.c:5: warning: function foo is
deprecated
address@hidden warn-6]$

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