<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Folks,<div><br></div><div>My colleague and I ran into this problem when we tried to run our custom analysis on the latest kernel. We used llvm-link to generate the final bitcode and when we ran opt we got the error </div><div>"LLVM ERROR: invalid symbol redefinition".</div><div><br></div><div>After digging around we figured out that because the symbols defined by inline assembly directives "<span style="white-space:pre-wrap;background-color:rgb(255,255,255)"><font color="#000000" face="arial, sans-serif">module asm</font></span>" are not checked if they are duplicated when llvm-link links the bitcode files. </div><div><br></div><div>However, in MCStreamer, the program will abort because it find out there are actually multiple symbols defined in that final bitcode file.</div><div><br></div><div>I am wondering is it a good idea to have this inconsistency behavior, <a href="https://llvm.org/docs/LangRef.html#module-level-inline-assembly">here</a> the document says it is intended for llvm-link to simply concatenate symbols defined by inline asm without checking duplication, as it does for other normally defined symbols. The problem is having this erroneous bitcode, other tools in the pipeline can't work correctly since there are duplicated symbols.</div><div><br></div><div>Ideally, llvm-link should've pointed out the redefinition error, but since it is a documented behavior there must be some reason. I am wondering what that could be? </div><div><br></div><div>In addition, could you provide some suggestion on how we can resolve this without manually editing the erroneous bc file?</div><div><br></div><div>Thanks in advance,</div><div>Eric</div><div><br></div><div>PS: if you want to reproduce the behavior, I attached the 2 bitcode files that can be linked successfully by llvm-link but if you try to use opt to parse it and generate a new bitcode, the program error out.</div><div><br></div><div>PPS: I am using llvm-9.0.</div><div>  </div><div></div></div></div></div></div>