public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/52634] New: multiple definition error when using alias
@ 2012-03-20 12:32 tianbin at cernet dot edu.cn
  2012-03-20 13:16 ` [Bug lto/52634] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tianbin at cernet dot edu.cn @ 2012-03-20 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52634
           Summary: multiple definition error when using alias
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tianbin@cernet.edu.cn


When compiling a project which have 11 cpp files with -flto, g++-4.7 reports
the following error
------
xxx.ltrans25.ltrans.o:(.bss+0x0): multiple definition of `cfliteKeyCallBacks'
xxx.ltrans15.ltrans.o:(.bss+0x0): first defined here
xxx.ltrans29.ltrans.o:(.data+0xc80): multiple definition of
`cfliteKeyCallBacks'
xxx.ltrans15.ltrans.o:(.bss+0x0): first defined here

in xxx.ltrans25.s, I found
----
        .hidden cfliteKeyCallBacks
        .globl  cfliteKeyCallBacks
        .bss
        .align 32
        .type   cfliteKeyCallBacks, @object
        .size   cfliteKeyCallBacks, 48
cfliteKeyCallBacks:
        .zero   48
        .set    cfliteArrayCallBacks.4936,cfliteKeyCallBacks

in xxx.ltrans15.s, I found
----
        .hidden cfliteKeyCallBacks
        .globl  cfliteKeyCallBacks
        .bss
        .align 32
        .type   cfliteKeyCallBacks, @object
        .size   cfliteKeyCallBacks, 48
cfliteKeyCallBacks:
        .zero   48
        .set    cfliteValueCallBacks.3513,cfliteKeyCallBacks

in xxx.ltrans29.s, I found
----
        .hidden cfliteKeyCallBacks
        .globl  cfliteKeyCallBacks
        .data
        .align 32
        .type   cfliteKeyCallBacks, @object
        .size   cfliteKeyCallBacks, 48
cfliteKeyCallBacks:
        .quad   0
        .quad   _ZL17cflite_key_retainPK13__CFAllocatorPKv.19440
        .quad   _ZL18cflite_key_releasePK13__CFAllocatorPKv.19434
        .quad   _ZL21cflite_key_copy_descrPKv.19447
        .quad   _ZL16cflite_key_equalPKvS0_.19429
        .quad   _ZL15cflite_key_hashPKv.19425

And in cflite.cpp, the corespond source is
---------------
...
CFDictionaryKeyCallBacks cfliteKeyCallBacks = {
    0,
    cflite_key_retain,
    cflite_key_release,
    cflite_key_copy_descr,
    cflite_key_equal,
    cflite_key_hash,
};

extern CFDictionaryValueCallBacks cfliteValueCallBacks
__attribute__((alias("cfliteKeyCallBacks")));

extern CFArrayCallBacks cfliteArrayCallBacks
__attribute__((alias("cfliteKeyCallBacks")));

The project compiles ok without -flto.


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

end of thread, other threads:[~2021-12-24  8:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 12:32 [Bug lto/52634] New: multiple definition error when using alias tianbin at cernet dot edu.cn
2012-03-20 13:16 ` [Bug lto/52634] " rguenth at gcc dot gnu.org
2012-03-20 14:17 ` tianbin at cernet dot edu.cn
2012-03-20 14:31 ` tianbin at cernet dot edu.cn
2012-03-20 14:56 ` rguenth at gcc dot gnu.org
2012-03-20 15:05 ` rguenth at gcc dot gnu.org
2012-03-20 17:22 ` hubicka at gcc dot gnu.org
2012-03-25 10:24 ` hubicka at gcc dot gnu.org
2012-04-09 23:39 ` hubicka at gcc dot gnu.org
2012-04-10 15:10 ` hubicka at gcc dot gnu.org
2012-10-14  9:14 ` tianbin at cernet dot edu.cn
2021-12-24  8:59 ` pinskia at gcc dot gnu.org

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