setup.ld 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * setup.ld
  3. *
  4. * Linker script for the i386 setup code
  5. */
  6. OUTPUT_FORMAT("elf32-i386")
  7. OUTPUT_ARCH(i386)
  8. ENTRY(_start)
  9. SECTIONS
  10. {
  11. . = 0;
  12. .bstext : {
  13. *(.bstext)
  14. . = 495;
  15. } =0xffffffff
  16. .header : { *(.header) }
  17. .entrytext : { *(.entrytext) }
  18. .inittext : { *(.inittext) }
  19. .initdata : { *(.initdata) }
  20. __end_init = .;
  21. .text : { *(.text .text.*) }
  22. .text32 : { *(.text32) }
  23. .pecompat : { *(.pecompat) }
  24. PROVIDE(pecompat_fsize = setup_size - pecompat_fstart);
  25. . = ALIGN(16);
  26. .rodata : { *(.rodata*) }
  27. .videocards : {
  28. video_cards = .;
  29. *(.videocards)
  30. video_cards_end = .;
  31. }
  32. . = ALIGN(16);
  33. .data : { *(.data*) }
  34. .signature : {
  35. setup_sig = .;
  36. LONG(0x5a5aaa55)
  37. setup_size = ALIGN(ABSOLUTE(.), 4096);
  38. setup_sects = ABSOLUTE(setup_size / 512);
  39. }
  40. . = ALIGN(16);
  41. .bss :
  42. {
  43. __bss_start = .;
  44. *(.bss)
  45. __bss_end = .;
  46. }
  47. . = ALIGN(16);
  48. _end = .;
  49. /DISCARD/ : {
  50. *(.note*)
  51. }
  52. /*
  53. * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility:
  54. */
  55. . = ASSERT(_end <= 0x8000, "Setup too big!");
  56. . = ASSERT(hdr == 0x1f1, "The setup header has the wrong offset!");
  57. /* Necessary for the very-old-loader check to work... */
  58. . = ASSERT(__end_init <= 5*512, "init sections too big!");
  59. }