+ -
当前位置:首页 → 问答吧 → ld 报undefined reference to `printf'求解决方法

ld 报undefined reference to `printf'求解决方法

时间:2011-11-14

来源:互联网

.section .data
output:
  .asciz "Tis is a section %d\n"
  .section .text
  .globl _start
_start:
  pushl $1
  pushl $output
  call printf
  add $8, %esp
  call overhere
  pushl $3
  pushl $output
  call printf
  add $8, %esp
  pushl $0
  call exit
overhere:
  pushl %ebp
  movl %esp, %ebp
  pushl $2
  pushl $output
  call printf
  add $8, %esp
  movl %ebp, %esp
  popl %ebp
  ret

作者: xljiulong   发布时间: 2011-11-14

如果是驱动,换成printk
应用程序的话#include <stdio.h>

作者: ma100   发布时间: 2011-11-14