Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C拆卸到ARMv6:标签前点(.)的含义_C_Assembly_Arm - Fatal编程技术网

C拆卸到ARMv6:标签前点(.)的含义

C拆卸到ARMv6:标签前点(.)的含义,c,assembly,arm,C,Assembly,Arm,我反汇编了一个C程序,看看结构是如何创建的,我有一个问题。 这是在树莓皮上用 gcc-S-o source.S mystruct.c 获取来源 问题: 我注意到在我反汇编的所有程序中,都有标签.Lxx。前面有的标签和没有的标签有什么区别?我想我很困惑,因为指令有一个“.”,比如.data 代码 拆开 .arch armv6 .eabi_attribute 27, 3 .eabi_attribute 28, 1 .fpu vfp

我反汇编了一个C程序,看看结构是如何创建的,我有一个问题。 这是在树莓皮上用

gcc-S-o source.S mystruct.c

获取来源

问题: 我注意到在我反汇编的所有程序中,都有标签
.Lxx
。前面有
的标签和没有
的标签有什么区别?我想我很困惑,因为指令有一个“.”,比如
.data

代码 拆开

        .arch armv6
        .eabi_attribute 27, 3
        .eabi_attribute 28, 1
        .fpu vfp
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 6
        .eabi_attribute 34, 1
        .eabi_attribute 18, 4
        .file   "struct.c"
        .section        .rodata
        .align  2
.LC0:
        .word   1
        .word   2
        .text
        .align  2
        .global main
        .type   main, %function
main:
        @ args = 0, pretend = 0, frame = 16
        @ frame_needed = 1, uses_anonymous_args = 0
        @ link register save eliminated.
        str     fp, [sp, #-4]!
        add     fp, sp, #0
        sub     sp, sp, #20
        str     r0, [fp, #-16]
        str     r1, [fp, #-20]
        ldr     r2, .L3
        sub     r3, fp, #12
        ldmia   r2, {r0, r1}
        stmia   r3, {r0, r1}
        mov     r3, #3
        str     r3, [fp, #-12]
        mov     r3, #0
        mov     r0, r3
        add     sp, fp, #0
        ldmfd   sp!, {fp}
        bx      lr
.L4:
        .align  2
.L3:
        .word   .LC0
        .size   main, .-main
        .ident  "GCC: (Debian 4.7.2-5+rpi1) 4.7.2"
        .section        .note.GNU-stack,"",%progbits

.L
前缀表示本地符号,该符号仅在该源文件中可见(除非为汇编程序指定了特殊选项,否则这些符号不会导出到
.o
文件)

您可以分辨出它们是标签,因为该行以
结尾;指令没有

有关更多信息,请参阅GCC文档:

本地符号是以某些本地标签前缀开头的任何符号。默认情况下,对于ELF系统,本地标签前缀为
.L
,对于传统a.out系统,本地标签前缀为
L
,但每个目标可能有自己的本地标签前缀集。在HPPA上,本地符号以
L$
开头

        .arch armv6
        .eabi_attribute 27, 3
        .eabi_attribute 28, 1
        .fpu vfp
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 6
        .eabi_attribute 34, 1
        .eabi_attribute 18, 4
        .file   "struct.c"
        .section        .rodata
        .align  2
.LC0:
        .word   1
        .word   2
        .text
        .align  2
        .global main
        .type   main, %function
main:
        @ args = 0, pretend = 0, frame = 16
        @ frame_needed = 1, uses_anonymous_args = 0
        @ link register save eliminated.
        str     fp, [sp, #-4]!
        add     fp, sp, #0
        sub     sp, sp, #20
        str     r0, [fp, #-16]
        str     r1, [fp, #-20]
        ldr     r2, .L3
        sub     r3, fp, #12
        ldmia   r2, {r0, r1}
        stmia   r3, {r0, r1}
        mov     r3, #3
        str     r3, [fp, #-12]
        mov     r3, #0
        mov     r0, r3
        add     sp, fp, #0
        ldmfd   sp!, {fp}
        bx      lr
.L4:
        .align  2
.L3:
        .word   .LC0
        .size   main, .-main
        .ident  "GCC: (Debian 4.7.2-5+rpi1) 4.7.2"
        .section        .note.GNU-stack,"",%progbits