<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 19, 2009, at 12:43 PM, Aaron Gray wrote:</div><blockquote type="cite"><div class="gmail_quote">2009/7/19 Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span><br> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div style="WORD-WRAP: break-word"><br> <div> <div class="im"> <div>On Jul 19, 2009, at 8:35 AM, Aaron Gray wrote:</div><br> <blockquote type="cite"> <div>I am getting a simular problem with ___main appearing if <a href="mailto:'@main'" target="_blank">'@main'</a> is used but there is no instance of it in the Module iterators, only in the relocations.</div> <div> </div> <div>Is it possible to do something about these 'ghost symbols' and have them defined in Module. Rather than having to check for them and pick them up when processing relocations.</div></blockquote><br></div>You should not be walking the module.</div> </div></blockquote> <div> </div> <div>How else do you get the right symbol info ?</div></div></blockquote><div><br></div>You see symbol definitions and references come through the code generator.</div><div><br><blockquote type="cite"><div class="gmail_quote"> <div>But as I have said lowering functions donot generate there substitute value symbols in the Module. They just magically appear in the relocations without being in the module. This is a design flaw in LLVM.</div></div></blockquote><div><br></div>You do not understand how the code generator works.</div><div><br><blockquote type="cite"><div class="gmail_quote"> <div>I have done a hack in the COFF writer's relocation code to get round this for now. But it does not work very well with symbol indexes.</div> <div> </div> <div>But am thinking of doing a cleanup pass, or walk the module to get this info.</div> <div> </div> <div>What do you mean "You should not be walking the module." ?</div> </div></blockquote></div><br><div>You should not walk the function list of the module. You should not use Module* for anything other than handling file scope inline asm and walking the global variables. </div><div><br></div><div>-Chris</div></body></html>