Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-09 Thread Michael Vasiliev
On 03/07/2011 12:11 PM, Erez D wrote: I have a function which is not called in a regular way, so gcc thinks it is dead code. however it is not, and i am looking for a way to tell the linker not to remove it. i can call it from some place with a flag that tells it to do nothing, but this is

looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Erez D
I have a function which is not called in a regular way, so gcc thinks it is dead code. however it is not, and i am looking for a way to tell the linker not to remove it. i can call it from some place with a flag that tells it to do nothing, but this is a ugly hack is there a directive telling gcc

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Muli Ben-Yehuda
On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is not called in a regular way, so gcc thinks it is dead code. however it is not, and i am looking for a way to tell the linker not to remove it. extern ___ Linux-il

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Erez D
On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda m...@il.ibm.com wrote: On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is not called in a regular way, so gcc thinks it is dead code. however it is not, and i am looking for a way to tell the linker not to

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Raz
why do you think the linker removes the function ? what flags are using ? Please nm ( nm elf ). 2011/3/7 Erez D erez0...@gmail.com On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda m...@il.ibm.com wrote: On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Erez D
On Mon, Mar 7, 2011 at 12:34 PM, Raz razi...@gmail.com wrote: why do you think the linker removes the function ? what flags are using ? Please nm ( nm elf ). objdump -d does not show assembly for function a 2011/3/7 Erez D erez0...@gmail.com On Mon, Mar 7, 2011 at 12:18 PM, Muli

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Muli Ben-Yehuda
On Mon, Mar 07, 2011 at 12:27:08PM +0200, Erez D wrote: int x; void a() extern void a() { 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

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Orna Agmon Ben-Yehuda
On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda m...@il.ibm.com wrote: On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is not called in a regular way, so gcc thinks it is dead code. however it is not, and i am looking for a way to tell the linker not to

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Erez D
On Mon, Mar 7, 2011 at 1:49 PM, Orna Agmon Ben-Yehuda ladyp...@gmail.comwrote: On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda m...@il.ibm.com wrote: On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is not called in a regular way, so gcc thinks it is dead

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Erez D
On Mon, Mar 7, 2011 at 1:33 PM, Muli Ben-Yehuda m...@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; }

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

2011-03-07 Thread Erez D
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 erez0...@gmail.com wrote: On Mon, Mar 7, 2011 at 1:33 PM, Muli Ben-Yehuda m...@il.ibm.com

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Elazar Leibovich
2011/3/7 Orna Agmon Ben-Yehuda ladyp...@gmail.com On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda m...@il.ibm.com wrote: On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is not called in a regular way, so gcc thinks it is dead code. however it is not,

Re: looking for a way to tell gcc not to remove some code he thinks is unreachable.

2011-03-07 Thread Orna Agmon Ben-Yehuda
On Mon, Mar 7, 2011 at 3:30 PM, Elazar Leibovich elaz...@gmail.com wrote: 2011/3/7 Orna Agmon Ben-Yehuda ladyp...@gmail.com On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda m...@il.ibm.com wrote: On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: I have a function which is not