2

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 ."?

user2118110
  • 21
  • 1
  • 3

1 Answers1

1

See GNU Assembler Manual: The Special Dot Symbol:

The special symbol '.' refers to the current address that as is assembling into. Thus, the expression melvin: .long . defines melvin 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.

scottt
  • 7,008
  • 27
  • 37