[lld] r272845 - Document an interesting LTO case.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 14:48:48 PDT 2016


On Wed, Jun 15, 2016 at 2:33 PM, Rafael Espindola via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rafael
> Date: Wed Jun 15 16:33:11 2016
> New Revision: 272845
>
> URL: http://llvm.org/viewvc/llvm-project?rev=272845&view=rev
> Log:
> Document an interesting LTO case.
>
> This is a reduction from the only symbol in a build of clang that the
> gold plugin internalizes but lld does not.
>

Interesting. Do you plan to fix this case or the trouble is not worth the gain?

Thanks,

--
Davide

> Added:
>     lld/trunk/test/ELF/lto/Inputs/unnamed-addr-lib.s
>     lld/trunk/test/ELF/lto/unnamed-addr-lib.ll
>
> Added: lld/trunk/test/ELF/lto/Inputs/unnamed-addr-lib.s
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/Inputs/unnamed-addr-lib.s?rev=272845&view=auto
> ==============================================================================
> --- lld/trunk/test/ELF/lto/Inputs/unnamed-addr-lib.s (added)
> +++ lld/trunk/test/ELF/lto/Inputs/unnamed-addr-lib.s Wed Jun 15 16:33:11 2016
> @@ -0,0 +1,6 @@
> +        .protected foo
> +        .global foo
> +foo:
> +
> +        .global bar
> +bar:
>
> Added: lld/trunk/test/ELF/lto/unnamed-addr-lib.ll
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/unnamed-addr-lib.ll?rev=272845&view=auto
> ==============================================================================
> --- lld/trunk/test/ELF/lto/unnamed-addr-lib.ll (added)
> +++ lld/trunk/test/ELF/lto/unnamed-addr-lib.ll Wed Jun 15 16:33:11 2016
> @@ -0,0 +1,21 @@
> +; REQUIRES: x86
> +; RUN: llvm-as %s -o %t.o
> +; RUN: llvm-mc %p/Inputs/unnamed-addr-lib.s -o %t2.o -filetype=obj -triple=x86_64-pc-linux
> +; RUN: ld.lld %t2.o -shared -o %t2.so
> +; RUN: ld.lld -m elf_x86_64 %t.o %t2.so -o %t.so -save-temps -shared
> +; RUN: llvm-dis %t.so.lto.bc -o - | FileCheck %s
> +
> +; This documents a small limitation of lld's internalization logic. We decide
> +; that bar should be in the symbol table because if it is it will preempt the
> +; one in the shared library.
> +; We could add one extra bit for ODR so that we know that preemption is not
> +; necessary, but that is probably not worth it.
> +
> +; CHECK: @foo = internal unnamed_addr constant i8 42
> +; CHECK: @bar = weak_odr unnamed_addr constant i8 42
> +
> +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> +target triple = "x86_64-unknown-linux-gnu"
> +
> + at foo = linkonce_odr unnamed_addr constant i8 42
> + at bar = linkonce_odr unnamed_addr constant i8 42
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list