What do the symbols mean in this assembly language statement:
.size _start, . - _start
I've searched and found quite a few identical examples and several variations but none explain what the components mean. The doc says that for ELF the format is .size name , expression
. I think it's saying the size is 'something' minus the address of _start
. Is that right and, if so, what is the 'something'?
I think it's saying the size is 'something' minus the address of
_start
. Is that right and, if so, what is the 'something'?
That's right, and that 'something' is actually the location counter which is the position in your program that is currently being processed by the assembler. Your particular assembler uses a dot . for this, while many other assemblers use a dollar sign $.
And as @fuz wrote in a comment, if the location counter is currently at the end of the _start function, the difference between the location counter and the address where the function begins gives its size.