[PATCH] D19389: [LTO] Create Undefined Bitcode symbol when we drop a comdat member

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 10:11:10 PDT 2016


rafael added inline comments.

================
Comment at: ELF/InputFiles.cpp:486
@@ +485,3 @@
+          UndefinedBitcode(NameRef, IsWeak, Visibility);
+        return Body;
+      }
----------------
With this Body never gets to

  if (GV && GV->isThreadLocal())
    Body->Type = STT_TLS;

so STT_TLS (and on trunk CanOmitFromDynSym) is never set.

Maybe we could split this function in two? One uses early returns to just construct the Body and the second one sets STT_TLS and CanOmitFromDynSym.

================
Comment at: test/ELF/lto/comdat2.ll:3
@@ +2,3 @@
+; RUN: llvm-mc -triple=x86_64-pc-linux %p/Inputs/comdat.s -o %t2.o -filetype=obj
+; RUN: ld.lld -m elf_x86_64 %t.o %t2.o -o %t.so -shared
+; RUN: llvm-readobj -t %t.so | FileCheck %s
----------------
I think this test already passes when linking in this order, no?

I think it is "%t2.o %t.o" that is currently broken. How about just testing both orders?


http://reviews.llvm.org/D19389





More information about the llvm-commits mailing list