Re: __function_size builtin

2011-06-23 Thread Paulo J. Matos
On 22/06/11 23:25, Ian Lance Taylor wrote: "Paulo J. Matos" writes: On 22/06/11 17:34, Paulo J. Matos wrote: I thought this was the same as using __attribute__((used)) on a function declaration (which works). DECL_PRESERVE_P(node) = 1; seems to be what I wanted. :) I always wondered wha

Re: __function_size builtin

2011-06-22 Thread Ian Lance Taylor
"Paulo J. Matos" writes: > On 22/06/11 17:34, Paulo J. Matos wrote: >> I thought this was the same as using __attribute__((used)) on a function >> declaration (which works). >> > > DECL_PRESERVE_P(node) = 1; > > seems to be what I wanted. :) I always wondered what that was for. Ian

Re: __function_size builtin

2011-06-22 Thread Paulo J. Matos
On 22/06/11 17:34, Paulo J. Matos wrote: I thought this was the same as using __attribute__((used)) on a function declaration (which works). DECL_PRESERVE_P(node) = 1; seems to be what I wanted. :)

Re: __function_size builtin

2011-06-22 Thread Paulo J. Matos
On 22/06/11 16:23, Ian Lance Taylor wrote: You don't need to do that, you just need to tell the assembler to not fully resolve the difference between two text symbols, but to leave it to the linker as a PC-relative reloc. In gas you typically do this by defining DIFF_EXPR_OK in your config/tc-CP

Re: __function_size builtin

2011-06-22 Thread Ian Lance Taylor
"Paulo J. Matos" writes: > My thought was to fold __function_size still to a special label > (unique for each function) that would be then generates by as and set > to the unrelaxed size of the function. Once the linker performs the > required relaxation it also modifies the label value according