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

            Bug ID: 42273
           Summary: symbol lookup of runtime function with multiple
                    definitions uses different definition in LTO vs.
                    non-LTO
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Demonstration:

echo "struct S { int x[100]; }; void f(struct S* s) { s[0] = s[1]; }" > input.c
echo "void* memcpy(void* dest, const void* src, unsigned long size) {}" >
memcpy.c
clang -c input.c
clang -c memcpy.c
clang -flto input.c -c -o input-lto.o
ar cr memcpy.a memcpy.o
clang -shared memcpy.o -o memcpy.so
clang -shared -fuse-ld=lld input.o memcpy.a memcpy.so
nm a.out | grep memcpy
clang -shared -fuse-ld=lld input-lto.o memcpy.a memcpy.so
nm a.out | grep memcpy

The first "nm" (the non-LTO case) prints "T", the second (the LTO case) prints
"U".

Having multiple definitions of memcpy is sort of weird, but it would be nice to
behave consistently here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to