You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
762 B

.section .text@comdatfunc, "x"
.linkonce discard
.globl comdatfunc
comdatfunc:
leaq .Ljumptable(%rip), %rax
movslq (%rax, %rcx, 4), %rcx
addq %rcx, %rax
jmp *%rax
.section .rdata, "dr"
.long 0xcccccccc
.Ljumptable:
.long .Ltail1-.Ljumptable
.long .Ltail2-.Ljumptable
.long .Ltail3-.Ljumptable
.long 0xdddddddd
.section .text@comdatfunc, "x"
# If assembled with binutils, the following line can be kept in:
# .linkonce discard
.Ltail1:
movl $1, %eax
ret
.Ltail2:
movl $2, %eax
ret
.Ltail3:
movl $3, %eax
ret
.text
.globl otherfunc
otherfunc:
call comdatfunc
ret