<div dir="ltr">why do you think the linker removes the function ? what flags are using ? <div>Please nm ( nm <elf> ).<br><br><div class="gmail_quote">2011/3/7 Erez D <span dir="ltr"><<a href="mailto:erez0001@gmail.com">erez0001@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr"><div class="im"><br><br><div class="gmail_quote">On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda <span dir="ltr"><<a href="mailto:muli@il.ibm.com" target="_blank">muli@il.ibm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div>On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote:<br>
<br>
> I have a function which is not called in a regular way, so gcc<br>
> thinks it is dead code. however it is not, and i am looking for a<br>
> way to tell the linker not to remove it.<br>
<br>
</div>extern<br>
<br>
</blockquote></div></div>how ? <br>sorry, didn't get what you mean.<br><br>i'll give an example:<br><br>=============== my code ========<br>int x;<br><br>void a()<br>{<br> x=3;<br>}<br><br>int main()<br>{<br> x=0;<br>
return 1;<br>}<br><br>========================<br><br>the linker will remove function a() as it is not called from enywhere.<br>however, i need it to be there, including all of its content.<br><br>how do i do that.<br>
<br>
</div>
<br>_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br></blockquote></div><br></div></div>