小编use*_*173的帖子

编译器会将跳转表放在函数的末尾吗?

例如,这是一个带跳转表的程序集

movl    $5, -4(%ebp)
cmpl    $10, -4(%ebp)
ja  L13
movl    -4(%ebp), %eax
sall    $2, %eax
movl    L14(%eax), %eax
jmp *%eax
.section .rdata,"dr"
.align 4
L14:
.long   L13
.long   L3
.long   L4
.long   L5
.long   L6
.long   L7
.long   L8
.long   L9
.long   L10
.long   L11
.long   L12
.text
L3:
movl    $LC0, (%esp)
call    _printf
jmp L2
...
Run Code Online (Sandbox Code Playgroud)

我的问题是,像GCC或ICC这样的编译器是否可以将跳转表放在函数的末尾而不是函数的中间?

c compiler-construction x86 assembly

0
推荐指数
1
解决办法
234
查看次数

标签 统计

assembly ×1

c ×1

compiler-construction ×1

x86 ×1