装配分段故障

5 64-bit assembly libc

我在运行以下汇编代码时遇到错误

#cpuid using C library Functions
.section .data
output:
 .asciz "The Processor Vendor ID is '%s'\n"
.section .bss
 .lcomm buffer, 12
.section .text
.globl main
main:
 movq $0, %rax
 cpuid
 movq $buffer, %rdi
 movq %rbx, (%rdi)
 movq %rdx, (%rdi)
 movq %rcx, (%rdi)
 pushq $buffer
 pushq $output
 call printf
 addq $8, %rsp
 pushq $0
 call exit
Run Code Online (Sandbox Code Playgroud)

它遇到了C库部分的分段错误调用:call printf它在x86_64模式下运行.在编译x64代码时,我错过了关于c库的任何内容?或者代码有问题

谢谢

cob*_*bal 0

不熟悉汇编,所以在黑暗中一枪:你的两个字符串都是空终止的吗?