[LLVMbugs] [Bug 4671] New: `.gnu.linkonce.t.XXX' referenced in section `.rodata' of XXX.o: defined in discarded section `.gnu.linkonce.t.X' of XXX. o regression with weak_odr function using switch table

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Aug 2 06:50:01 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4671

           Summary: `.gnu.linkonce.t.XXX' referenced in section `.rodata' of
                    XXX.o: defined in discarded section `.gnu.linkonce.t.X'
                    of XXX.o regression with weak_odr function using switch
                    table
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: regression
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: tomas.l.olsen at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3273)
 --> (http://llvm.org/bugs/attachment.cgi?id=3273)
bc 1

This was a little hard to reproduce, but seems to be caused by:

* a weak_odr uses a switch, and the switch is big enough to result in a
switch-table during codegen.

* the weak function itself goes in a .linkonce section
* the switch table in .rodata

if two modules contain the same function (and its switch table), once linking
(natively), one of the linkonce sections is removed, but the rodata is not.

Reproduce like this:
$ llc foo1.bc
$ llc foo2.bc
$ llc foo3.bc
$ gcc foo1.s foo2.s foo3.s -o foo

This produces some linker errors, most are due to these being D module and gcc
isn't linking the D runtime library, but the bug is shown as well:

`.gnu.linkonce.t._D3foo9__T2fnTiZ2fnFiZi' referenced in section `.rodata' of
/tmp/ccA6toMe.o: defined in discarded section
`.gnu.linkonce.t._D3foo9__T2fnTiZ2fnFiZi' of /tmp/ccA6toMe.o

I hope this is not too hard to fix, and took a little while to track down a
reasonable(?) testcase.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list