| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2139 人关注过本帖
标题:.cfi_startproc作用是什么
只看楼主 加入收藏
PopToPush
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2020-11-14
收藏
 问题点数:0 回复次数:1 
.cfi_startproc作用是什么
void *fxcg_memset(void *dest, int c, unsigned int n) {
    char* d = (char*)dest;
    while (n-- > 0) { *d++ = (char)c; }

    return dest;
}
下面是gcc生成的汇编代码:
__Z11fxcg_memsetPvij:                                                                                                                                           .LFB0:                                                                                                                                                                  .cfi_startproc                                                                                                                                                  tst     r6,r6                                                                                                                                                   bt      .L6                                                                                                                                                     sts.l   pr,@-r15                                                                                                                                                .cfi_def_cfa_offset 4                                                                                                                                           .cfi_offset 17, -4                                                                                                                                              mov.l   .L10,r0                                                                                                                                                 jsr     @r0                                                                                                                                                     exts.b  r5,r5                                                                                                                                                   lds.l   @r15+,pr                                                                                                                                                .cfi_restore 17                                                                                                                                                 .cfi_def_cfa_offset 0                                                                                                                                           rts                                                                                                                                                             nop                                                                                                                                                             .align 1                                                                                                                                                .L6:                                                                                                                                                                    rts                                                                                                                                                             mov     r4,r0                                                                                                                                           .L11:                                                                                                                                                                   .align 2                                                                                                                                                .L10:                                                                                                                                                                   .long   _memset                                                                                                                                                 .cfi_endproc                                                                                                                                            .LFE0:                                                                                                                                                                  .size   __Z11fxcg_memsetPvij, .-__Z11fxcg_memsetPvij                                                                                                            .section        .text.startup.main,"ax",@progbits                                                                                                               .align 1                                                                                                                                                        .align 2                                                                                                                                                        .global _main                                                                                                                                                   .type   _main, @function

对于汇编我并不熟悉,as汇编也缺乏资料。比如.cfi_startproc .cfi_endproc作用是什么?它们总是用在函数里
搜索更多相关主题的帖子: 汇编 align void mov char 
2020-11-14 18:54
PopToPush
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2020-11-14
收藏
得分:0 
__Z11fxcg_memsetPvij:                                                                                                                                           .LFB0:                                                                                                                                                                  .cfi_startproc                                                                                                                                                  tst     r6,r6                                                                                                                                                   bt      .L6                                                                                                                                                     sts.l   pr,@-r15                                                                                                                                                .cfi_def_cfa_offset 4                                                                                                                                           .cfi_offset 17, -4                                                                                                                                              mov.l   .L10,r0                                                                                                                                                 jsr     @r0                                                                                                                                                     exts.b  r5,r5                                                                                                                                                   lds.l   @r15+,pr                                                                                                                                                .cfi_restore 17                                                                                                                                                 .cfi_def_cfa_offset 0                                                                                                                                           rts                                                                                                                                                             nop                                                                                                                                                             .align 1                                                                                                                                                .L6:                                                                                                                                                                    rts                                                                                                                                                             mov     r4,r0                                                                                                                                           .L11:                                                                                                                                                                   .align 2                                                                                                                                                .L10:                                                                                                                                                                   .long   _memset                                                                                                                                                 .cfi_endproc                                                                                                                                            .LFE0:                                                                                                                                                                  .size   __Z11fxcg_memsetPvij, .-__Z11fxcg_memsetPvij                                                                                                            .section        .text.startup.main,"ax",@progbits                                                                                                               .align 1                                                                                                                                                        .align 2                                                                                                                                                        .global _main                                                                                                                                                   .type   _main, @function     
2020-11-14 19:02
自由而无用
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:61
专家分:1456
注 册:2021-8-9
收藏
得分:0 
.cfi_startproc is used at the beginning of each function that should have an entry in .eh_frame. It initializes some internal data structures. Don’t forget to close the function by .cfi_endproc.
2021-08-10 10:10
快速回复:.cfi_startproc作用是什么
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.066898 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved