looking for a way to tell gcc not to remove some code he thinks is unreachable (SOVED)

looking for a way to tell gcc not to remove some code he thinks is unreachable (SOVED)

Erez D erez0001 at gmail.com
Mon Mar 7 14:42:25 IST 2011


As I was already manipulating the linker script, i added a KEEP(). now it
does not remove the funnction, or anything that is being addressed by it.

cheers,
erez.

On Mon, Mar 7, 2011 at 2:06 PM, Erez D <erez0001 at gmail.com> wrote:

>
>
> On Mon, Mar 7, 2011 at 1:33 PM, Muli Ben-Yehuda <muli at il.ibm.com> wrote:
>
>> On Mon, Mar 07, 2011 at 12:27:08PM +0200, Erez D wrote:
>>
>> > int x;
>> >
>> > void a()
>>
>> extern void a()
>>
> doesn't work
> avr32-gcc 4.3.2
>
>>
>> > {
>> >   x=3;
>> > }
>> >
>> > int main()
>> > {
>> >   x=0;
>> >   return 1;
>> > }
>> >
>> > ========================
>> >
>> > the linker will remove function a() as it is not called from
>> > enywhere.  however, i need it to be there, including all of its
>> > content.
>>
>> gcc (ld) 4.4.3 does not remove it in this case. What linker are you
>> using?
>>
>> Cheers,
>> Muli
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20110307/4134371c/attachment.html>


More information about the Linux-il mailing list