No they are not unique. That's the important part. You can reuse them. They were meant to be used in macros so they would be duplicated all over the place. You can only ever refer to two numeric labels with the same number (namely the next one and the previous one). It is because they are not unique that you need the f and b suffixes. Once I saw someone get the address of a static variable in a position independent way, without actually using position independent relocations:cart wrote:I may be mistaken/misusing but I thought numeric labels, with "f/b", were supposed to be local and unique.
Code: Select all
.text
function:
call 1f
1: popl %eax
addl $(1f-1b), %eax
[...]
.data
1: .long -1
Code: Select all
.text
1: movl (%esp), %eax
ret
function:
call 1b
1: addl $(1f-1b), %eax
[...]
.data
1: .long -1