aout-tic30.c 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. /* BFD back-end for TMS320C30 a.out binaries.
  2. Copyright (C) 1998-2015 Free Software Foundation, Inc.
  3. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  16. 02110-1301, USA. */
  17. #define TARGET_IS_BIG_ENDIAN_P
  18. #define N_HEADER_IN_TEXT(x) 1
  19. #define TEXT_START_ADDR 1024
  20. #define TARGET_PAGE_SIZE 128
  21. #define SEGMENT_SIZE TARGET_PAGE_SIZE
  22. #define DEFAULT_ARCH bfd_arch_tic30
  23. #define ARCH_SIZE 32
  24. /* Do not "beautify" the CONCAT* macro args. Traditional C will not
  25. remove whitespace added here, and thus will fail to concatenate
  26. the tokens. */
  27. #define MY(OP) CONCAT2 (tic30_aout_,OP)
  28. #define TARGETNAME "a.out-tic30"
  29. #define NAME(x,y) CONCAT3 (tic30_aout,_32_,y)
  30. #include "sysdep.h"
  31. #include "bfd.h"
  32. #include "libaout.h"
  33. #include "aout/aout64.h"
  34. #include "aout/stab_gnu.h"
  35. #include "aout/ar.h"
  36. #define MY_reloc_howto(BFD, REL, IN, EX, PC) tic30_aout_reloc_howto (BFD, REL, & IN, & EX, & PC)
  37. #define MY_final_link_relocate tic30_aout_final_link_relocate
  38. #define MY_object_p tic30_aout_object_p
  39. #define MY_mkobject NAME (aout,mkobject)
  40. #define MY_write_object_contents tic30_aout_write_object_contents
  41. #define MY_set_sizes tic30_aout_set_sizes
  42. #ifndef MY_exec_hdr_flags
  43. #define MY_exec_hdr_flags 1
  44. #endif
  45. #ifndef MY_backend_data
  46. #ifndef MY_zmagic_contiguous
  47. #define MY_zmagic_contiguous 0
  48. #endif
  49. #ifndef MY_text_includes_header
  50. #define MY_text_includes_header 0
  51. #endif
  52. #ifndef MY_entry_is_text_address
  53. #define MY_entry_is_text_address 0
  54. #endif
  55. #ifndef MY_exec_header_not_counted
  56. #define MY_exec_header_not_counted 1
  57. #endif
  58. #ifndef MY_add_dynamic_symbols
  59. #define MY_add_dynamic_symbols 0
  60. #endif
  61. #ifndef MY_add_one_symbol
  62. #define MY_add_one_symbol 0
  63. #endif
  64. #ifndef MY_link_dynamic_object
  65. #define MY_link_dynamic_object 0
  66. #endif
  67. #ifndef MY_write_dynamic_symbol
  68. #define MY_write_dynamic_symbol 0
  69. #endif
  70. #ifndef MY_check_dynamic_reloc
  71. #define MY_check_dynamic_reloc 0
  72. #endif
  73. #ifndef MY_finish_dynamic_link
  74. #define MY_finish_dynamic_link 0
  75. #endif
  76. static bfd_boolean
  77. tic30_aout_set_sizes (bfd *abfd)
  78. {
  79. adata (abfd).page_size = TARGET_PAGE_SIZE;
  80. #ifdef SEGMENT_SIZE
  81. adata (abfd).segment_size = SEGMENT_SIZE;
  82. #else
  83. adata (abfd).segment_size = TARGET_PAGE_SIZE;
  84. #endif
  85. #ifdef ZMAGIC_DISK_BLOCK_SIZE
  86. adata (abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
  87. #else
  88. adata (abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
  89. #endif
  90. adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
  91. return TRUE;
  92. }
  93. static const struct aout_backend_data tic30_aout_backend_data =
  94. {
  95. MY_zmagic_contiguous,
  96. MY_text_includes_header,
  97. MY_entry_is_text_address,
  98. MY_exec_hdr_flags,
  99. 0, /* Text vma? */
  100. MY_set_sizes,
  101. MY_exec_header_not_counted,
  102. MY_add_dynamic_symbols,
  103. MY_add_one_symbol,
  104. MY_link_dynamic_object,
  105. MY_write_dynamic_symbol,
  106. MY_check_dynamic_reloc,
  107. MY_finish_dynamic_link
  108. };
  109. #define MY_backend_data &tic30_aout_backend_data
  110. #endif
  111. static reloc_howto_type *
  112. tic30_aout_reloc_howto (bfd *, struct reloc_std_external *, int *, int *, int *);
  113. static bfd_reloc_status_type
  114. tic30_aout_final_link_relocate
  115. (reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma, bfd_vma, bfd_vma);
  116. /* FIXME: This is wrong. aoutx.h should really only be included by
  117. aout32.c. */
  118. #include "aoutx.h"
  119. /* This function is used to work out pc-relative offsets for the
  120. TMS320C30. The data already placed by md_pcrel_from within gas is
  121. useless for a relocation, so we just get the offset value and place
  122. a version of this within the object code.
  123. tic30_aout_final_link_relocate will then calculate the required
  124. relocation to add on to the value in the object code. */
  125. static bfd_reloc_status_type
  126. tic30_aout_fix_pcrel_16 (bfd *abfd,
  127. arelent *reloc_entry,
  128. asymbol *symbol ATTRIBUTE_UNUSED,
  129. void * data,
  130. asection *input_section ATTRIBUTE_UNUSED,
  131. bfd *output_bfd ATTRIBUTE_UNUSED,
  132. char **error_message ATTRIBUTE_UNUSED)
  133. {
  134. bfd_vma relocation = 1;
  135. bfd_byte offset_data = bfd_get_8 (abfd, (bfd_byte *) data + reloc_entry->address - 1);
  136. /* The byte before the location of the fix contains bits 23-16 of
  137. the pcrel instruction. Bit 21 is set for a delayed instruction
  138. which requires on offset of 3 instead of 1. */
  139. if (offset_data & 0x20)
  140. relocation -= 3;
  141. else
  142. relocation -= 1;
  143. bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
  144. return bfd_reloc_ok;
  145. }
  146. /* This function is used as a callback for 16-bit relocs. This is
  147. required for relocations between segments. A line in aoutx.h
  148. requires that any relocations for the data section should point to
  149. the end of the aligned text section, plus an offset. By default,
  150. this does not happen, therefore this function takes care of
  151. that. */
  152. static bfd_reloc_status_type
  153. tic30_aout_fix_16 (bfd *abfd,
  154. arelent *reloc_entry,
  155. asymbol *symbol,
  156. void * data,
  157. asection *input_section ATTRIBUTE_UNUSED,
  158. bfd *output_bfd,
  159. char **error_message ATTRIBUTE_UNUSED)
  160. {
  161. bfd_vma relocation;
  162. /* Make sure that the symbol's section is defined. */
  163. if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0)
  164. return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
  165. /* Get the size of the input section and turn it into the TMS320C30
  166. 32-bit address format. */
  167. relocation = (symbol->section->vma >> 2);
  168. relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address);
  169. bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
  170. return bfd_reloc_ok;
  171. }
  172. /* This function does the same thing as tic30_aout_fix_16 except for 32
  173. bit relocations. */
  174. static bfd_reloc_status_type
  175. tic30_aout_fix_32 (bfd *abfd,
  176. arelent *reloc_entry,
  177. asymbol *symbol,
  178. void * data,
  179. asection *input_section ATTRIBUTE_UNUSED,
  180. bfd *output_bfd,
  181. char **error_message ATTRIBUTE_UNUSED)
  182. {
  183. bfd_vma relocation;
  184. /* Make sure that the symbol's section is defined. */
  185. if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0)
  186. return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
  187. /* Get the size of the input section and turn it into the TMS320C30
  188. 32-bit address format. */
  189. relocation = (symbol->section->vma >> 2);
  190. relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
  191. bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
  192. return bfd_reloc_ok;
  193. }
  194. /* This table lists the relocation types for the TMS320C30. There are
  195. only a few relocations required, and all must be divided by 4 (>>
  196. 2) to get the 32-bit addresses in the format the TMS320C30 likes
  197. it. */
  198. reloc_howto_type tic30_aout_howto_table[] =
  199. {
  200. EMPTY_HOWTO (-1),
  201. HOWTO (1, 2, 1, 16, FALSE, 0, 0, tic30_aout_fix_16,
  202. "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
  203. HOWTO (2, 2, 2, 24, FALSE, 0, complain_overflow_bitfield, NULL,
  204. "24", FALSE, 0x00FFFFFF, 0x00FFFFFF, FALSE),
  205. HOWTO (3, 18, 3, 24, FALSE, 0, complain_overflow_bitfield, NULL,
  206. "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
  207. HOWTO (4, 2, 4, 32, FALSE, 0, complain_overflow_bitfield, tic30_aout_fix_32,
  208. "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
  209. HOWTO (5, 2, 1, 16, TRUE, 0, complain_overflow_signed,
  210. tic30_aout_fix_pcrel_16, "PCREL", TRUE, 0x0000FFFF, 0x0000FFFF, TRUE),
  211. EMPTY_HOWTO (-1),
  212. EMPTY_HOWTO (-1),
  213. EMPTY_HOWTO (-1),
  214. EMPTY_HOWTO (-1),
  215. EMPTY_HOWTO (-1)
  216. };
  217. static reloc_howto_type *
  218. tic30_aout_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
  219. bfd_reloc_code_real_type code)
  220. {
  221. switch (code)
  222. {
  223. case BFD_RELOC_8:
  224. case BFD_RELOC_TIC30_LDP:
  225. return &tic30_aout_howto_table[3];
  226. case BFD_RELOC_16:
  227. return &tic30_aout_howto_table[1];
  228. case BFD_RELOC_24:
  229. return &tic30_aout_howto_table[2];
  230. case BFD_RELOC_16_PCREL:
  231. return &tic30_aout_howto_table[5];
  232. case BFD_RELOC_32:
  233. return &tic30_aout_howto_table[4];
  234. default:
  235. return NULL;
  236. }
  237. }
  238. static reloc_howto_type *
  239. tic30_aout_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
  240. const char *r_name)
  241. {
  242. unsigned int i;
  243. for (i = 0;
  244. i < (sizeof (tic30_aout_howto_table)
  245. / sizeof (tic30_aout_howto_table[0]));
  246. i++)
  247. if (tic30_aout_howto_table[i].name != NULL
  248. && strcasecmp (tic30_aout_howto_table[i].name, r_name) == 0)
  249. return &tic30_aout_howto_table[i];
  250. return NULL;
  251. }
  252. static reloc_howto_type *
  253. tic30_aout_reloc_howto (bfd *abfd,
  254. struct reloc_std_external *relocs,
  255. int *r_index,
  256. int *r_extern,
  257. int *r_pcrel)
  258. {
  259. unsigned int r_length;
  260. unsigned int r_pcrel_done;
  261. int howto_index;
  262. *r_pcrel = 0;
  263. if (bfd_header_big_endian (abfd))
  264. {
  265. *r_index = ((relocs->r_index[0] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[2]);
  266. *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
  267. r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
  268. r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) >> RELOC_STD_BITS_LENGTH_SH_BIG);
  269. }
  270. else
  271. {
  272. *r_index = ((relocs->r_index[2] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[0]);
  273. *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
  274. r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
  275. r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
  276. }
  277. howto_index = r_length + 4 * r_pcrel_done;
  278. return tic30_aout_howto_table + howto_index;
  279. }
  280. /* These macros will get 24-bit values from the bfd definition.
  281. Big-endian only. */
  282. #define bfd_getb_24(BFD,ADDR) \
  283. (bfd_get_8 (BFD, ADDR ) << 16) | \
  284. (bfd_get_8 (BFD, ADDR + 1) << 8) | \
  285. (bfd_get_8 (BFD, ADDR + 2) )
  286. #define bfd_putb_24(BFD,DATA,ADDR) \
  287. bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR ); \
  288. bfd_put_8 (BFD, (bfd_byte) ((DATA >> 8) & 0xFF), ADDR + 1); \
  289. bfd_put_8 (BFD, (bfd_byte) ( DATA & 0xFF), ADDR + 2)
  290. /* Set parameters about this a.out file that are machine-dependent.
  291. This routine is called from some_aout_object_p just before it returns. */
  292. static const bfd_target *
  293. tic30_aout_callback (bfd *abfd)
  294. {
  295. struct internal_exec *execp = exec_hdr (abfd);
  296. unsigned int arch_align_power;
  297. unsigned long arch_align;
  298. /* Calculate the file positions of the parts of a newly read aout header. */
  299. obj_textsec (abfd)->size = N_TXTSIZE (*execp);
  300. /* The virtual memory addresses of the sections. */
  301. obj_textsec (abfd)->vma = N_TXTADDR (*execp);
  302. obj_datasec (abfd)->vma = N_DATADDR (*execp);
  303. obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
  304. obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
  305. obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
  306. obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
  307. /* The file offsets of the sections. */
  308. obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
  309. obj_datasec (abfd)->filepos = N_DATOFF (*execp);
  310. /* The file offsets of the relocation info. */
  311. obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
  312. obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
  313. /* The file offsets of the string table and symbol table. */
  314. obj_sym_filepos (abfd) = N_SYMOFF (*execp);
  315. obj_str_filepos (abfd) = N_STROFF (*execp);
  316. /* Determine the architecture and machine type of the object file. */
  317. #ifdef SET_ARCH_MACH
  318. SET_ARCH_MACH (abfd, *execp);
  319. #else
  320. bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0L);
  321. #endif
  322. /* Now that we know the architecture, set the alignments of the
  323. sections. This is normally done by NAME (aout,new_section_hook),
  324. but when the initial sections were created the architecture had
  325. not yet been set. However, for backward compatibility, we don't
  326. set the alignment power any higher than as required by the size
  327. of the section. */
  328. arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
  329. arch_align = 1 << arch_align_power;
  330. if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
  331. == obj_textsec (abfd)->size)
  332. && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
  333. == obj_datasec (abfd)->size)
  334. && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
  335. == obj_bsssec (abfd)->size))
  336. {
  337. obj_textsec (abfd)->alignment_power = arch_align_power;
  338. obj_datasec (abfd)->alignment_power = arch_align_power;
  339. obj_bsssec (abfd)->alignment_power = arch_align_power;
  340. }
  341. return abfd->xvec;
  342. }
  343. static bfd_reloc_status_type
  344. tic30_aout_relocate_contents (reloc_howto_type *howto,
  345. bfd *input_bfd,
  346. bfd_vma relocation,
  347. bfd_byte *location)
  348. {
  349. bfd_vma x;
  350. bfd_boolean overflow;
  351. if (howto->size < 0)
  352. relocation = -relocation;
  353. switch (howto->size)
  354. {
  355. default:
  356. case 0:
  357. abort ();
  358. break;
  359. case 1:
  360. x = bfd_get_16 (input_bfd, location);
  361. break;
  362. case 2:
  363. x = bfd_getb_24 (input_bfd, location);
  364. break;
  365. case 3:
  366. x = bfd_get_8 (input_bfd, location);
  367. break;
  368. case 4:
  369. x = bfd_get_32 (input_bfd, location);
  370. break;
  371. }
  372. overflow = FALSE;
  373. if (howto->complain_on_overflow != complain_overflow_dont)
  374. {
  375. bfd_vma check;
  376. bfd_signed_vma signed_check;
  377. bfd_vma add;
  378. bfd_signed_vma signed_add;
  379. if (howto->rightshift == 0)
  380. {
  381. check = relocation;
  382. signed_check = (bfd_signed_vma) relocation;
  383. }
  384. else
  385. {
  386. check = relocation >> howto->rightshift;
  387. if ((bfd_signed_vma) relocation >= 0)
  388. signed_check = check;
  389. else
  390. signed_check = (check | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->rightshift)));
  391. }
  392. add = x & howto->src_mask;
  393. signed_add = add;
  394. if ((add & (((~howto->src_mask) >> 1) & howto->src_mask)) != 0)
  395. signed_add -= (((~howto->src_mask) >> 1) & howto->src_mask) << 1;
  396. if (howto->bitpos == 0)
  397. {
  398. check += add;
  399. signed_check += signed_add;
  400. }
  401. else
  402. {
  403. check += add >> howto->bitpos;
  404. if (signed_add >= 0)
  405. signed_check += add >> howto->bitpos;
  406. else
  407. signed_check += ((add >> howto->bitpos) | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->bitpos)));
  408. }
  409. switch (howto->complain_on_overflow)
  410. {
  411. case complain_overflow_signed:
  412. {
  413. bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
  414. bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
  415. if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
  416. overflow = TRUE;
  417. }
  418. break;
  419. case complain_overflow_unsigned:
  420. {
  421. bfd_vma reloc_unsigned_max = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
  422. if (check > reloc_unsigned_max)
  423. overflow = TRUE;
  424. }
  425. break;
  426. case complain_overflow_bitfield:
  427. {
  428. bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
  429. if ((check & ~reloc_bits) != 0
  430. && (((bfd_vma) signed_check & ~reloc_bits)
  431. != ((bfd_vma) -1 & ~reloc_bits)))
  432. overflow = TRUE;
  433. }
  434. break;
  435. default:
  436. abort ();
  437. }
  438. }
  439. relocation >>= (bfd_vma) howto->rightshift;
  440. relocation <<= (bfd_vma) howto->bitpos;
  441. x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask));
  442. switch (howto->size)
  443. {
  444. default:
  445. case 0:
  446. abort ();
  447. break;
  448. case 1:
  449. bfd_put_16 (input_bfd, x, location);
  450. break;
  451. case 2:
  452. bfd_putb_24 (input_bfd, x, location);
  453. break;
  454. case 3:
  455. bfd_put_8 (input_bfd, x, location);
  456. break;
  457. case 4:
  458. bfd_put_32 (input_bfd, x, location);
  459. break;
  460. }
  461. return overflow ? bfd_reloc_overflow : bfd_reloc_ok;
  462. }
  463. static bfd_reloc_status_type
  464. tic30_aout_final_link_relocate (reloc_howto_type *howto,
  465. bfd *input_bfd,
  466. asection *input_section,
  467. bfd_byte *contents,
  468. bfd_vma address,
  469. bfd_vma value,
  470. bfd_vma addend)
  471. {
  472. bfd_vma relocation;
  473. if (address > bfd_get_section_limit (input_bfd, input_section))
  474. return bfd_reloc_outofrange;
  475. relocation = value + addend;
  476. if (howto->pc_relative)
  477. {
  478. relocation -= (input_section->output_section->vma + input_section->output_offset);
  479. if (howto->pcrel_offset)
  480. relocation -= address;
  481. }
  482. return tic30_aout_relocate_contents (howto, input_bfd, relocation,
  483. contents + address);
  484. }
  485. /* Finish up the reading of an a.out file header. */
  486. static const bfd_target *
  487. tic30_aout_object_p (bfd *abfd)
  488. {
  489. struct external_exec exec_bytes; /* Raw exec header from file. */
  490. struct internal_exec exec; /* Cleaned-up exec header. */
  491. const bfd_target *target;
  492. bfd_size_type amt = EXEC_BYTES_SIZE;
  493. if (bfd_bread (& exec_bytes, amt, abfd) != amt)
  494. {
  495. if (bfd_get_error () != bfd_error_system_call)
  496. bfd_set_error (bfd_error_wrong_format);
  497. return 0;
  498. }
  499. #ifdef SWAP_MAGIC
  500. exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
  501. #else
  502. exec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
  503. #endif /* SWAP_MAGIC */
  504. if (N_BADMAG (exec))
  505. return 0;
  506. #ifdef MACHTYPE_OK
  507. if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
  508. return 0;
  509. #endif
  510. NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
  511. #ifdef SWAP_MAGIC
  512. /* Swap_exec_header_in read in a_info with the wrong byte order. */
  513. exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
  514. #endif
  515. target = NAME (aout, some_aout_object_p) (abfd, &exec, tic30_aout_callback);
  516. #ifdef ENTRY_CAN_BE_ZERO
  517. /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
  518. means that it isn't obvious if EXEC_P should be set.
  519. All of the following must be true for an executable:
  520. There must be no relocations, the bfd can be neither an
  521. archive nor an archive element, and the file must be executable. */
  522. if (exec.a_trsize + exec.a_drsize == 0
  523. && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL)
  524. {
  525. struct stat buf;
  526. #ifndef S_IXUSR
  527. #define S_IXUSR 0100 /* Execute by owner. */
  528. #endif
  529. if (stat (abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
  530. abfd->flags |= EXEC_P;
  531. }
  532. #endif
  533. return target;
  534. }
  535. /* Copy private section data. This actually does nothing with the
  536. sections. It copies the subformat field. We copy it here, because
  537. we need to know whether this is a QMAGIC file before we set the
  538. section contents, and copy_private_bfd_data is not called until
  539. after the section contents have been set. */
  540. static bfd_boolean
  541. MY_bfd_copy_private_section_data (bfd *ibfd,
  542. asection *isec ATTRIBUTE_UNUSED,
  543. bfd *obfd,
  544. asection *osec ATTRIBUTE_UNUSED)
  545. {
  546. if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
  547. obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
  548. return TRUE;
  549. }
  550. /* Write an object file.
  551. Section contents have already been written. We write the
  552. file header, symbols, and relocation. */
  553. static bfd_boolean
  554. tic30_aout_write_object_contents (bfd *abfd)
  555. {
  556. struct external_exec exec_bytes;
  557. struct internal_exec *execp = exec_hdr (abfd);
  558. obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
  559. {
  560. bfd_size_type text_size; /* Dummy vars. */
  561. file_ptr text_end;
  562. if (adata (abfd).magic == undecided_magic)
  563. NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
  564. execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;
  565. execp->a_entry = bfd_get_start_address (abfd);
  566. execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * obj_reloc_entry_size (abfd));
  567. execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * obj_reloc_entry_size (abfd));
  568. NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes);
  569. if (adata (abfd).exec_bytes_size > 0)
  570. {
  571. bfd_size_type amt;
  572. if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
  573. return FALSE;
  574. amt = adata (abfd).exec_bytes_size;
  575. if (bfd_bwrite (& exec_bytes, amt, abfd) != amt)
  576. return FALSE;
  577. }
  578. /* Now write out reloc info, followed by syms and strings. */
  579. if (bfd_get_outsymbols (abfd) != (asymbol **) NULL
  580. && bfd_get_symcount (abfd) != 0)
  581. {
  582. if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0)
  583. return FALSE;
  584. if (!NAME (aout, write_syms) (abfd))
  585. return FALSE;
  586. }
  587. if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0)
  588. return FALSE;
  589. if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
  590. return FALSE;
  591. if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0)
  592. return FALSE;
  593. if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
  594. return FALSE;
  595. }
  596. return TRUE;
  597. }
  598. #ifndef MY_final_link_callback
  599. /* Callback for the final_link routine to set the section offsets. */
  600. static void
  601. MY_final_link_callback (bfd *abfd,
  602. file_ptr *ptreloff,
  603. file_ptr *pdreloff,
  604. file_ptr *psymoff)
  605. {
  606. struct internal_exec *execp = exec_hdr (abfd);
  607. *ptreloff = obj_datasec (abfd)->filepos + execp->a_data;
  608. *pdreloff = *ptreloff + execp->a_trsize;
  609. *psymoff = *pdreloff + execp->a_drsize;
  610. }
  611. #endif
  612. #ifndef MY_bfd_final_link
  613. /* Final link routine. We need to use a call back to get the correct
  614. offsets in the output file. */
  615. static bfd_boolean
  616. MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
  617. {
  618. struct internal_exec *execp = exec_hdr (abfd);
  619. file_ptr pos;
  620. bfd_vma vma = 0;
  621. int pad;
  622. /* Set the executable header size to 0, as we don't want one for an
  623. output. */
  624. adata (abfd).exec_bytes_size = 0;
  625. pos = adata (abfd).exec_bytes_size;
  626. /* Text. */
  627. vma = info->create_object_symbols_section->vma;
  628. pos += vma;
  629. obj_textsec (abfd)->filepos = pos;
  630. obj_textsec (abfd)->vma = vma;
  631. obj_textsec (abfd)->user_set_vma = 1;
  632. pos += obj_textsec (abfd)->size;
  633. vma += obj_textsec (abfd)->size;
  634. /* Data. */
  635. if (abfd->flags & D_PAGED)
  636. {
  637. if (info->create_object_symbols_section->next->vma > 0)
  638. obj_datasec (abfd)->vma = info->create_object_symbols_section->next->vma;
  639. else
  640. obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
  641. }
  642. else
  643. obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
  644. if (obj_datasec (abfd)->vma < vma)
  645. obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
  646. obj_datasec (abfd)->user_set_vma = 1;
  647. vma = obj_datasec (abfd)->vma;
  648. obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size;
  649. execp->a_text = vma - obj_textsec (abfd)->vma;
  650. obj_textsec (abfd)->size = execp->a_text;
  651. /* Since BSS follows data immediately, see if it needs alignment. */
  652. vma += obj_datasec (abfd)->size;
  653. pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
  654. obj_datasec (abfd)->size += pad;
  655. pos += obj_datasec (abfd)->size;
  656. execp->a_data = obj_datasec (abfd)->size;
  657. /* BSS. */
  658. obj_bsssec (abfd)->vma = vma;
  659. obj_bsssec (abfd)->user_set_vma = 1;
  660. /* We are fully resized, so don't readjust in final_link. */
  661. adata (abfd).magic = z_magic;
  662. return NAME (aout, final_link) (abfd, info, MY_final_link_callback);
  663. }
  664. #endif
  665. static enum machine_type
  666. tic30_aout_machine_type (enum bfd_architecture arch,
  667. unsigned long machine ATTRIBUTE_UNUSED,
  668. bfd_boolean *unknown)
  669. {
  670. enum machine_type arch_flags;
  671. arch_flags = M_UNKNOWN;
  672. *unknown = TRUE;
  673. switch (arch)
  674. {
  675. case bfd_arch_tic30:
  676. *unknown = FALSE;
  677. break;
  678. default:
  679. arch_flags = M_UNKNOWN;
  680. }
  681. if (arch_flags != M_UNKNOWN)
  682. *unknown = FALSE;
  683. return arch_flags;
  684. }
  685. static bfd_boolean
  686. tic30_aout_set_arch_mach (bfd *abfd,
  687. enum bfd_architecture arch,
  688. unsigned long machine)
  689. {
  690. if (!bfd_default_set_arch_mach (abfd, arch, machine))
  691. return FALSE;
  692. if (arch != bfd_arch_unknown)
  693. {
  694. bfd_boolean unknown;
  695. tic30_aout_machine_type (arch, machine, &unknown);
  696. if (unknown)
  697. return FALSE;
  698. }
  699. obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
  700. return (*aout_backend_info (abfd)->set_sizes) (abfd);
  701. }
  702. /* We assume BFD generic archive files. */
  703. #ifndef MY_openr_next_archived_file
  704. #define MY_openr_next_archived_file bfd_generic_openr_next_archived_file
  705. #endif
  706. #ifndef MY_get_elt_at_index
  707. #define MY_get_elt_at_index _bfd_generic_get_elt_at_index
  708. #endif
  709. #ifndef MY_generic_stat_arch_elt
  710. #define MY_generic_stat_arch_elt bfd_generic_stat_arch_elt
  711. #endif
  712. #ifndef MY_slurp_armap
  713. #define MY_slurp_armap bfd_slurp_bsd_armap
  714. #endif
  715. #ifndef MY_slurp_extended_name_table
  716. #define MY_slurp_extended_name_table _bfd_slurp_extended_name_table
  717. #endif
  718. #ifndef MY_construct_extended_name_table
  719. #define MY_construct_extended_name_table \
  720. _bfd_archive_bsd_construct_extended_name_table
  721. #endif
  722. #ifndef MY_write_armap
  723. #define MY_write_armap bsd_write_armap
  724. #endif
  725. #ifndef MY_read_ar_hdr
  726. #define MY_read_ar_hdr _bfd_generic_read_ar_hdr
  727. #endif
  728. #ifndef MY_write_ar_hdr
  729. #define MY_write_ar_hdr _bfd_generic_write_ar_hdr
  730. #endif
  731. #ifndef MY_truncate_arname
  732. #define MY_truncate_arname bfd_bsd_truncate_arname
  733. #endif
  734. #ifndef MY_update_armap_timestamp
  735. #define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
  736. #endif
  737. /* No core file defined here -- configure in trad-core.c separately. */
  738. #ifndef MY_core_file_failing_command
  739. #define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
  740. #endif
  741. #ifndef MY_core_file_failing_signal
  742. #define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
  743. #endif
  744. #ifndef MY_core_file_matches_executable_p
  745. #define MY_core_file_matches_executable_p \
  746. _bfd_nocore_core_file_matches_executable_p
  747. #endif
  748. #ifndef MY_core_file_pid
  749. #define MY_core_file_pid _bfd_nocore_core_file_pid
  750. #endif
  751. #ifndef MY_core_file_p
  752. #define MY_core_file_p _bfd_dummy_target
  753. #endif
  754. #ifndef MY_bfd_debug_info_start
  755. #define MY_bfd_debug_info_start bfd_void
  756. #endif
  757. #ifndef MY_bfd_debug_info_end
  758. #define MY_bfd_debug_info_end bfd_void
  759. #endif
  760. #ifndef MY_bfd_debug_info_accumulate
  761. #define MY_bfd_debug_info_accumulate \
  762. (void (*) (bfd*, struct bfd_section *)) bfd_void
  763. #endif
  764. #ifndef MY_core_file_failing_command
  765. #define MY_core_file_failing_command NAME (aout, core_file_failing_command)
  766. #endif
  767. #ifndef MY_core_file_failing_signal
  768. #define MY_core_file_failing_signal NAME (aout, core_file_failing_signal)
  769. #endif
  770. #ifndef MY_core_file_matches_executable_p
  771. #define MY_core_file_matches_executable_p NAME (aout, core_file_matches_executable_p)
  772. #endif
  773. #ifndef MY_set_section_contents
  774. #define MY_set_section_contents NAME (aout, set_section_contents)
  775. #endif
  776. #ifndef MY_get_section_contents
  777. #define MY_get_section_contents aout_32_get_section_contents
  778. #endif
  779. #ifndef MY_get_section_contents_in_window
  780. #define MY_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
  781. #endif
  782. #ifndef MY_new_section_hook
  783. #define MY_new_section_hook NAME (aout, new_section_hook)
  784. #endif
  785. #ifndef MY_get_symtab_upper_bound
  786. #define MY_get_symtab_upper_bound NAME (aout, get_symtab_upper_bound)
  787. #endif
  788. #ifndef MY_canonicalize_symtab
  789. #define MY_canonicalize_symtab NAME (aout, canonicalize_symtab)
  790. #endif
  791. #ifndef MY_get_reloc_upper_bound
  792. #define MY_get_reloc_upper_bound NAME (aout, get_reloc_upper_bound)
  793. #endif
  794. #ifndef MY_canonicalize_reloc
  795. #define MY_canonicalize_reloc NAME (aout, canonicalize_reloc)
  796. #endif
  797. #ifndef MY_make_empty_symbol
  798. #define MY_make_empty_symbol NAME (aout, make_empty_symbol)
  799. #endif
  800. #ifndef MY_print_symbol
  801. #define MY_print_symbol NAME (aout, print_symbol)
  802. #endif
  803. #ifndef MY_get_symbol_info
  804. #define MY_get_symbol_info NAME (aout, get_symbol_info)
  805. #endif
  806. #ifndef MY_get_symbol_version_string
  807. #define MY_get_symbol_version_string \
  808. _bfd_nosymbols_get_symbol_version_string
  809. #endif
  810. #ifndef MY_get_lineno
  811. #define MY_get_lineno NAME (aout, get_lineno)
  812. #endif
  813. #ifndef MY_set_arch_mach
  814. #define MY_set_arch_mach tic30_aout_set_arch_mach
  815. #endif
  816. #ifndef MY_find_nearest_line
  817. #define MY_find_nearest_line NAME (aout, find_nearest_line)
  818. #endif
  819. #ifndef MY_find_line
  820. #define MY_find_line _bfd_nosymbols_find_line
  821. #endif
  822. #ifndef MY_find_inliner_info
  823. #define MY_find_inliner_info _bfd_nosymbols_find_inliner_info
  824. #endif
  825. #ifndef MY_sizeof_headers
  826. #define MY_sizeof_headers NAME (aout, sizeof_headers)
  827. #endif
  828. #ifndef MY_bfd_get_relocated_section_contents
  829. #define MY_bfd_get_relocated_section_contents \
  830. bfd_generic_get_relocated_section_contents
  831. #endif
  832. #ifndef MY_bfd_relax_section
  833. #define MY_bfd_relax_section bfd_generic_relax_section
  834. #endif
  835. #ifndef MY_bfd_gc_sections
  836. #define MY_bfd_gc_sections bfd_generic_gc_sections
  837. #endif
  838. #ifndef MY_bfd_lookup_section_flags
  839. #define MY_bfd_lookup_section_flags bfd_generic_lookup_section_flags
  840. #endif
  841. #ifndef MY_bfd_merge_sections
  842. #define MY_bfd_merge_sections bfd_generic_merge_sections
  843. #endif
  844. #ifndef MY_bfd_is_group_section
  845. #define MY_bfd_is_group_section bfd_generic_is_group_section
  846. #endif
  847. #ifndef MY_bfd_discard_group
  848. #define MY_bfd_discard_group bfd_generic_discard_group
  849. #endif
  850. #ifndef MY_section_already_linked
  851. #define MY_section_already_linked \
  852. _bfd_generic_section_already_linked
  853. #endif
  854. #ifndef MY_bfd_define_common_symbol
  855. #define MY_bfd_define_common_symbol bfd_generic_define_common_symbol
  856. #endif
  857. #ifndef MY_bfd_reloc_type_lookup
  858. #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
  859. #endif
  860. #ifndef MY_bfd_reloc_name_lookup
  861. #define MY_bfd_reloc_name_lookup tic30_aout_reloc_name_lookup
  862. #endif
  863. #ifndef MY_bfd_make_debug_symbol
  864. #define MY_bfd_make_debug_symbol 0
  865. #endif
  866. #ifndef MY_read_minisymbols
  867. #define MY_read_minisymbols NAME (aout, read_minisymbols)
  868. #endif
  869. #ifndef MY_minisymbol_to_symbol
  870. #define MY_minisymbol_to_symbol NAME (aout, minisymbol_to_symbol)
  871. #endif
  872. #ifndef MY_bfd_link_hash_table_create
  873. #define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
  874. #endif
  875. #ifndef MY_bfd_link_add_symbols
  876. #define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
  877. #endif
  878. #ifndef MY_bfd_link_just_syms
  879. #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
  880. #endif
  881. #ifndef MY_bfd_copy_link_hash_symbol_type
  882. #define MY_bfd_copy_link_hash_symbol_type \
  883. _bfd_generic_copy_link_hash_symbol_type
  884. #endif
  885. #ifndef MY_bfd_link_split_section
  886. #define MY_bfd_link_split_section _bfd_generic_link_split_section
  887. #endif
  888. #ifndef MY_bfd_copy_private_bfd_data
  889. #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
  890. #endif
  891. #ifndef MY_bfd_merge_private_bfd_data
  892. #define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
  893. #endif
  894. #ifndef MY_bfd_copy_private_symbol_data
  895. #define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
  896. #endif
  897. #ifndef MY_bfd_copy_private_header_data
  898. #define MY_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
  899. #endif
  900. #ifndef MY_bfd_print_private_bfd_data
  901. #define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
  902. #endif
  903. #ifndef MY_bfd_set_private_flags
  904. #define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
  905. #endif
  906. #ifndef MY_bfd_is_local_label_name
  907. #define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
  908. #endif
  909. #ifndef MY_bfd_is_target_special_symbol
  910. #define MY_bfd_is_target_special_symbol \
  911. ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
  912. #endif
  913. #ifndef MY_bfd_free_cached_info
  914. #define MY_bfd_free_cached_info NAME (aout, bfd_free_cached_info)
  915. #endif
  916. #ifndef MY_close_and_cleanup
  917. #define MY_close_and_cleanup MY_bfd_free_cached_info
  918. #endif
  919. #ifndef MY_get_dynamic_symtab_upper_bound
  920. #define MY_get_dynamic_symtab_upper_bound \
  921. _bfd_nodynamic_get_dynamic_symtab_upper_bound
  922. #endif
  923. #ifndef MY_canonicalize_dynamic_symtab
  924. #define MY_canonicalize_dynamic_symtab \
  925. _bfd_nodynamic_canonicalize_dynamic_symtab
  926. #endif
  927. #ifndef MY_get_synthetic_symtab
  928. #define MY_get_synthetic_symtab \
  929. _bfd_nodynamic_get_synthetic_symtab
  930. #endif
  931. #ifndef MY_get_dynamic_reloc_upper_bound
  932. #define MY_get_dynamic_reloc_upper_bound \
  933. _bfd_nodynamic_get_dynamic_reloc_upper_bound
  934. #endif
  935. #ifndef MY_canonicalize_dynamic_reloc
  936. #define MY_canonicalize_dynamic_reloc \
  937. _bfd_nodynamic_canonicalize_dynamic_reloc
  938. #endif
  939. /* Aout symbols normally have leading underscores. */
  940. #ifndef MY_symbol_leading_char
  941. #define MY_symbol_leading_char '_'
  942. #endif
  943. /* Aout archives normally use spaces for padding. */
  944. #ifndef AR_PAD_CHAR
  945. #define AR_PAD_CHAR ' '
  946. #endif
  947. #ifndef MY_BFD_TARGET
  948. const bfd_target tic30_aout_vec =
  949. {
  950. TARGETNAME, /* Name. */
  951. bfd_target_aout_flavour,
  952. BFD_ENDIAN_BIG, /* Target byte order (big). */
  953. BFD_ENDIAN_BIG, /* Target headers byte order (big). */
  954. (HAS_RELOC | /* Object flags. */
  955. HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
  956. (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
  957. MY_symbol_leading_char,
  958. AR_PAD_CHAR, /* AR_pad_char. */
  959. 15, /* AR_max_namelen. */
  960. 0, /* match priority. */
  961. bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  962. bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  963. bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
  964. bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  965. bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  966. bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
  967. {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */
  968. bfd_generic_archive_p, MY_core_file_p},
  969. {bfd_false, MY_mkobject, /* bfd_set_format. */
  970. _bfd_generic_mkarchive, bfd_false},
  971. {bfd_false, MY_write_object_contents, /* bfd_write_contents. */
  972. _bfd_write_archive_contents, bfd_false},
  973. BFD_JUMP_TABLE_GENERIC (MY),
  974. BFD_JUMP_TABLE_COPY (MY),
  975. BFD_JUMP_TABLE_CORE (MY),
  976. BFD_JUMP_TABLE_ARCHIVE (MY),
  977. BFD_JUMP_TABLE_SYMBOLS (MY),
  978. BFD_JUMP_TABLE_RELOCS (MY),
  979. BFD_JUMP_TABLE_WRITE (MY),
  980. BFD_JUMP_TABLE_LINK (MY),
  981. BFD_JUMP_TABLE_DYNAMIC (MY),
  982. NULL,
  983. MY_backend_data
  984. };
  985. #endif /* MY_BFD_TARGET */