rvos 3编译与链接

做下面的两个练习需要:

  • 在vmvb上装一个ubuntu
  • 会gcc、vi的基本使用

  1. 用vi写一个hello.c
  2. gcc -o hello.c
  3. readelf -h hello.o
  4. readelf -S hello.o
  5. objdump -S hello.o

 

  1. 用vi编辑一个test.c
  2. gcc -c test.c
  3. readelf -S test.o.text:代码       .data:初始化的全局变量和静态变量       .bss:未初始化的全局变量和静态变量       .rodata:只读数据
  4. readelf -x .test test.o
  5. readelf -x .data test.o
  6. readelf -x .bss test.o
  7. readelf -x .rodata test.o