elfxx-target.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. /* Target definitions for NN-bit ELF
  2. Copyright (C) 1993-2022 Free Software Foundation, Inc.
  3. This file is part of BFD, the Binary File Descriptor library.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. /* This structure contains everything that BFD knows about a target.
  17. It includes things like its byte order, name, what routines to call
  18. to do various operations, etc. Every BFD points to a target structure
  19. with its "xvec" member.
  20. There are two such structures here: one for big-endian machines and
  21. one for little-endian machines. */
  22. #ifndef bfd_elfNN_close_and_cleanup
  23. #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup
  24. #endif
  25. #ifndef bfd_elfNN_bfd_free_cached_info
  26. #define bfd_elfNN_bfd_free_cached_info _bfd_free_cached_info
  27. #endif
  28. #ifndef bfd_elfNN_get_section_contents
  29. #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents
  30. #endif
  31. #define bfd_elfNN_canonicalize_dynamic_symtab \
  32. _bfd_elf_canonicalize_dynamic_symtab
  33. #ifndef bfd_elfNN_get_synthetic_symtab
  34. #define bfd_elfNN_get_synthetic_symtab \
  35. _bfd_elf_get_synthetic_symtab
  36. #endif
  37. #ifndef bfd_elfNN_canonicalize_reloc
  38. #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc
  39. #endif
  40. #ifndef bfd_elfNN_set_reloc
  41. #define bfd_elfNN_set_reloc _bfd_generic_set_reloc
  42. #endif
  43. #ifndef bfd_elfNN_find_nearest_line
  44. #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line
  45. #endif
  46. #ifndef bfd_elfNN_find_line
  47. #define bfd_elfNN_find_line _bfd_elf_find_line
  48. #endif
  49. #ifndef bfd_elfNN_find_inliner_info
  50. #define bfd_elfNN_find_inliner_info _bfd_elf_find_inliner_info
  51. #endif
  52. #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols
  53. #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol
  54. #define bfd_elfNN_get_dynamic_symtab_upper_bound \
  55. _bfd_elf_get_dynamic_symtab_upper_bound
  56. #define bfd_elfNN_get_lineno _bfd_elf_get_lineno
  57. #ifndef bfd_elfNN_get_reloc_upper_bound
  58. #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound
  59. #endif
  60. #ifndef bfd_elfNN_get_symbol_info
  61. #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info
  62. #endif
  63. #ifndef bfd_elfNN_get_symbol_version_string
  64. #define bfd_elfNN_get_symbol_version_string \
  65. _bfd_elf_get_symbol_version_string
  66. #endif
  67. #define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab
  68. #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound
  69. #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol
  70. #ifndef bfd_elfNN_new_section_hook
  71. #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook
  72. #endif
  73. #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach
  74. #ifndef bfd_elfNN_set_section_contents
  75. #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents
  76. #endif
  77. #define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers
  78. #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
  79. #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
  80. #define bfd_elfNN_get_section_contents_in_window \
  81. _bfd_generic_get_section_contents_in_window
  82. #ifndef elf_backend_can_refcount
  83. #define elf_backend_can_refcount 0
  84. #endif
  85. #ifndef elf_backend_want_got_plt
  86. #define elf_backend_want_got_plt 0
  87. #endif
  88. #ifndef elf_backend_plt_readonly
  89. #define elf_backend_plt_readonly 0
  90. #endif
  91. #ifndef elf_backend_want_plt_sym
  92. #define elf_backend_want_plt_sym 0
  93. #endif
  94. #ifndef elf_backend_plt_not_loaded
  95. #define elf_backend_plt_not_loaded 0
  96. #endif
  97. #ifndef elf_backend_plt_alignment
  98. #define elf_backend_plt_alignment 2
  99. #endif
  100. #ifndef elf_backend_want_dynbss
  101. #define elf_backend_want_dynbss 1
  102. #endif
  103. #ifndef elf_backend_want_dynrelro
  104. #define elf_backend_want_dynrelro 0
  105. #endif
  106. #ifndef elf_backend_want_p_paddr_set_to_zero
  107. #define elf_backend_want_p_paddr_set_to_zero 0
  108. #endif
  109. #ifndef elf_backend_no_page_alias
  110. #define elf_backend_no_page_alias 0
  111. #endif
  112. #ifndef elf_backend_default_execstack
  113. #define elf_backend_default_execstack 1
  114. #endif
  115. #ifndef elf_backend_caches_rawsize
  116. #define elf_backend_caches_rawsize 0
  117. #endif
  118. #ifndef elf_backend_extern_protected_data
  119. #define elf_backend_extern_protected_data 0
  120. #endif
  121. #ifndef elf_backend_always_renumber_dynsyms
  122. #define elf_backend_always_renumber_dynsyms false
  123. #endif
  124. #ifndef elf_backend_linux_prpsinfo32_ugid16
  125. #define elf_backend_linux_prpsinfo32_ugid16 false
  126. #endif
  127. #ifndef elf_backend_linux_prpsinfo64_ugid16
  128. #define elf_backend_linux_prpsinfo64_ugid16 false
  129. #endif
  130. #ifndef elf_backend_stack_align
  131. #define elf_backend_stack_align 16
  132. #endif
  133. #ifndef elf_backend_strtab_flags
  134. #define elf_backend_strtab_flags 0
  135. #endif
  136. #define bfd_elfNN_bfd_debug_info_start _bfd_void_bfd
  137. #define bfd_elfNN_bfd_debug_info_end _bfd_void_bfd
  138. #define bfd_elfNN_bfd_debug_info_accumulate _bfd_void_bfd_asection
  139. #ifndef bfd_elfNN_bfd_get_relocated_section_contents
  140. #define bfd_elfNN_bfd_get_relocated_section_contents \
  141. bfd_generic_get_relocated_section_contents
  142. #endif
  143. #ifndef bfd_elfNN_bfd_relax_section
  144. #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section
  145. #endif
  146. #ifndef elf_backend_can_gc_sections
  147. #define elf_backend_can_gc_sections 0
  148. #endif
  149. #ifndef elf_backend_can_refcount
  150. #define elf_backend_can_refcount 0
  151. #endif
  152. #ifndef elf_backend_want_got_sym
  153. #define elf_backend_want_got_sym 1
  154. #endif
  155. #ifndef elf_backend_gc_keep
  156. #define elf_backend_gc_keep _bfd_elf_gc_keep
  157. #endif
  158. #ifndef elf_backend_gc_mark_dynamic_ref
  159. #define elf_backend_gc_mark_dynamic_ref bfd_elf_gc_mark_dynamic_ref_symbol
  160. #endif
  161. #ifndef elf_backend_gc_mark_hook
  162. #define elf_backend_gc_mark_hook _bfd_elf_gc_mark_hook
  163. #endif
  164. #ifndef elf_backend_gc_mark_extra_sections
  165. #define elf_backend_gc_mark_extra_sections _bfd_elf_gc_mark_extra_sections
  166. #endif
  167. #ifndef bfd_elfNN_bfd_gc_sections
  168. #define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections
  169. #endif
  170. #ifndef bfd_elfNN_bfd_merge_sections
  171. #define bfd_elfNN_bfd_merge_sections \
  172. _bfd_elf_merge_sections
  173. #endif
  174. #ifndef bfd_elfNN_bfd_is_group_section
  175. #define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section
  176. #endif
  177. #ifndef bfd_elfNN_bfd_group_name
  178. #define bfd_elfNN_bfd_group_name bfd_elf_group_name
  179. #endif
  180. #ifndef bfd_elfNN_bfd_discard_group
  181. #define bfd_elfNN_bfd_discard_group bfd_generic_discard_group
  182. #endif
  183. #ifndef bfd_elfNN_section_already_linked
  184. #define bfd_elfNN_section_already_linked \
  185. _bfd_elf_section_already_linked
  186. #endif
  187. #ifndef bfd_elfNN_bfd_define_common_symbol
  188. #define bfd_elfNN_bfd_define_common_symbol bfd_generic_define_common_symbol
  189. #endif
  190. #ifndef bfd_elfNN_bfd_link_hide_symbol
  191. #define bfd_elfNN_bfd_link_hide_symbol _bfd_elf_link_hide_symbol
  192. #endif
  193. #ifndef bfd_elfNN_bfd_lookup_section_flags
  194. #define bfd_elfNN_bfd_lookup_section_flags bfd_elf_lookup_section_flags
  195. #endif
  196. #ifndef bfd_elfNN_bfd_make_debug_symbol
  197. #define bfd_elfNN_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
  198. #endif
  199. #ifndef bfd_elfNN_bfd_copy_private_symbol_data
  200. #define bfd_elfNN_bfd_copy_private_symbol_data \
  201. _bfd_elf_copy_private_symbol_data
  202. #endif
  203. #ifndef bfd_elfNN_bfd_copy_private_section_data
  204. #define bfd_elfNN_bfd_copy_private_section_data \
  205. _bfd_elf_copy_private_section_data
  206. #endif
  207. #ifndef bfd_elfNN_bfd_copy_private_header_data
  208. #define bfd_elfNN_bfd_copy_private_header_data \
  209. _bfd_elf_copy_private_header_data
  210. #endif
  211. #ifndef bfd_elfNN_bfd_copy_private_bfd_data
  212. #define bfd_elfNN_bfd_copy_private_bfd_data \
  213. _bfd_elf_copy_private_bfd_data
  214. #endif
  215. #ifndef bfd_elfNN_bfd_print_private_bfd_data
  216. #define bfd_elfNN_bfd_print_private_bfd_data \
  217. _bfd_elf_print_private_bfd_data
  218. #endif
  219. #ifndef bfd_elfNN_bfd_merge_private_bfd_data
  220. #define bfd_elfNN_bfd_merge_private_bfd_data _bfd_bool_bfd_link_true
  221. #endif
  222. #ifndef bfd_elfNN_bfd_set_private_flags
  223. #define bfd_elfNN_bfd_set_private_flags _bfd_bool_bfd_uint_true
  224. #endif
  225. #ifndef bfd_elfNN_bfd_is_local_label_name
  226. #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
  227. #endif
  228. #ifndef bfd_elfNN_bfd_is_target_special_symbol
  229. #define bfd_elfNN_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
  230. #endif
  231. #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
  232. #define bfd_elfNN_get_dynamic_reloc_upper_bound \
  233. _bfd_elf_get_dynamic_reloc_upper_bound
  234. #endif
  235. #ifndef bfd_elfNN_canonicalize_dynamic_reloc
  236. #define bfd_elfNN_canonicalize_dynamic_reloc \
  237. _bfd_elf_canonicalize_dynamic_reloc
  238. #endif
  239. #ifdef elf_backend_relocate_section
  240. #ifndef bfd_elfNN_bfd_link_hash_table_create
  241. #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
  242. #endif
  243. #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
  244. #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
  245. _bfd_elf_copy_link_hash_symbol_type
  246. #endif
  247. #ifndef bfd_elfNN_bfd_link_add_symbols
  248. #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols
  249. #endif
  250. #ifndef bfd_elfNN_bfd_define_start_stop
  251. #define bfd_elfNN_bfd_define_start_stop bfd_elf_define_start_stop
  252. #endif
  253. #ifndef bfd_elfNN_bfd_final_link
  254. #define bfd_elfNN_bfd_final_link bfd_elf_final_link
  255. #endif
  256. #else /* ! defined (elf_backend_relocate_section) */
  257. /* If no backend relocate_section routine, use the generic linker.
  258. Note - this will prevent the port from being able to use some of
  259. the other features of the ELF linker, because the generic hash structure
  260. does not have the fields needed by the ELF linker. In particular it
  261. means that linking directly to S-records will not work. */
  262. #ifndef bfd_elfNN_bfd_link_hash_table_create
  263. #define bfd_elfNN_bfd_link_hash_table_create \
  264. _bfd_generic_link_hash_table_create
  265. #endif
  266. #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
  267. #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
  268. _bfd_generic_copy_link_hash_symbol_type
  269. #endif
  270. #ifndef bfd_elfNN_bfd_link_add_symbols
  271. #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
  272. #endif
  273. #ifndef bfd_elfNN_bfd_define_start_stop
  274. #define bfd_elfNN_bfd_define_start_stop bfd_generic_define_start_stop
  275. #endif
  276. #ifndef bfd_elfNN_bfd_final_link
  277. #define bfd_elfNN_bfd_final_link _bfd_generic_final_link
  278. #endif
  279. #endif /* ! defined (elf_backend_relocate_section) */
  280. #ifndef bfd_elfNN_bfd_link_just_syms
  281. #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms
  282. #endif
  283. #ifndef bfd_elfNN_bfd_link_split_section
  284. #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
  285. #endif
  286. #ifndef bfd_elfNN_bfd_link_check_relocs
  287. #define bfd_elfNN_bfd_link_check_relocs _bfd_elf_link_check_relocs
  288. #endif
  289. #ifndef bfd_elfNN_archive_p
  290. #define bfd_elfNN_archive_p bfd_generic_archive_p
  291. #endif
  292. #ifndef bfd_elfNN_write_archive_contents
  293. #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents
  294. #endif
  295. #ifndef bfd_elfNN_mkobject
  296. #define bfd_elfNN_mkobject bfd_elf_make_object
  297. #endif
  298. #ifndef bfd_elfNN_mkcorefile
  299. #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
  300. #endif
  301. #ifndef bfd_elfNN_mkarchive
  302. #define bfd_elfNN_mkarchive _bfd_generic_mkarchive
  303. #endif
  304. #ifndef bfd_elfNN_print_symbol
  305. #define bfd_elfNN_print_symbol bfd_elf_print_symbol
  306. #endif
  307. #ifndef elf_symbol_leading_char
  308. #define elf_symbol_leading_char 0
  309. #endif
  310. #ifndef elf_info_to_howto
  311. #define elf_info_to_howto NULL
  312. #endif
  313. #ifndef elf_info_to_howto_rel
  314. #define elf_info_to_howto_rel NULL
  315. #endif
  316. #ifndef elf_backend_arch_data
  317. #define elf_backend_arch_data NULL
  318. #endif
  319. #ifndef ELF_TARGET_ID
  320. #define ELF_TARGET_ID GENERIC_ELF_DATA
  321. #endif
  322. #ifndef ELF_TARGET_OS
  323. #define ELF_TARGET_OS is_normal
  324. #endif
  325. #ifndef ELF_OSABI
  326. #define ELF_OSABI ELFOSABI_NONE
  327. #endif
  328. #ifndef ELF_MAXPAGESIZE
  329. # error ELF_MAXPAGESIZE is not defined
  330. #define ELF_MAXPAGESIZE 1
  331. #endif
  332. #ifndef ELF_COMMONPAGESIZE
  333. #define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
  334. #endif
  335. #ifndef ELF_MINPAGESIZE
  336. #define ELF_MINPAGESIZE ELF_COMMONPAGESIZE
  337. #endif
  338. #if ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
  339. # error ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
  340. #endif
  341. #if ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
  342. # error ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
  343. #endif
  344. #ifndef ELF_P_ALIGN
  345. #define ELF_P_ALIGN 0
  346. #endif
  347. #ifndef ELF_DYNAMIC_SEC_FLAGS
  348. /* Note that we set the SEC_IN_MEMORY flag for these sections. */
  349. #define ELF_DYNAMIC_SEC_FLAGS \
  350. (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS \
  351. | SEC_IN_MEMORY | SEC_LINKER_CREATED)
  352. #endif
  353. #ifndef elf_backend_collect
  354. #define elf_backend_collect false
  355. #endif
  356. #ifndef elf_backend_type_change_ok
  357. #define elf_backend_type_change_ok false
  358. #endif
  359. #ifndef elf_backend_sym_is_global
  360. #define elf_backend_sym_is_global 0
  361. #endif
  362. #ifndef elf_backend_object_p
  363. #define elf_backend_object_p 0
  364. #endif
  365. #ifndef elf_backend_symbol_processing
  366. #define elf_backend_symbol_processing 0
  367. #endif
  368. #ifndef elf_backend_symbol_table_processing
  369. #define elf_backend_symbol_table_processing 0
  370. #endif
  371. #ifndef elf_backend_get_symbol_type
  372. #define elf_backend_get_symbol_type 0
  373. #endif
  374. #ifndef elf_backend_archive_symbol_lookup
  375. #define elf_backend_archive_symbol_lookup _bfd_elf_archive_symbol_lookup
  376. #endif
  377. #ifndef elf_backend_name_local_section_symbols
  378. #define elf_backend_name_local_section_symbols 0
  379. #endif
  380. #ifndef elf_backend_section_processing
  381. #define elf_backend_section_processing 0
  382. #endif
  383. #ifndef elf_backend_section_from_shdr
  384. #define elf_backend_section_from_shdr _bfd_elf_make_section_from_shdr
  385. #endif
  386. #ifndef elf_backend_section_flags
  387. #define elf_backend_section_flags 0
  388. #endif
  389. #ifndef elf_backend_get_sec_type_attr
  390. #define elf_backend_get_sec_type_attr _bfd_elf_get_sec_type_attr
  391. #endif
  392. #ifndef elf_backend_section_from_phdr
  393. #define elf_backend_section_from_phdr _bfd_elf_make_section_from_phdr
  394. #endif
  395. #ifndef elf_backend_fake_sections
  396. #define elf_backend_fake_sections 0
  397. #endif
  398. #ifndef elf_backend_section_from_bfd_section
  399. #define elf_backend_section_from_bfd_section 0
  400. #endif
  401. #ifndef elf_backend_add_symbol_hook
  402. #define elf_backend_add_symbol_hook 0
  403. #endif
  404. #ifndef elf_backend_link_output_symbol_hook
  405. #define elf_backend_link_output_symbol_hook 0
  406. #endif
  407. #ifndef elf_backend_create_dynamic_sections
  408. #define elf_backend_create_dynamic_sections 0
  409. #endif
  410. #ifndef elf_backend_omit_section_dynsym
  411. #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_default
  412. #endif
  413. #ifndef elf_backend_relocs_compatible
  414. #define elf_backend_relocs_compatible _bfd_elf_default_relocs_compatible
  415. #endif
  416. #ifndef elf_backend_check_relocs
  417. #define elf_backend_check_relocs 0
  418. #endif
  419. #ifndef elf_backend_size_relative_relocs
  420. #define elf_backend_size_relative_relocs 0
  421. #endif
  422. #ifndef elf_backend_finish_relative_relocs
  423. #define elf_backend_finish_relative_relocs 0
  424. #endif
  425. #ifndef elf_backend_check_directives
  426. #define elf_backend_check_directives 0
  427. #endif
  428. #ifndef elf_backend_notice_as_needed
  429. #define elf_backend_notice_as_needed _bfd_elf_notice_as_needed
  430. #endif
  431. #ifndef elf_backend_adjust_dynamic_symbol
  432. #define elf_backend_adjust_dynamic_symbol 0
  433. #endif
  434. #ifndef elf_backend_always_size_sections
  435. #define elf_backend_always_size_sections 0
  436. #endif
  437. #ifndef elf_backend_size_dynamic_sections
  438. #define elf_backend_size_dynamic_sections 0
  439. #endif
  440. #ifndef elf_backend_strip_zero_sized_dynamic_sections
  441. #define elf_backend_strip_zero_sized_dynamic_sections 0
  442. #endif
  443. #ifndef elf_backend_init_index_section
  444. #define elf_backend_init_index_section _bfd_void_bfd_link
  445. #endif
  446. #ifndef elf_backend_relocate_section
  447. #define elf_backend_relocate_section 0
  448. #endif
  449. #ifndef elf_backend_finish_dynamic_symbol
  450. #define elf_backend_finish_dynamic_symbol 0
  451. #endif
  452. #ifndef elf_backend_finish_dynamic_sections
  453. #define elf_backend_finish_dynamic_sections 0
  454. #endif
  455. #ifndef elf_backend_begin_write_processing
  456. #define elf_backend_begin_write_processing 0
  457. #endif
  458. #ifndef elf_backend_final_write_processing
  459. #define elf_backend_final_write_processing _bfd_elf_final_write_processing
  460. #endif
  461. #ifndef elf_backend_additional_program_headers
  462. #define elf_backend_additional_program_headers 0
  463. #endif
  464. #ifndef elf_backend_modify_segment_map
  465. #define elf_backend_modify_segment_map 0
  466. #endif
  467. #ifndef elf_backend_modify_headers
  468. #define elf_backend_modify_headers _bfd_elf_modify_headers
  469. #endif
  470. #ifndef elf_backend_allow_non_load_phdr
  471. #define elf_backend_allow_non_load_phdr 0
  472. #endif
  473. #ifndef elf_backend_ecoff_debug_swap
  474. #define elf_backend_ecoff_debug_swap 0
  475. #endif
  476. #ifndef elf_backend_bfd_from_remote_memory
  477. #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory
  478. #endif
  479. #ifndef elf_backend_core_find_build_id
  480. #define elf_backend_core_find_build_id _bfd_elfNN_core_find_build_id
  481. #endif
  482. #ifndef elf_backend_got_header_size
  483. #define elf_backend_got_header_size 0
  484. #endif
  485. #ifndef elf_backend_got_elt_size
  486. #define elf_backend_got_elt_size _bfd_elf_default_got_elt_size
  487. #endif
  488. #ifndef elf_backend_obj_attrs_vendor
  489. #define elf_backend_obj_attrs_vendor NULL
  490. #endif
  491. #ifndef elf_backend_obj_attrs_section
  492. #define elf_backend_obj_attrs_section NULL
  493. #endif
  494. #ifndef elf_backend_obj_attrs_arg_type
  495. #define elf_backend_obj_attrs_arg_type NULL
  496. #endif
  497. #ifndef elf_backend_obj_attrs_section_type
  498. #define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES
  499. #endif
  500. #ifndef elf_backend_obj_attrs_order
  501. #define elf_backend_obj_attrs_order NULL
  502. #endif
  503. #ifndef elf_backend_obj_attrs_handle_unknown
  504. #define elf_backend_obj_attrs_handle_unknown NULL
  505. #endif
  506. #ifndef elf_backend_parse_gnu_properties
  507. #define elf_backend_parse_gnu_properties NULL
  508. #endif
  509. #ifndef elf_backend_merge_gnu_properties
  510. #define elf_backend_merge_gnu_properties NULL
  511. #endif
  512. #ifndef elf_backend_setup_gnu_properties
  513. #define elf_backend_setup_gnu_properties _bfd_elf_link_setup_gnu_properties
  514. #endif
  515. #ifndef elf_backend_fixup_gnu_properties
  516. #define elf_backend_fixup_gnu_properties NULL
  517. #endif
  518. #ifndef elf_backend_static_tls_alignment
  519. #define elf_backend_static_tls_alignment 1
  520. #endif
  521. #ifndef elf_backend_init_file_header
  522. #define elf_backend_init_file_header _bfd_elf_init_file_header
  523. #endif
  524. #ifndef elf_backend_print_symbol_all
  525. #define elf_backend_print_symbol_all NULL
  526. #endif
  527. #ifndef elf_backend_output_arch_local_syms
  528. #define elf_backend_output_arch_local_syms NULL
  529. #endif
  530. #ifndef elf_backend_output_arch_syms
  531. #define elf_backend_output_arch_syms NULL
  532. #endif
  533. #ifndef elf_backend_filter_implib_symbols
  534. #define elf_backend_filter_implib_symbols NULL
  535. #endif
  536. #ifndef elf_backend_copy_indirect_symbol
  537. #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
  538. #endif
  539. #ifndef elf_backend_hide_symbol
  540. #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
  541. #endif
  542. #ifndef elf_backend_fixup_symbol
  543. #define elf_backend_fixup_symbol NULL
  544. #endif
  545. #ifndef elf_backend_merge_symbol_attribute
  546. #define elf_backend_merge_symbol_attribute NULL
  547. #endif
  548. #ifndef elf_backend_get_target_dtag
  549. #define elf_backend_get_target_dtag NULL
  550. #endif
  551. #ifndef elf_backend_ignore_undef_symbol
  552. #define elf_backend_ignore_undef_symbol NULL
  553. #endif
  554. #ifndef elf_backend_emit_relocs
  555. #define elf_backend_emit_relocs _bfd_elf_link_output_relocs
  556. #endif
  557. #ifndef elf_backend_update_relocs
  558. #define elf_backend_update_relocs NULL
  559. #endif
  560. #ifndef elf_backend_count_relocs
  561. #define elf_backend_count_relocs NULL
  562. #endif
  563. #ifndef elf_backend_count_additional_relocs
  564. #define elf_backend_count_additional_relocs NULL
  565. #endif
  566. #ifndef elf_backend_sort_relocs_p
  567. #define elf_backend_sort_relocs_p NULL
  568. #endif
  569. #ifndef elf_backend_grok_prstatus
  570. #define elf_backend_grok_prstatus NULL
  571. #endif
  572. #ifndef elf_backend_grok_psinfo
  573. #define elf_backend_grok_psinfo NULL
  574. #endif
  575. #ifndef elf_backend_grok_freebsd_prstatus
  576. #define elf_backend_grok_freebsd_prstatus NULL
  577. #endif
  578. #ifndef elf_backend_write_core_note
  579. #define elf_backend_write_core_note NULL
  580. #endif
  581. #ifndef elf_backend_lookup_section_flags_hook
  582. #define elf_backend_lookup_section_flags_hook NULL
  583. #endif
  584. #ifndef elf_backend_reloc_type_class
  585. #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class
  586. #endif
  587. #ifndef elf_backend_discard_info
  588. #define elf_backend_discard_info NULL
  589. #endif
  590. #ifndef elf_backend_ignore_discarded_relocs
  591. #define elf_backend_ignore_discarded_relocs NULL
  592. #endif
  593. #ifndef elf_backend_action_discarded
  594. #define elf_backend_action_discarded _bfd_elf_default_action_discarded
  595. #endif
  596. #ifndef elf_backend_eh_frame_address_size
  597. #define elf_backend_eh_frame_address_size _bfd_elf_eh_frame_address_size
  598. #endif
  599. #ifndef elf_backend_can_make_relative_eh_frame
  600. #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative
  601. #endif
  602. #ifndef elf_backend_can_make_lsda_relative_eh_frame
  603. #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative
  604. #endif
  605. #ifndef elf_backend_encode_eh_address
  606. #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address
  607. #endif
  608. #ifndef elf_backend_write_section
  609. #define elf_backend_write_section NULL
  610. #endif
  611. #ifndef elf_backend_elfsym_local_is_section
  612. #define elf_backend_elfsym_local_is_section NULL
  613. #endif
  614. #ifndef elf_backend_mips_irix_compat
  615. #define elf_backend_mips_irix_compat NULL
  616. #endif
  617. #ifndef elf_backend_mips_rtype_to_howto
  618. #define elf_backend_mips_rtype_to_howto NULL
  619. #endif
  620. /* Previously, backends could only use SHT_REL or SHT_RELA relocation
  621. sections, but not both. They defined USE_REL to indicate SHT_REL
  622. sections, and left it undefined to indicated SHT_RELA sections.
  623. For backwards compatibility, we still support this usage. */
  624. #ifndef USE_REL
  625. #define USE_REL 0
  626. #endif
  627. /* Use these in new code. */
  628. #ifndef elf_backend_may_use_rel_p
  629. #define elf_backend_may_use_rel_p USE_REL
  630. #endif
  631. #ifndef elf_backend_may_use_rela_p
  632. #define elf_backend_may_use_rela_p !USE_REL
  633. #endif
  634. #ifndef elf_backend_default_use_rela_p
  635. #define elf_backend_default_use_rela_p !USE_REL
  636. #endif
  637. #ifndef elf_backend_rela_plts_and_copies_p
  638. #define elf_backend_rela_plts_and_copies_p elf_backend_default_use_rela_p
  639. #endif
  640. #ifndef elf_backend_rela_normal
  641. #define elf_backend_rela_normal 0
  642. #endif
  643. #ifndef elf_backend_dtrel_excludes_plt
  644. #define elf_backend_dtrel_excludes_plt 0
  645. #endif
  646. #ifndef elf_backend_plt_sym_val
  647. #define elf_backend_plt_sym_val NULL
  648. #endif
  649. #ifndef elf_backend_relplt_name
  650. #define elf_backend_relplt_name NULL
  651. #endif
  652. #ifndef ELF_MACHINE_ALT1
  653. #define ELF_MACHINE_ALT1 0
  654. #endif
  655. #ifndef ELF_MACHINE_ALT2
  656. #define ELF_MACHINE_ALT2 0
  657. #endif
  658. #ifndef elf_backend_size_info
  659. #define elf_backend_size_info _bfd_elfNN_size_info
  660. #endif
  661. #ifndef elf_backend_special_sections
  662. #define elf_backend_special_sections NULL
  663. #endif
  664. #ifndef elf_backend_sign_extend_vma
  665. #define elf_backend_sign_extend_vma 0
  666. #endif
  667. #ifndef elf_backend_link_order_error_handler
  668. #define elf_backend_link_order_error_handler _bfd_error_handler
  669. #endif
  670. #ifndef elf_backend_common_definition
  671. #define elf_backend_common_definition _bfd_elf_common_definition
  672. #endif
  673. #ifndef elf_backend_common_section_index
  674. #define elf_backend_common_section_index _bfd_elf_common_section_index
  675. #endif
  676. #ifndef elf_backend_common_section
  677. #define elf_backend_common_section _bfd_elf_common_section
  678. #endif
  679. #ifndef elf_backend_merge_symbol
  680. #define elf_backend_merge_symbol NULL
  681. #endif
  682. #ifndef elf_backend_hash_symbol
  683. #define elf_backend_hash_symbol _bfd_elf_hash_symbol
  684. #endif
  685. #ifndef elf_backend_record_xhash_symbol
  686. #define elf_backend_record_xhash_symbol NULL
  687. #endif
  688. #ifndef elf_backend_is_function_type
  689. #define elf_backend_is_function_type _bfd_elf_is_function_type
  690. #endif
  691. #ifndef elf_backend_maybe_function_sym
  692. #define elf_backend_maybe_function_sym _bfd_elf_maybe_function_sym
  693. #endif
  694. #ifndef elf_backend_get_reloc_section
  695. #define elf_backend_get_reloc_section _bfd_elf_plt_get_reloc_section
  696. #endif
  697. #ifndef elf_backend_copy_special_section_fields
  698. #define elf_backend_copy_special_section_fields _bfd_elf_copy_special_section_fields
  699. #endif
  700. #ifndef elf_backend_compact_eh_encoding
  701. #define elf_backend_compact_eh_encoding NULL
  702. #endif
  703. #ifndef elf_backend_cant_unwind_opcode
  704. #define elf_backend_cant_unwind_opcode NULL
  705. #endif
  706. #ifndef elf_backend_init_secondary_reloc_section
  707. #define elf_backend_init_secondary_reloc_section _bfd_elf_init_secondary_reloc_section
  708. #endif
  709. #ifndef elf_backend_slurp_secondary_reloc_section
  710. #define elf_backend_slurp_secondary_reloc_section _bfd_elf_slurp_secondary_reloc_section
  711. #endif
  712. #ifndef elf_backend_write_secondary_reloc_section
  713. #define elf_backend_write_secondary_reloc_section _bfd_elf_write_secondary_reloc_section
  714. #endif
  715. #ifndef elf_backend_symbol_section_index
  716. #define elf_backend_symbol_section_index NULL
  717. #endif
  718. #ifndef elf_match_priority
  719. #define elf_match_priority \
  720. (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0)
  721. #endif
  722. extern const struct elf_size_info _bfd_elfNN_size_info;
  723. static const struct elf_backend_data elfNN_bed =
  724. {
  725. ELF_ARCH, /* arch */
  726. ELF_TARGET_ID, /* target_id */
  727. ELF_TARGET_OS, /* target_os */
  728. ELF_MACHINE_CODE, /* elf_machine_code */
  729. ELF_OSABI, /* elf_osabi */
  730. ELF_MAXPAGESIZE, /* maxpagesize */
  731. ELF_MINPAGESIZE, /* minpagesize */
  732. ELF_COMMONPAGESIZE, /* commonpagesize */
  733. ELF_P_ALIGN, /* p_align */
  734. ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */
  735. elf_backend_arch_data,
  736. elf_info_to_howto,
  737. elf_info_to_howto_rel,
  738. elf_backend_sym_is_global,
  739. elf_backend_object_p,
  740. elf_backend_symbol_processing,
  741. elf_backend_symbol_table_processing,
  742. elf_backend_get_symbol_type,
  743. elf_backend_archive_symbol_lookup,
  744. elf_backend_name_local_section_symbols,
  745. elf_backend_section_processing,
  746. elf_backend_section_from_shdr,
  747. elf_backend_section_flags,
  748. elf_backend_get_sec_type_attr,
  749. elf_backend_section_from_phdr,
  750. elf_backend_fake_sections,
  751. elf_backend_section_from_bfd_section,
  752. elf_backend_add_symbol_hook,
  753. elf_backend_link_output_symbol_hook,
  754. elf_backend_create_dynamic_sections,
  755. elf_backend_omit_section_dynsym,
  756. elf_backend_relocs_compatible,
  757. elf_backend_check_relocs,
  758. elf_backend_size_relative_relocs,
  759. elf_backend_finish_relative_relocs,
  760. elf_backend_check_directives,
  761. elf_backend_notice_as_needed,
  762. elf_backend_adjust_dynamic_symbol,
  763. elf_backend_always_size_sections,
  764. elf_backend_size_dynamic_sections,
  765. elf_backend_strip_zero_sized_dynamic_sections,
  766. elf_backend_init_index_section,
  767. elf_backend_relocate_section,
  768. elf_backend_finish_dynamic_symbol,
  769. elf_backend_finish_dynamic_sections,
  770. elf_backend_begin_write_processing,
  771. elf_backend_final_write_processing,
  772. elf_backend_additional_program_headers,
  773. elf_backend_modify_segment_map,
  774. elf_backend_modify_headers,
  775. elf_backend_allow_non_load_phdr,
  776. elf_backend_gc_keep,
  777. elf_backend_gc_mark_dynamic_ref,
  778. elf_backend_gc_mark_hook,
  779. elf_backend_gc_mark_extra_sections,
  780. elf_backend_init_file_header,
  781. elf_backend_print_symbol_all,
  782. elf_backend_output_arch_local_syms,
  783. elf_backend_output_arch_syms,
  784. elf_backend_filter_implib_symbols,
  785. elf_backend_copy_indirect_symbol,
  786. elf_backend_hide_symbol,
  787. elf_backend_fixup_symbol,
  788. elf_backend_merge_symbol_attribute,
  789. elf_backend_get_target_dtag,
  790. elf_backend_ignore_undef_symbol,
  791. elf_backend_emit_relocs,
  792. elf_backend_update_relocs,
  793. elf_backend_count_relocs,
  794. elf_backend_count_additional_relocs,
  795. elf_backend_sort_relocs_p,
  796. elf_backend_grok_prstatus,
  797. elf_backend_grok_psinfo,
  798. elf_backend_grok_freebsd_prstatus,
  799. elf_backend_write_core_note,
  800. elf_backend_lookup_section_flags_hook,
  801. elf_backend_reloc_type_class,
  802. elf_backend_discard_info,
  803. elf_backend_ignore_discarded_relocs,
  804. elf_backend_action_discarded,
  805. elf_backend_eh_frame_address_size,
  806. elf_backend_can_make_relative_eh_frame,
  807. elf_backend_can_make_lsda_relative_eh_frame,
  808. elf_backend_encode_eh_address,
  809. elf_backend_write_section,
  810. elf_backend_elfsym_local_is_section,
  811. elf_backend_mips_irix_compat,
  812. elf_backend_mips_rtype_to_howto,
  813. elf_backend_ecoff_debug_swap,
  814. elf_backend_bfd_from_remote_memory,
  815. elf_backend_core_find_build_id,
  816. elf_backend_plt_sym_val,
  817. elf_backend_common_definition,
  818. elf_backend_common_section_index,
  819. elf_backend_common_section,
  820. elf_backend_merge_symbol,
  821. elf_backend_hash_symbol,
  822. elf_backend_record_xhash_symbol,
  823. elf_backend_is_function_type,
  824. elf_backend_maybe_function_sym,
  825. elf_backend_get_reloc_section,
  826. elf_backend_copy_special_section_fields,
  827. elf_backend_link_order_error_handler,
  828. elf_backend_relplt_name,
  829. ELF_MACHINE_ALT1,
  830. ELF_MACHINE_ALT2,
  831. &elf_backend_size_info,
  832. elf_backend_special_sections,
  833. elf_backend_got_header_size,
  834. elf_backend_got_elt_size,
  835. elf_backend_obj_attrs_vendor,
  836. elf_backend_obj_attrs_section,
  837. elf_backend_obj_attrs_arg_type,
  838. elf_backend_obj_attrs_section_type,
  839. elf_backend_obj_attrs_order,
  840. elf_backend_obj_attrs_handle_unknown,
  841. elf_backend_parse_gnu_properties,
  842. elf_backend_merge_gnu_properties,
  843. elf_backend_setup_gnu_properties,
  844. elf_backend_fixup_gnu_properties,
  845. elf_backend_compact_eh_encoding,
  846. elf_backend_cant_unwind_opcode,
  847. elf_backend_symbol_section_index,
  848. elf_backend_init_secondary_reloc_section,
  849. elf_backend_slurp_secondary_reloc_section,
  850. elf_backend_write_secondary_reloc_section,
  851. elf_backend_static_tls_alignment,
  852. elf_backend_stack_align,
  853. elf_backend_strtab_flags,
  854. elf_backend_collect,
  855. elf_backend_type_change_ok,
  856. elf_backend_may_use_rel_p,
  857. elf_backend_may_use_rela_p,
  858. elf_backend_default_use_rela_p,
  859. elf_backend_rela_plts_and_copies_p,
  860. elf_backend_rela_normal,
  861. elf_backend_dtrel_excludes_plt,
  862. elf_backend_sign_extend_vma,
  863. elf_backend_want_got_plt,
  864. elf_backend_plt_readonly,
  865. elf_backend_want_plt_sym,
  866. elf_backend_plt_not_loaded,
  867. elf_backend_plt_alignment,
  868. elf_backend_can_gc_sections,
  869. elf_backend_can_refcount,
  870. elf_backend_want_got_sym,
  871. elf_backend_want_dynbss,
  872. elf_backend_want_dynrelro,
  873. elf_backend_want_p_paddr_set_to_zero,
  874. elf_backend_no_page_alias,
  875. elf_backend_default_execstack,
  876. elf_backend_caches_rawsize,
  877. elf_backend_extern_protected_data,
  878. elf_backend_always_renumber_dynsyms,
  879. elf_backend_linux_prpsinfo32_ugid16,
  880. elf_backend_linux_prpsinfo64_ugid16
  881. };
  882. /* Forward declaration for use when initialising alternative_target field. */
  883. #ifdef TARGET_LITTLE_SYM
  884. extern const bfd_target TARGET_LITTLE_SYM;
  885. #endif
  886. #ifdef TARGET_BIG_SYM
  887. const bfd_target TARGET_BIG_SYM =
  888. {
  889. /* name: identify kind of target */
  890. TARGET_BIG_NAME,
  891. /* flavour: general indication about file */
  892. bfd_target_elf_flavour,
  893. /* byteorder: data is big endian */
  894. BFD_ENDIAN_BIG,
  895. /* header_byteorder: header is also big endian */
  896. BFD_ENDIAN_BIG,
  897. /* object_flags: mask of all file flags */
  898. (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
  899. | DYNAMIC | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS
  900. | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON),
  901. /* section_flags: mask of all section flags */
  902. (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
  903. | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
  904. | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
  905. /* leading_symbol_char: is the first char of a user symbol
  906. predictable, and if so what is it */
  907. elf_symbol_leading_char,
  908. /* ar_pad_char: pad character for filenames within an archive header
  909. FIXME: this really has nothing to do with ELF, this is a characteristic
  910. of the archiver and/or os and should be independently tunable */
  911. '/',
  912. /* ar_max_namelen: maximum number of characters in an archive header
  913. FIXME: this really has nothing to do with ELF, this is a characteristic
  914. of the archiver and should be independently tunable. The System V ABI,
  915. Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
  916. 15,
  917. elf_match_priority,
  918. /* TRUE if unused section symbols should be kept. */
  919. TARGET_KEEP_UNUSED_SECTION_SYMBOLS,
  920. /* Routines to byte-swap various sized integers from the data sections */
  921. bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  922. bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  923. bfd_getb16, bfd_getb_signed_16, bfd_putb16,
  924. /* Routines to byte-swap various sized integers from the file headers */
  925. bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  926. bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  927. bfd_getb16, bfd_getb_signed_16, bfd_putb16,
  928. /* bfd_check_format: check the format of a file being read */
  929. { _bfd_dummy_target, /* unknown format */
  930. bfd_elfNN_object_p, /* assembler/linker output (object file) */
  931. bfd_elfNN_archive_p, /* an archive */
  932. bfd_elfNN_core_file_p /* a core file */
  933. },
  934. /* bfd_set_format: set the format of a file being written */
  935. { _bfd_bool_bfd_false_error,
  936. bfd_elfNN_mkobject,
  937. bfd_elfNN_mkarchive,
  938. bfd_elfNN_mkcorefile
  939. },
  940. /* bfd_write_contents: write cached information into a file being written */
  941. { _bfd_bool_bfd_false_error,
  942. bfd_elfNN_write_object_contents,
  943. bfd_elfNN_write_archive_contents,
  944. bfd_elfNN_write_corefile_contents,
  945. },
  946. BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
  947. BFD_JUMP_TABLE_COPY (bfd_elfNN),
  948. BFD_JUMP_TABLE_CORE (bfd_elfNN),
  949. #ifdef bfd_elfNN_archive_functions
  950. BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive),
  951. #elif defined USE_64_BIT_ARCHIVE
  952. BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit),
  953. #else
  954. BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
  955. #endif
  956. BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN),
  957. BFD_JUMP_TABLE_RELOCS (bfd_elfNN),
  958. BFD_JUMP_TABLE_WRITE (bfd_elfNN),
  959. BFD_JUMP_TABLE_LINK (bfd_elfNN),
  960. BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
  961. /* Alternative endian target. */
  962. #ifdef TARGET_LITTLE_SYM
  963. & TARGET_LITTLE_SYM,
  964. #else
  965. NULL,
  966. #endif
  967. /* backend_data: */
  968. &elfNN_bed
  969. };
  970. #endif
  971. #ifdef TARGET_LITTLE_SYM
  972. const bfd_target TARGET_LITTLE_SYM =
  973. {
  974. /* name: identify kind of target */
  975. TARGET_LITTLE_NAME,
  976. /* flavour: general indication about file */
  977. bfd_target_elf_flavour,
  978. /* byteorder: data is little endian */
  979. BFD_ENDIAN_LITTLE,
  980. /* header_byteorder: header is also little endian */
  981. BFD_ENDIAN_LITTLE,
  982. /* object_flags: mask of all file flags */
  983. (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
  984. | DYNAMIC | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS
  985. | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON),
  986. /* section_flags: mask of all section flags */
  987. (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
  988. | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
  989. | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
  990. /* leading_symbol_char: is the first char of a user symbol
  991. predictable, and if so what is it */
  992. elf_symbol_leading_char,
  993. /* ar_pad_char: pad character for filenames within an archive header
  994. FIXME: this really has nothing to do with ELF, this is a characteristic
  995. of the archiver and/or os and should be independently tunable */
  996. '/',
  997. /* ar_max_namelen: maximum number of characters in an archive header
  998. FIXME: this really has nothing to do with ELF, this is a characteristic
  999. of the archiver and should be independently tunable. The System V ABI,
  1000. Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
  1001. 15,
  1002. elf_match_priority,
  1003. /* TRUE if unused section symbols should be kept. */
  1004. TARGET_KEEP_UNUSED_SECTION_SYMBOLS,
  1005. /* Routines to byte-swap various sized integers from the data sections */
  1006. bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  1007. bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  1008. bfd_getl16, bfd_getl_signed_16, bfd_putl16,
  1009. /* Routines to byte-swap various sized integers from the file headers */
  1010. bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  1011. bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  1012. bfd_getl16, bfd_getl_signed_16, bfd_putl16,
  1013. /* bfd_check_format: check the format of a file being read */
  1014. { _bfd_dummy_target, /* unknown format */
  1015. bfd_elfNN_object_p, /* assembler/linker output (object file) */
  1016. bfd_elfNN_archive_p, /* an archive */
  1017. bfd_elfNN_core_file_p /* a core file */
  1018. },
  1019. /* bfd_set_format: set the format of a file being written */
  1020. { _bfd_bool_bfd_false_error,
  1021. bfd_elfNN_mkobject,
  1022. bfd_elfNN_mkarchive,
  1023. bfd_elfNN_mkcorefile
  1024. },
  1025. /* bfd_write_contents: write cached information into a file being written */
  1026. { _bfd_bool_bfd_false_error,
  1027. bfd_elfNN_write_object_contents,
  1028. bfd_elfNN_write_archive_contents,
  1029. bfd_elfNN_write_corefile_contents,
  1030. },
  1031. BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
  1032. BFD_JUMP_TABLE_COPY (bfd_elfNN),
  1033. BFD_JUMP_TABLE_CORE (bfd_elfNN),
  1034. #ifdef bfd_elfNN_archive_functions
  1035. BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive),
  1036. #elif defined USE_64_BIT_ARCHIVE
  1037. BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit),
  1038. #else
  1039. BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
  1040. #endif
  1041. BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN),
  1042. BFD_JUMP_TABLE_RELOCS (bfd_elfNN),
  1043. BFD_JUMP_TABLE_WRITE (bfd_elfNN),
  1044. BFD_JUMP_TABLE_LINK (bfd_elfNN),
  1045. BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
  1046. /* Alternative endian target. */
  1047. #ifdef TARGET_BIG_SYM
  1048. & TARGET_BIG_SYM,
  1049. #else
  1050. NULL,
  1051. #endif
  1052. /* backend_data: */
  1053. &elfNN_bed
  1054. };
  1055. #endif