symbol size as function size

Mike Frysinger vapier@gentoo.org
Fri Jun 24 17:42:00 GMT 2011


On Thu, Jun 23, 2011 at 12:16, Paulo J. Matos wrote:
> Following a post to gcc mailing list I need help with setting up a binutils
> backend properly.
>
> We currently have a builtin GCC function __function_size that expands into a
> symbol and a function sum would have the assembly code:
>
> sum:
>        ... // CODE FOR SUM
>        .global __size_of_sum
>        .equ __size_of_sum, .-sum
>
> __size_of_sum would then be used as a symbol containing the size in words of
> sum.

i hope this is something you plan on pushing to mainline.  this is a
builtin ive long wished existed.  useful for things like bootloaders
that need to manually relocate specific functions.
-mike



More information about the Binutils mailing list