2017-01-21 4 views
0

어셈블리 코드를 작성하려면 플래그 -S가있는 mipsel-openwrt-linux-uclibc-gcc 컴파일러 (Linaro GCC 4.8-2014.04 r49389)를 호출합니다.Strange Linaro mips 컴파일러 어셈블리 출력

 .section .mdebug.abi32 
     .previous 
     .gnu_attribute 4, 3 
     .abicalls 
     .option pic0 
     .text 
    $Ltext0: 
     .cfi_sections .debug_frame 
     .globl Version 
     .section .rodata.str1.4,"aMS",@progbits,1 
     .align 2 
    $LC0: 
     .ascii "3.3\000" 
     .data 
     .align 2 
     .type Version, @object 
     .size Version, 4 
    Version: 
     .word $LC0 
     .text 
    $Letext0: 
     .file 1 "version.c" 
     .section .debug_info,"",@progbits 
    $Ldebug_info0: 
     .4byte 0x3d 
     .2byte 0x4 
     .4byte $Ldebug_abbrev0 
     .byte 0x4 
     .uleb128 0x1 
     .4byte $LASF0 
     .byte 0x1 
     .4byte $LASF1 
     .4byte $LASF2 
     .4byte $Ldebug_line0 
     .uleb128 0x2 
     .4byte $LASF3 
     .byte 0x1 
     .byte 0x2 
     .4byte 0x2e 
     .uleb128 0x5 
     .byte 0x3 
     .4byte Version 
     .uleb128 0x3 
     .byte 0x4 
     .4byte 0x34 
     .uleb128 0x4 
     .4byte 0x39 
     .uleb128 0x5 
     .byte 0x1 
     .byte 0x6 
     .4byte $LASF4 
     .byte 0 
     .section .debug_abbrev,"",@progbits 
    $Ldebug_abbrev0: 
     .uleb128 0x1 
     .uleb128 0x11 
     .byte 0x1 
     ---- I cutted here ---- 
     .uleb128 0xe 
     .byte 0 
     .byte 0 
     .byte 0 
     .section .debug_aranges,"",@progbits 
     .4byte 0x14 
     .2byte 0x2 
     .4byte $Ldebug_info0 
     .byte 0x4 
     .byte 0 
     .2byte 0 
     .2byte 0 
     .4byte 0 
     .4byte 0 
     .section .debug_line,"",@progbits 
    $Ldebug_line0: 
     .section .debug_str,"MS",@progbits,1 
    $LASF2: 
     .ascii "/home/lvr/Src/openwrt/build_dir/target-mipsel_mips32_uCl" 
     .ascii "ibc-0.9.33.2/diffutils-3.3/src\000" 
    $LASF0: 
     .ascii "GNU C 4.8.3 -mno-branch-likely -mips32 -mtune=mips32 -ms" 
     .ascii "oft-float -mllsc -mplt -mno-shared -g -Os -std=c99 -fno-" 
     .ascii "caller-saves -fhonour-copts\000" 
    $LASF3: 
     .ascii "Version\000" 
    $LASF4: 
     .ascii "char\000" 
    $LASF1: 
     .ascii "version.c\000" 
     .ident "GCC: (OpenWrt/Linaro GCC 4.8-2014.04 r49389) 4.8.3" 
     .section .note.GNU-stack,"",@progbits 

이 나에게 & T도 인텔 구문 AT처럼 보이지 않는 : 이이처럼 보이는 어셈블리 코드를 생성합니다. 더 익숙한 구문을 생성하기 위해 -masm = intel 플래그를 사용해 보았지만 같은 결과가 발생했습니다.

내 첫 번째 thougt는 생성 된 ASM 코드로, 고정 된 단어 너비는 이지만 생성 방법은 AT & T 또는 Intel 구문을 통한 mipsel-openwrt-linux-uclibc-gcc?

어떤 힌트를 주셔서 감사합니다!

+0

무엇 AT & T와 인텔 구문 MIPS와 함께 할 필요가? 또한이 코드는 어셈블러 지시문 일뿐입니다. –

+0

AT & T/Intel 구문은 x86의 유일한 것임을 유의하십시오. – fuz

답변

0

"T와 Intel 구문이 MIPS와 관련이있는 것은 무엇입니까?" - 아무 것도 직접적으로, 나는 'mipsel-openwrt-linux-uclibc-gcc'라는 태그를 사용할 수 없다 (sry, 아마도 나쁜 스타일)라는 방식으로 태그를 붙였다. 그러나 감사 마가렛 귀하의 의견은 나를 & AT 기대로 이어지는 좀 더이 .c 파일을 컴파일하도록 지시 T 구문 : - f.e :

 .section .mdebug.abi32 
     .previous 
     .gnu_attribute 4, 3 
     .abicalls 
     .option pic0 
     .text 
    $Ltext0: 
     .cfi_sections .debug_frame 
     .align 2 
    $LFB16 = . 
     .file 1 "io.c" 
     .loc 1 474 0 
     .cfi_startproc 
     .set nomips16 
     .ent prepare_text 
     .type prepare_text, @function 
    prepare_text: 
     .frame $sp,48,$31  # vars= 0, regs= 5/0, args= 16, gp= 8 
     .mask 0x800f0000,-4 
     .fmask 0x00000000,0 
     .set noreorder 
     .set nomacro 
    $LVL0 = . 
     addiu $sp,$sp,-48 
     .cfi_def_cfa_offset 48 
     sw $17,32($sp) 
     sw $31,44($sp) 
     sw $19,40($sp) 
     sw $18,36($sp) 
     sw $16,28($sp) 
     .cfi_offset 17, -16 
     .cfi_offset 31, -4 
     .cfi_offset 19, -8 
     .cfi_offset 18, -12 
     --- CUT --- 
    $LASF16: 
     .ascii "__ino64_t\000" 
    $LASF86: 
     .ascii "changes\000" 
    $LASF66: 
     .ascii "__ctype_touplow_t\000" 
    $LASF200: 
     .ascii "memcmp\000" 
    $LASF118: 
     .ascii "equivs\000" 
    $LASF139: 
     .ascii "file_size\000" 
     .ident "GCC: (OpenWrt/Linaro GCC 4.8-2014.04 r49389) 4.8.3" 
     .section .note.GNU-stack,"",@progbits