update freestanding study
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
free
|
||||
*.o
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
g++ -m32 -c -o free.o free.cpp -ffreestanding && ld -m elf_i386 -o free free.o
|
||||
@@ -0,0 +1,7 @@
|
||||
extern "C" void _start() {
|
||||
asm volatile (
|
||||
"mov $1, %eax\n"
|
||||
"mov $0, %ebx\n"
|
||||
"int $0x80"
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# freestanding
|
||||
|
||||
```bash
|
||||
g++ -c -o free.o free.cpp
|
||||
ld -o free free.o
|
||||
|
||||
objdump -x free
|
||||
|
||||
# g++ -c -nostdlib -o free free.cpp
|
||||
```
|
||||
Reference in New Issue
Block a user