Skip to content

Instantly share code, notes, and snippets.

@erincandescent
Created October 4, 2014 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erincandescent/09b058a1072e3fc19706 to your computer and use it in GitHub Desktop.
Save erincandescent/09b058a1072e3fc19706 to your computer and use it in GitHub Desktop.
oshepherd@Asuka ~/elfload
$ uname -a
CYGWIN_NT-6.1 Asuka 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
oshepherd@Asuka ~/elfload
$ cat hi.c
void _start(int (*puts)(const char *s))
{
puts("Hello, world!");
}
oshepherd@Asuka ~/elfload
$ /opt/toolchains/bin/x86_64-elf-gcc -nostdlib -fno-use-linker-plugin -pie -fPIC -o hi hi.c -mabi=ms
oshepherd@Asuka ~/elfload
$ ./elfloader hi
Loading seg fileoff 0, vaddr 0 to 0x6ffffc00000
Loading seg fileoff 288, vaddr 200288 to 0x6ffffe00288
Found rel@0, relent=0, relsz=0
Binary entrypoint is 221; invoking 0x6ffffc00221
Hello, world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment