<div dir="ltr">Hi, <div><br></div><div>I am using the llvm codegen facility (version 7.0.1) to translate LLVM IR for different platforms. I have this error particularly in win64 platform. In my IR code I have such code snippet:</div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">%50 = call i8* @my_function(i8* %48, double 2.000000e+00, double 2.000000e+00)<br>...<br>declare dllimport i8* @my_function(i8*, double, double)<br></blockquote>By passing it to llc.exe, I find following symbol is declared in object file's symbol table. </div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>[10](sec  5)(fl 0x00)(ty   0)(scl   0) (nx 0) 0x00000000 __real@4000000000000000</div></div></blockquote><div><div>which has storage class 0, and it will lead to an error when I try to link it with the rest of objects. </div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>obj1.obj: Unrecognized storage class 0 for .rdata symbol `__real@4000000000000000'. </div></div></blockquote><div><br></div>As comparison, I compile an equivalent c file (to my llvm asm file) using clang-7.0 and emit the llvm from there. For this particular line, I see no difference in terms of syntax, except clang generates bunch of function attributes to the function declaration. I pass the clang generated llvm asm to llc and find the output object file also has one symbol has the same name, but the storage class is set to 2. <blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>[10](sec  5)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000  __real@4000000000000000</div></blockquote><div>That will probably resolve the linkage error issue. But I don't understand what's the key factor to determine the storage class and what change should I put into my generated IR. </div><div><br></div><div>Moreover, I looked up the microsoft doc about storage class. The storage class 2 is described as "<span style="color:rgb(0,0,0);font-family:"Segoe UI",SegoeUI,"Segoe WP","Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:14px">A value that Microsoft tools use for external symbols.</span><span style="color:rgb(0,0,0);font-family:"Segoe UI",SegoeUI,"Segoe WP","Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:14px"> " </span>It doesn't sound like a symbol represents a floating point constant at all. </div><div><span style="color:rgb(0,0,0);font-family:"Segoe UI",SegoeUI,"Segoe WP","Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:14px"><br></span></div>Due to my limited knowledge of PE COFF and llvm codegen for windows platform,  I am totally confused here. Any suggestion and hint are desperately welcomed!<div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Shiyao Ge (Gracia)<div><br></div><div><br></div></div></div></div></div></div></div></div>