gnu-elf.ld 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /****************************************************************************
  2. * binfmt/libelf/gnu-elf.ld
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. SECTIONS
  21. {
  22. .text 0x00000000 :
  23. {
  24. _stext = . ;
  25. *(.text)
  26. *(.text.*)
  27. *(.gnu.warning)
  28. *(.stub)
  29. *(.glue_7)
  30. *(.glue_7t)
  31. *(.jcr)
  32. /* C++ support: The .init and .fini sections contain specific logic
  33. * to manage static constructors and destructors.
  34. */
  35. *(.gnu.linkonce.t.*)
  36. *(.init) /* Old ABI */
  37. *(.fini) /* Old ABI */
  38. _etext = . ;
  39. }
  40. .rodata :
  41. {
  42. _srodata = . ;
  43. *(.rodata)
  44. *(.rodata1)
  45. *(.rodata.*)
  46. *(.gnu.linkonce.r*)
  47. _erodata = . ;
  48. }
  49. .data :
  50. {
  51. _sdata = . ;
  52. *(.data)
  53. *(.data1)
  54. *(.data.*)
  55. *(.gnu.linkonce.d*)
  56. . = ALIGN(4);
  57. _edata = . ;
  58. }
  59. /* C++ support. For each global and static local C++ object,
  60. * GCC creates a small subroutine to construct the object. Pointers
  61. * to these routines (not the routines themselves) are stored as
  62. * simple, linear arrays in the .ctors section of the object file.
  63. * Similarly, pointers to global/static destructor routines are
  64. * stored in .dtors.
  65. */
  66. .ctors :
  67. {
  68. _sctors = . ;
  69. *(.ctors) /* Old ABI: Unallocated */
  70. *(.init_array) /* New ABI: Allocated */
  71. _ectors = . ;
  72. }
  73. .dtors :
  74. {
  75. _sdtors = . ;
  76. *(.dtors) /* Old ABI: Unallocated */
  77. *(.fini_array) /* New ABI: Allocated */
  78. _edtors = . ;
  79. }
  80. .bss :
  81. {
  82. _sbss = . ;
  83. *(.bss)
  84. *(.bss.*)
  85. *(.sbss)
  86. *(.sbss.*)
  87. *(.gnu.linkonce.b*)
  88. *(COMMON)
  89. _ebss = . ;
  90. }
  91. /* Stabs debugging sections. */
  92. .stab 0 : { *(.stab) }
  93. .stabstr 0 : { *(.stabstr) }
  94. .stab.excl 0 : { *(.stab.excl) }
  95. .stab.exclstr 0 : { *(.stab.exclstr) }
  96. .stab.index 0 : { *(.stab.index) }
  97. .stab.indexstr 0 : { *(.stab.indexstr) }
  98. .comment 0 : { *(.comment) }
  99. .debug_abbrev 0 : { *(.debug_abbrev) }
  100. .debug_info 0 : { *(.debug_info) }
  101. .debug_line 0 : { *(.debug_line) }
  102. .debug_pubnames 0 : { *(.debug_pubnames) }
  103. .debug_aranges 0 : { *(.debug_aranges) }
  104. }