Created
October 18, 2014 09:39
-
-
Save zonomasa/921f14b77a2546f2054b to your computer and use it in GitHub Desktop.
QEMU でARM エミュレータ環境を作成する ref: http://qiita.com/zonomasa/items/b33fba457503e166967a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install qemu-user-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install gcc-arm-linux-gnueabi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int | |
main(int argc, char *argv[]) | |
{ | |
int a = 100; | |
printf("Hello,World\n"); | |
printf("a:%d, &a:%p\n",a,&a); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ arm-linux-gnueabi-gcc sample.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ arm-linux-gnueabi-readelf -h a.out | |
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: EXEC (Executable file) | |
Machine: ARM | |
Version: 0x1 | |
Entry point address: 0x833c | |
Start of program headers: 52 (bytes into file) | |
Start of section headers: 4536 (bytes into file) | |
Flags: 0x5000202, has entry point, Version5 EABI, soft-float ABI | |
Size of this header: 52 (bytes) | |
Size of program headers: 32 (bytes) | |
Number of program headers: 9 | |
Size of section headers: 40 (bytes) | |
Number of section headers: 30 | |
Section header string table index: 27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ qemu-arm-static -L /usr/arm-linux-gnueabi a.out | |
Hello,World | |
a:100, &a:0xf6fff44c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment