public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/45196]  New: ld: warning: can't add line info to anonymous symbol
@ 2010-08-05 13:37 howarth at nitro dot med dot uc dot edu
  2010-08-05 14:23 ` [Bug target/45196] " iains at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-05 13:37 UTC (permalink / raw)
  To: gcc-bugs

The cleanups to i386 prologue/epilogue generation (r162882 -r162891) cause 161
libstdc++ failures at -m32 on *86*-apple-darwin10 due to new warnings of the
form...

Executing on host: /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc/g++
-shared-libgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc
-nostdinc++
-L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/src
-L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/src/.libs
-B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/bin/
-B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/lib/ -isystem
/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/include -isystem
/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/sys-include -m32
-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/src/.libs
-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections
-g -O2 -g -O2 -DLOCALEDIR="." -nostdinc++
-I/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/include/x86_64-apple-darwin10.4.0
-I/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/include
-I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/libsupc++
-I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/include/backward
-I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/testsuite/util
/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc
  -std=gnu++0x ./libtestc++.a   -lm   -m32 -o ./39882.exe    (timeout = 600)
ld: warning: can't add line info to anonymous symbol initializer$0 from
/var/tmp//ccuyXXr3.o^M
output is:
ld: warning: can't add line info to anonymous symbol initializer$0 from
/var/tmp//ccuyXXr3.o^M

FAIL: 19_diagnostics/error_code/cons/39882.cc (test for excess errors)
Excess errors:
ld: warning: can't add line info to anonymous symbol initializer$0 from
/var/tmp//ccuyXXr3.o

This has been filed as radar://8274440, ld: warning: can't add line info to
anonymous symbol",
with two standalone testcases generated before and after the patches.

According the darwin linker developer, the explanation and possible workaround
are as follows...

---------------------------------------------------------
ld: warning: can't add line info to anonymous symbol initializer$0 from      
39882.o
[/tmp/anonymous_symbol_post]> size -l 39882.o
      ...
        Section (__TEXT, __textcoal_nt): 176 (addr 0x6580 offset 27668)
        Section (__DATA, __mod_init_func): 4 (addr 0x6630 offset 27844)
      ...

I suspect what is happening is that the dwarf debug line info has a
pc-range that goes from the last function in the __textcoal_nt section up
to the start of the __mod_init_func section.  When ld is parsing the debug
line info, it sees a pc address that is in the __mod_init_func section and
issues the warning.   The linker should be smarter and realize the pc
address is the *end* address and therefore ok to be also the beginning       
address of another section.

You could work around this by moving  the __textcoal_nt section to be
after the __text section.  That is, put a .section __TEXT,
__textcoal_nt,blah,blah directive at the top of the file before the
.section __DWARF, blah directives.  This would mean any edge cases in the  
end of the __textcoal_nt would be into the __DWARF sections with ld
ignores.
---------------------------------------------------------

    He also mentioned that this bug doesn't appear to exist in the Xcode 4.0
linker
(so it will go away in the future) and that it is in fact a non-fatal warning
(but that
the resulting dwarf line tables might be bad).


-- 
           Summary: ld: warning: can't add line info to anonymous symbol
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: howarth at nitro dot med dot uc dot edu
 GCC build triplet: *86*-apple-darwin10
  GCC host triplet: *86*-apple-darwin10
GCC target triplet: *86*-apple-darwin10


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
@ 2010-08-05 14:23 ` iains at gcc dot gnu dot org
  2010-08-05 17:55 ` howarth at nitro dot med dot uc dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-08-05 14:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from iains at gcc dot gnu dot org  2010-08-05 14:23 -------
does this solve the problem?
 (it's a hack - we should ensure that the debug sections do not appear in
between our program sections, but that's for another day).


Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c (revision 162881)
+++ gcc/config/darwin.c (working copy)
@@ -1699,6 +1699,23 @@ darwin_asm_output_dwarf_delta (FILE *file, int siz
 void
 darwin_file_start (void)
 {
+  fputs ("\t.const\n\t.static_const\n\t.cstring\n", asm_out_file) ;
+  fputs ("\t.literal4\n\t.literal8\n\t.literal16\n", asm_out_file) ;
+  fputs ("\t.data\n\t.static_data\n\t.const_data\n", asm_out_file) ;
+  if (!TARGET_64BIT) 
+    {
+      if (flag_pic == 2)
+       fputs ("\t.picsymbol_stub\n", asm_out_file) ;
+      else
+       fputs ("\t.symbol_stub\n", asm_out_file) ;
+      fputs ("\t.lazy_symbol_pointer\n\t.non_lazy_symbol_pointer\n",
asm_out_file);
+      fputs ("\t.section __TEXT,__textcoal_nt,coalesced,pure_instructions\n",
asm_out_file); 
+    }
+  else
+    {
+      fputs ("\t.section
__TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\n",
asm_out_file) ;
+    }
+  in_section = NULL;
   if (write_symbols == DWARF2_DEBUG)
     {
       static const char * const debugnames[] =


-- 

iains at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
  2010-08-05 14:23 ` [Bug target/45196] " iains at gcc dot gnu dot org
@ 2010-08-05 17:55 ` howarth at nitro dot med dot uc dot edu
  2010-08-15 17:36 ` howarth at nitro dot med dot uc dot edu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-05 17:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from howarth at nitro dot med dot uc dot edu  2010-08-05 17:55 -------
This bug doesn't occur with the actual committed version of the cleanups to
i386 prologue/epilogue generation (as opposed to the proposed patches). Let's
leave this open for now in case it reappears.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
  2010-08-05 14:23 ` [Bug target/45196] " iains at gcc dot gnu dot org
  2010-08-05 17:55 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-15 17:36 ` howarth at nitro dot med dot uc dot edu
  2010-08-15 18:47 ` howarth at nitro dot med dot uc dot edu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-15 17:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from howarth at nitro dot med dot uc dot edu  2010-08-15 17:36 -------
These still appear to be present on i386-apple-darwin10 but not
x86_64-apple-darwin10. Odd.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
                   ` (2 preceding siblings ...)
  2010-08-15 17:36 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-15 18:47 ` howarth at nitro dot med dot uc dot edu
  2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-15 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from howarth at nitro dot med dot uc dot edu  2010-08-15 18:47 -------
Created an attachment (id=21480)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21480&action=view)
compressed preprocessed source for 20_util/auto_ptr/6.cc on
-i386-apple-darwin10


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
                   ` (4 preceding siblings ...)
  2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
  2010-08-15 18:52 ` howarth at nitro dot med dot uc dot edu
  6 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-15 18:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from howarth at nitro dot med dot uc dot edu  2010-08-15 18:48 -------
Created an attachment (id=21481)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21481&action=view)
compressed assembly file for 20_util/auto_ptr/6.cc on -i386-apple-darwin10


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
                   ` (3 preceding siblings ...)
  2010-08-15 18:47 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
  2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
  2010-08-15 18:52 ` howarth at nitro dot med dot uc dot edu
  6 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-15 18:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from howarth at nitro dot med dot uc dot edu  2010-08-15 18:48 -------
Created an attachment (id=21482)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21482&action=view)
compressed object file for 20_util/auto_ptr/6.cc on -i386-apple-darwin10


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
  2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
                   ` (5 preceding siblings ...)
  2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-15 18:52 ` howarth at nitro dot med dot uc dot edu
  6 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-15 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from howarth at nitro dot med dot uc dot edu  2010-08-15 18:52 -------
Files created with...

/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc/g++ -shared-libgcc
-B/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc -nostdinc++
-L/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/i386-apple-darwin10.5.0/libstdc++-v3/src
-L/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/i386-apple-darwin10.5.0/libstdc++-v3/src/.libs
-B/sw_i386/lib/gcc4.6/i386-apple-darwin10.5.0/bin/
-B/sw_i386/lib/gcc4.6/i386-apple-darwin10.5.0/lib/ -isystem
/sw_i386/lib/gcc4.6/i386-apple-darwin10.5.0/include -isystem
/sw_i386/lib/gcc4.6/i386-apple-darwin10.5.0/sys-include
-B/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/i386-apple-darwin10.5.0/./libstdc++-v3/src/.libs
-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections
-g -O2 -g -O2 -DLOCALEDIR="." -nostdinc++
-I/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/i386-apple-darwin10.5.0/libstdc++-v3/include/i386-apple-darwin10.5.0
-I/sw_i386/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/i386-apple-darwin10.5.0/libstdc++-v3/include
-I/sw_i386/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100814/libstdc++-v3/libsupc++
-I/sw_i386/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100814/libstdc++-v3/include/backward
-I/sw_i386/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100814/libstdc++-v3/testsuite/util
/sw_i386/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100814/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc
-include bits/stdc++.h ./libtestc++.a -L/sw_i386/lib -liconv -lm --save-temps
-m32 -o ./6.exe
ld: warning: can't add line info to anonymous symbol
cstring=A_from_A_ptr->ctor_count == 1 from 6.o


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/45196] ld: warning: can't add line info to anonymous symbol
       [not found] <bug-45196-4@http.gcc.gnu.org/bugzilla/>
@ 2010-10-01  0:52 ` howarth at nitro dot med.uc.edu
  0 siblings, 0 replies; 9+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2010-10-01  0:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jack Howarth <howarth at nitro dot med.uc.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #8 from Jack Howarth <howarth at nitro dot med.uc.edu> 2010-10-01 00:52:40 UTC ---
The 'can't add line info to anonymous symbol' warning has been removed as of
Xcode 4.0 due to the excessive noise it generates. This issue should not
reappear in the main gcc testsuite since...


2010-09-10  Jack Howarth <howarth@bromo.med.uc.edu>

        PR target/42070
        * gcc/testsuite/lib/profopt.exp: Prune warnings on execname2 compile.
        * gcc/testsuite/lib/prune.exp: Prune "can't add line info" warnings.

will prune out these bogus warnings under Xcode 3.2.x.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-10-01  0:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-05 13:37 [Bug target/45196] New: ld: warning: can't add line info to anonymous symbol howarth at nitro dot med dot uc dot edu
2010-08-05 14:23 ` [Bug target/45196] " iains at gcc dot gnu dot org
2010-08-05 17:55 ` howarth at nitro dot med dot uc dot edu
2010-08-15 17:36 ` howarth at nitro dot med dot uc dot edu
2010-08-15 18:47 ` howarth at nitro dot med dot uc dot edu
2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
2010-08-15 18:48 ` howarth at nitro dot med dot uc dot edu
2010-08-15 18:52 ` howarth at nitro dot med dot uc dot edu
     [not found] <bug-45196-4@http.gcc.gnu.org/bugzilla/>
2010-10-01  0:52 ` howarth at nitro dot med.uc.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).