<div dir="ltr"><div class="gmail_extra"><div>On Wed, Apr 3, 2013 at 8:45 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:</div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Do we need to compute this? We should only need to know if a symbol is<br>

referenced, not who is referencing it. With that we can just say that<br>
a symbol is referenced if<br>
<br>
* A relocation points to it.<br>
* It is in a section without SHF_SUBSECTION_VIA_SYMBOLS and a<br>
relocation points to that section.<br>
<br>
My concern is that in the non  SHF_SUBSECTION_VIA_SYMBOLS case the<br>
full symbol reference graph as defined above would be n^2 in cases<br>
like .text and .eh_frame. There is (approximately) one symbol in<br>
.eh_frame for each symbol in .text and it has a relocation to the<br>
corresponding .text symbol. We would get n^2 edges without<br>
SHF_SUBSECTION_VIA_SYMBOLS.<br></blockquote><div><br></div><div style>You don't need to track who is referencing a symbol to compute this. You just need to know who a symbol is referencing, and which symbols are part of a group. When you hit a symbol while traversing live symbols, you mark all symbols in that group live.</div>
<div><br></div><div>- Michael Spencer</div><div> </div></div></div></div>