Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1690418
  • 博文数量: 410
  • 博客积分: 9563
  • 博客等级: 中将
  • 技术积分: 4517
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-03 19:59
个人简介

文章分类

全部博文(410)

文章存档

2017年(6)

2016年(1)

2015年(3)

2014年(4)

2013年(32)

2012年(45)

2011年(179)

2010年(140)

分类: LINUX

2010-08-22 16:24:03

首先需要安装32位的兼容库

apt-get install ia32-libs libc6-dev-i386 linux32


一、概述:
汇编 as -32
链接 ld –m elf_i386
编译 gcc -m32

二、汇编语言

.section .data

.section .test
.globl _start
_start:
movl $1, %eax
movl $4, %ebx
int $0x80


 as -32 hello.s -o hello.o
 readelf -h hello.o
结果显示
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          116 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         8
  Section header string table index: 5
阅读(1602) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~