I am relatively inexperienced with ARM assembly, and need help understanding a few lines. I have used Godbolt to compile C++ 11 code with the ARM gcc 8.2 compiler and got these lines of assembly:
.L10:
.word .LANCHOR0
I read that .LANCHOR0 are section anchors, but what does that mean?
I understand that .word and .data can be used together to declare variables and assign values to memory spaces like this:
.data ! start a group of variable declarations
x: .word 23 ! int x = 23;
But, what does
.L10:
.word .LANCHOR0
do? There is no label preceding .word here.
Secondly, what does it mean when a block of .word lines are proceeded by another block of assembly instructions like this?
.L7:
.word 131586
.word .LANCHOR0
_GLOBAL__sub_I_unsigned int atlantic_line_ns::getSimInstAddr<atlantic_line_ns::Cr>():
mov r2, #0
ldr r3, .L10
str r2, [r3]
str r2, [r3, #4]
bx lr
Thanks in advance.
UPDATE
After reading the ARM documentation a bit more, I understand that
.L7:
.word 131586
.word .LANCHOR0
Allocates 2 memory locations, storing values, 131586 and the value at .LANCHOR0, there. Are these memory locations next to each other? Also, what does .LANCHR0 mean?
.L10:on the previous line? Anyway, look for where GCC puts the.LANCHOR0:label: IIRC, it uses it as a common reference point for referencing multiple items of static data. (After loading the.LANCHOR0address from a literal pool near the code.) - Peter Cordes.set .LANCHOR0,. + 0somewhere in the listing. On the purpose of 'section anchors' read this if you haven't already. - tum_