0

アセンブリ コードを作成するために、フラグ -S を指定して mipsel-openwrt-linux-uclibc-gcc コンパイラ (Linaro GCC 4.8-2014.04 r49389) を呼び出しています。これにより、次のようなアセンブリ コードが生成されます。

        .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

これは、AT&T や Intel の構文とは思えません。より使い慣れた構文を生成するために、-masm=intel フラグを試しましたが、同じ効果が..

私の最初の考えは、生成された ASM コードが mips の固定ワード幅専用であるということでしたが、mipsel-openwrt-linux-uclibc-gcc を介して AT&T または Intel 構文を生成する方法はありますか?

ヒントをありがとう!

4

1 に答える 1