<div dir="ltr"><div>Hello.</div><div><br></div><div>I'm posting this question here, because there seem to be no LLD-specific mailing list. Sorry in advance if this is wrong one.</div><div><br></div><div>I compile two C source with following command:</div><div><br></div><div>clang -flto -o %name.bc %name.c</div><div><br></div><div>LLVM is augmented with my custom pass, which amongst other things create a global with appending linkage:</div><div><br></div><div>@myvar = appending constant [1 x [1 x i8]*] ...</div><div><br></div><div>I also have another pass plugged into LTO pipeline, which turns this global  into internal one in the final module. I was hoping that LLD would first link bitcodes like llvm-link, appending @myvar's from both modules into a single one, then run my pass, and only then perform linking at object level.<br></div><div><br></div><div>However, LLD complains about duplicated symbol "myvar" and doesn't even run any passes.</div><div><br></div><div>I've tracked the problem down to <span class="gmail-pl-en">BitcodeFile::parse</span>() function from <a href="https://github.com/llvm/llvm-project/blob/master/lld/COFF/InputFiles.cpp#L918">https://github.com/llvm/llvm-project/blob/master/lld/COFF/InputFiles.cpp#L918</a> - it doesn't take linkage type into account. <br></div><div><br></div><div>Can anything be done about this problem? Or was my approach broken from the beginning?<br></div><div><br></div><div>Thanks in advance.<br></div></div>