1b and 1f in GNU assembly

后端 未结 2 1313
傲寒
傲寒 2020-12-03 08:37

I am analyzing a linux exception code. By the way I can\'t understand gnu assembly syntax.

    svc_preempt:
    mov r8, lr
1:  bl  preempt_schedule_irq               


        
2条回答
  •  失恋的感觉
    2020-12-03 09:13

    Labels "xb" and "xf", where "x" is a number are a smart extension to the GNU assembly. It branches to the first found label "x" searching "forward" for "f" or "backward" for "b".

    That means that in your first listing using "1b" as a target will search for "1" BEFORE the instruction that uses it. In the second listing "2f" will search for "2" AFTER the instruction that uses it, the "2b" at the end of this listing will then branch to the same "2", because it is BEFORE the instruction.

    There may be multiple labels with numbers in your code.

    See here - https://sourceware.org/binutils/docs-2.24/as/Symbol-Names.html#Symbol-Names - chapter "Local labels".

提交回复
热议问题