[llvm-bugs] [Bug 31354] New: [ELF] - duplicate symbol error when linking some FreeBSD ports.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 12 07:22:58 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31354

            Bug ID: 31354
           Summary: [ELF] - duplicate symbol error when linking some
                    FreeBSD ports.
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: grimar at accesssoftek.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17749
  --> https://llvm.org/bugs/attachment.cgi?id=17749&action=edit
repro

Noticed that when linked ports/sysutils/safecat-1.13
and I think I saw the same in few other ports.

Error was:
/usr/bin/ld: error: byte_copy.c:(.text+0x0): duplicate symbol 'byte_copy'
/usr/bin/ld: error: byte_copy.c:(function byte_copy): previous definition was
here

Reproduce file (attached) can be reduced to:
-o safecat
usr/ports/sysutils/safecat/work/safecat-1.13/str.a
usr/ports/sysutils/safecat/work/safecat-1.13/alloc_re.o
usr/ports/sysutils/safecat/work/safecat-1.13/byte_copy.o

and problem is that str.a contains byte_copy.o:
./makelib str.a str_len.o byte_chr.o byte_diff.o  byte_copy.o byte_cr.o
byte_zero.o

and has next symbol: 'byte_copy'

So LLD first creates lazy symbol 'byte_copy', then finds undefined 'byte_copy'
in alloc_re.o and resolves it. At the end it reports duplicate symbol from
byte_copy.o.

Do we want to fix it ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161212/01e6b101/attachment.html>


More information about the llvm-bugs mailing list