[root@localhost ~]# cat .s
.file "write.s"
.section .rodata
hello: .string "hello, world!\n" .section .text
.global _start _start:
movl $, %eax # syscall number for write function
movl $, %ebx # standand for stdout
movl $hello, %ecx # the second argument of write function
movl $, %edx # the third argument of write function
int $0x80 # interrupt to call write
movl $, %eax # syscall number for sys_exit function
xorl %ebx, %ebx # the argument for sys_exit function
int $0x80 # interrupt to call sys_exit ret # return to the caller of the function

编绎:
as -o 1.o 1.s

链接:

ld -o 1 1.o

执行:

[root@localhost ~]# ./1
hello, world!

Usage: objdump <option(s)> <file(s)>
Display information from object <file(s)>.
At least one of the following switches must be given:
-a, --archive-headers Display archive header information
-f, --file-headers Display the contents of the overall file header
-p, --private-headers Display object format specific file header contents
-h, --[section-]headers Display the contents of the section headers
-x, --all-headers Display the contents of all headers
-d, --disassemble Display assembler contents of executable sections
-D, --disassemble-all Display assembler contents of all sections
-S, --source Intermix source code with disassembly
-s, --full-contents Display the full contents of all sections requested
-g, --debugging Display debug information in object file
-e, --debugging-tags Display debug information using ctags style
-G, --stabs Display (in raw form) any STABS info in the file
-W, --dwarf Display DWARF info in the file
-t, --syms Display the contents of the symbol table(s)
-T, --dynamic-syms Display the contents of the dynamic symbol table
-r, --reloc Display the relocation entries in the file
-R, --dynamic-reloc Display the dynamic relocation entries in the file
@<file> Read options from <file>
-v, --version Display this program's version number
-i, --info List object formats and architectures supported
-H, --help Display this information
[root@localhost ~]# objdump -D ./.o

./.o:     file format elf64-x86-

Disassembly of section .text:

 <_start>:
: b8 mov $0x4,%eax
: bb mov $0x1,%ebx
a: b9 mov $0x0,%ecx
f: ba 0e mov $0xe,%edx
: cd int $0x80
: b8 mov $0x1,%eax
1b: db xor %ebx,%ebx
1d: cd int $0x80
1f: c3 retq
Disassembly of section .rodata: <hello>:
: 6c 6c 6f pushq $0x6f6c6c65
: 2c sub $0x20,%al
: 6f ja <_start+0x78>
: 6c jb <_start+0x77>
b: 0a and %ecx,%fs:(%rdx)
...

http://blog.csdn.net/geekcome/article/details/6216634

最新文章

  1. SqlServer基础之(触发器)
  2. 史上最详细“截图”搭建Hexo博客——For Windows
  3. javascript向上向下取整
  4. 引水入城(codevs 1066)
  5. SQL中的事物【转】
  6. identifier not found error on function call
  7. 一句话解释JVM中空间分配担保的问题
  8. mac github工具将命令当下来的代码拖入macgithub中就可以
  9. BS4爬取糗百
  10. BZOJ 3787: Gty的文艺妹子序列 [分块 树状数组!]
  11. List转换成JSON对象报错(三)
  12. Kong(V1.0.2) Securing the Admin API
  13. Spark sql 在yarn-cluster模式下找不到表
  14. 【mmall】mybatis三剑客
  15. .NET 常用ORM之Gentle.Net
  16. zabbix 监控项(key)
  17. 【java编程】格式化字符串
  18. VirtualBox虚拟机安装ubuntu系统(图文详解)
  19. sqlserver 统计信息自动更新 ----trace flag 2371
  20. [LeetCode] Remove Element题解

热门文章

  1. java 证书体系及应用,自已做https证书
  2. android解决AVD中文路径无法启动问题
  3. 基于docker 搭建Prometheus+Grafana
  4. 基于docker 搭建Elasticsearch6.2.4(centos)
  5. Linux学习笔记:mv移动或文件重命名
  6. LanguageTag
  7. 超简单的java爬虫
  8. Java第三阶段学习(一、IO流------File类)
  9. Android应用程序签名打包(AS)
  10. kvm图形化管理工具