My question is about some popular but not well documented code I have found in ARM CORTEX M startup files like this STM32.
The 'pattern' is:
.size X,.-X
,where X is a symbol or label.
I have found this answer and understand how .size directive and dot special symbol work, but still complete line seems to do nothing to me. The result of the operation .-X isn't stored anywhere.
Could anybody explain what the line does?
.size
directive. – Pettifogger$ - X
in NASM: How does $ work in NASM, exactly?. But the.size
directive emits ELF metadata with the function size, which is useful for shared libraries. – Sprinkle