Advertisement
MichaelPetch

link.ld

May 27th, 2020
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. OUTPUT_FORMAT("elf32-i386");
  2. /* We define an entry point to keep the linker quiet. This entry point
  3. * has no meaning with a bootloader in the binary image we will eventually
  4. * generate. Bootloader will start executing at whatever is at 0x07c00 */
  5. ENTRY(start16);
  6. SECTIONS
  7. {
  8. . = 0x7C00;
  9. .text : {
  10. *(.text);
  11. }
  12.  
  13. /* Place the data after the code */
  14. .data : SUBALIGN(2) {
  15. *(.data);
  16. *(.rodata*);
  17. }
  18.  
  19. /* Place the boot signature at LMA 0x7DFE */
  20. .sig 0x7DFE : {
  21. SHORT(0xaa55);
  22. }
  23.  
  24. /* Remove sections that won't be relevant to us */
  25. /DISCARD/ : {
  26. *(.eh_frame);
  27. *(.comment);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement