Guest User

Untitled

a guest
Oct 28th, 2012
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. ------------- start.c -------------
  2.  
  3. extern int main();
  4.  
  5. void _start()
  6. {
  7. // todo kommandozeilenparameter herausfinden
  8. main();
  9. // todo exit (syscall) aufrufen
  10. while (1);
  11. }
  12.  
  13.  
  14. ------------- linkerskript -------------
  15.  
  16. /* Bei _start soll die Ausfuehrung losgehen */
  17. ENTRY(_start)
  18.  
  19. OUTPUT_FORMAT(binary)
  20.  
  21. /*
  22. * Hier wird festgelegt, in welcher Reihenfolge welche Sektionen in die Binary
  23. * geschrieben werden sollen
  24. */
  25. SECTIONS
  26. {
  27. /* Das Programm wird an 2 MB geladen */
  28. . = 0x200000;
  29.  
  30. .text : {
  31. _start.o(.text)
  32. *(.text)
  33. }
  34. .data ALIGN(4096) : {
  35. *(.data)
  36. }
  37. .rodata ALIGN(4096) : {
  38. *(.rodata)
  39. }
  40. .bss ALIGN(4096) : {
  41. *(.bss)
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment