public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/53831] New: Inline virtuals missing in LTO symtab
@ 2012-07-02 19:50 tetra2005 at gmail dot com
  2012-07-02 19:52 ` [Bug lto/53831] " tetra2005 at gmail dot com
                   ` (37 more replies)
  0 siblings, 38 replies; 39+ messages in thread
From: tetra2005 at gmail dot com @ 2012-07-02 19:50 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53831
           Summary: Inline virtuals missing in LTO symtab
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tetra2005@gmail.com


The attached sample program works fine when compiled without LTO:
  $ make clean all
but fails if I specify -flto:
  $ make USE_LTO=1 clean all
  libdummy.a: could not read symbols: Bad value
  collect2: error: ld returned 1 exit status
  make: *** [test.exe] Error 1
The error is caused by a mismatch in libdummy.a's ordinary symtab:
  $ arm-linux-androideabi-nm libdummy.a
  impl.o:
  ...
  00000000 W _ZN1C1fEv
  00000000 T _ZN1C1gEv
  00000000 D _ZTV1C
  ...
and it's LTO symtab:
  $ arm-linux-androideabi-objdump -hts impl.o
  ...
  Contents of section .gnu.lto_.symtab.1306600d0972f21a:
  0000 5f5a4e31 43316745 76000000 00000000  _ZN1C1gEv.......
  0010 00000000 00a10000 005f5a54 56314300  ........._ZTV1C.
  0020 00000000 00000000 000000b5 000000    ...............
  Contents of section .gnu.lto_.opts:
  ...
Note that _ZN1C1fEv (which is mangled name for inline virtual C::f()) is
missing in LTO symtab. This later causes linker to go mad in
elf_link_add_archive_symbols() when trying to link in impl.o more than once
(element->archive_pass > 0).

It seems that C::f() is filtered out in produce_symtab in lto-streamer-out.c:
  if (DECL_COMDAT (node->symbol.decl)
      && cgraph_comdat_can_be_unshared_p (node))
    continue;
because C::f() is (erroneously) considered to be COMDAT.

I've tested the code with TOT binutils and gcc. I had to include multiple file
program because otherwise bug would fail to manifest.


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

end of thread, other threads:[~2014-12-19 22:49 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-02 19:50 [Bug lto/53831] New: Inline virtuals missing in LTO symtab tetra2005 at gmail dot com
2012-07-02 19:52 ` [Bug lto/53831] " tetra2005 at gmail dot com
2012-07-03 10:32 ` rguenth at gcc dot gnu.org
2012-07-03 10:45 ` tetra2005 at gmail dot com
2012-07-03 10:52 ` rguenth at gcc dot gnu.org
2012-07-03 11:00 ` rguenth at gcc dot gnu.org
2012-07-03 12:16 ` tetra2005 at gmail dot com
2012-07-03 12:40 ` rguenth at gcc dot gnu.org
2012-07-03 12:46 ` rguenth at gcc dot gnu.org
2012-07-03 12:54 ` rguenth at gcc dot gnu.org
2012-07-03 12:59 ` tetra2005 at gmail dot com
2012-07-03 13:12 ` rguenth at gcc dot gnu.org
2012-07-03 13:17 ` rguenth at gcc dot gnu.org
2012-07-03 13:19 ` [Bug lto/53831] [4.7/4.8 Regression] Virtuals " rguenth at gcc dot gnu.org
2012-07-03 13:20 ` hubicka at gcc dot gnu.org
2012-07-03 13:31 ` tetra2005 at gmail dot com
2012-07-03 13:39 ` markus at trippelsdorf dot de
2012-07-03 13:46 ` markus at trippelsdorf dot de
2012-07-03 14:10 ` rguenth at gcc dot gnu.org
2012-07-03 14:13 ` rguenth at gcc dot gnu.org
2012-07-03 16:55 ` tetra2005 at gmail dot com
2012-07-04  9:28 ` rguenth at gcc dot gnu.org
2012-07-04 12:25 ` andi-gcc at firstfloor dot org
2012-07-04 12:32 ` tetra2005 at gmail dot com
2012-07-10 15:34 ` tetra2005 at gmail dot com
2012-09-20 10:20 ` jakub at gcc dot gnu.org
2012-10-06 14:51 ` hubicka at gcc dot gnu.org
2012-10-06 15:30 ` hubicka at gcc dot gnu.org
2012-10-06 16:06 ` markus at trippelsdorf dot de
2012-10-06 16:21 ` hubicka at ucw dot cz
2012-10-06 17:31 ` hubicka at gcc dot gnu.org
2012-12-06 16:24 ` rguenth at gcc dot gnu.org
2013-01-09 21:41 ` [Bug lto/53831] [4.7 " hubicka at gcc dot gnu.org
2013-04-11  7:59 ` rguenth at gcc dot gnu.org
2014-05-19 15:59 ` trippels at gcc dot gnu.org
2014-05-19 16:18 ` hvtaifwkbgefbaei at gmail dot com
2014-06-12 13:14 ` rguenth at gcc dot gnu.org
2014-12-19 22:46 ` htl10 at users dot sourceforge.net
2014-12-19 22:49 ` htl10 at users dot sourceforge.net

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).