I was going through arch/arm/head.S and found below code
__turn_mmu_on_loc:
.long .
.long __turn_mmu_on
.long __turn_mmu_on_end
I am not able to understand ".long ."?
I was going through arch/arm/head.S and found below code
__turn_mmu_on_loc:
.long .
.long __turn_mmu_on
.long __turn_mmu_on_end
I am not able to understand ".long ."?
See GNU Assembler Manual: The Special Dot Symbol:
The special symbol '
.
' refers to the current address thatas
is assembling into. Thus, the expressionmelvin: .long .
definesmelvin
to contain its own address. Assigning a value to.
is treated the same as a.org
directive. Thus, the expression.=.+4
is the same as saying.space 4
.
So in your snippet, the current address is placed before the value of the __turn_mmu_on
, __turn_mmu_on_end
symbols. You see constructs like these a lot in assembler files and linker scripts as they lay out their data structures.