Next: , Previous: Single, Up: Pseudo Ops

7.83 .size

This directive is used to set the size associated with a symbol.

COFF Version

For COFF targets, the .size directive is only permitted inside .def/.endef pairs. It is used like this:

     .size expression

.size is only meaningful when generating COFF format output; when as is generating b.out, it accepts this directive but ignores it.

ELF Version

For ELF targets, the .size directive is used like this:

     .size name , expression

This directive sets the size associated with a symbol name. The size in bytes is computed from expression which can make use of label arithmetic. This directive is typically used to set the size of function symbols.