You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linux.lds 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* -*- sh -*- */
  2. /*
  3. * Linker script for i386 Linux images
  4. *
  5. */
  6. OUTPUT_FORMAT ( "elf32-i386", "elf32-i386", "elf32-i386" )
  7. OUTPUT_ARCH ( i386 )
  8. SECTIONS {
  9. _max_align = 32;
  10. . = 0x08048000;
  11. /*
  12. * The text section
  13. *
  14. */
  15. . = ALIGN ( _max_align );
  16. .text : {
  17. _text = .;
  18. *(.text)
  19. *(.text.*)
  20. _etext = .;
  21. }
  22. /*
  23. * The rodata section
  24. *
  25. */
  26. . = ALIGN ( _max_align );
  27. .rodata : {
  28. _rodata = .;
  29. *(.rodata)
  30. *(.rodata.*)
  31. _erodata = .;
  32. }
  33. /*
  34. * The data section
  35. *
  36. */
  37. . = ALIGN ( _max_align );
  38. .data : {
  39. _data = .;
  40. *(.data)
  41. *(.data.*)
  42. KEEP(*(SORT(.tbl.*)))
  43. _edata = .;
  44. }
  45. /*
  46. * The bss section
  47. *
  48. */
  49. . = ALIGN ( _max_align );
  50. .bss : {
  51. _bss = .;
  52. *(.bss)
  53. *(.bss.*)
  54. *(COMMON)
  55. _ebss = .;
  56. }
  57. /*
  58. * Weak symbols that need zero values if not otherwise defined
  59. *
  60. */
  61. .weak 0x0 : {
  62. _weak = .;
  63. *(.weak)
  64. *(.weak.*)
  65. _eweak = .;
  66. }
  67. _assert = ASSERT ( ( _weak == _eweak ), ".weak is non-zero length" );
  68. /*
  69. * Dispose of the comment and note sections to make the link map
  70. * easier to read
  71. *
  72. */
  73. /DISCARD/ : {
  74. *(.comment)
  75. *(.comment.*)
  76. *(.note)
  77. *(.note.*)
  78. *(.eh_frame)
  79. *(.eh_frame.*)
  80. *(.rel)
  81. *(.rel.*)
  82. *(.discard)
  83. *(.discard.*)
  84. }
  85. }