[PATCH] D24595: [lib/LTO] Remove now unneded hack for undefined symbols

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 08:22:38 PDT 2016


> On Sep 15, 2016, at 8:20 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> So, while this is not necessary for the original test case, it would still be needed for the slightly expanded version in lld:
> 
> With
> 
> target triple = "x86_64-unknown-linux-gnu"
> module asm ".weak patatino"
> module asm ".equ patatino, foo"
> declare void @patatino()
> define void @foo() { ret void }
> define void @_start() {
>  call void @patatino()
>  ret void
> }
> 
> we end up with the following symbols
> 
> U patatino 
> T foo
> T _start
> W patatino
> U foo 
> 
> Not the duplicated patatino and that the second now is now correctly a defined symbol. I think the correct fix is to change IRObjectFile to report only one, the one without an associated GV and then things should really just work.

Yes that sounds the proper fix: we should have llvm-nm report the correct list for instance.

— 
Mehdi



More information about the llvm-commits mailing list