Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------- start.c -------------
- extern int main();
- void _start()
- {
- // todo kommandozeilenparameter herausfinden
- main();
- // todo exit (syscall) aufrufen
- while (1);
- }
- ------------- linkerskript -------------
- /* Bei _start soll die Ausfuehrung losgehen */
- ENTRY(_start)
- OUTPUT_FORMAT(binary)
- /*
- * Hier wird festgelegt, in welcher Reihenfolge welche Sektionen in die Binary
- * geschrieben werden sollen
- */
- SECTIONS
- {
- /* Das Programm wird an 2 MB geladen */
- . = 0x200000;
- .text : {
- _start.o(.text)
- *(.text)
- }
- .data ALIGN(4096) : {
- *(.data)
- }
- .rodata ALIGN(4096) : {
- *(.rodata)
- }
- .bss ALIGN(4096) : {
- *(.bss)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment