1 /* xSYM symbol-file support for BFD.
2 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
3 Free Software Foundation, Inc.
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
27 #define bfd_sym_close_and_cleanup _bfd_generic_close_and_cleanup
28 #define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
29 #define bfd_sym_new_section_hook _bfd_generic_new_section_hook
30 #define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name
31 #define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
32 #define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
33 #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
34 #define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info
35 #define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
36 #define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols
37 #define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
38 #define bfd_sym_set_arch_mach _bfd_generic_set_arch_mach
39 #define bfd_sym_get_section_contents _bfd_generic_get_section_contents
40 #define bfd_sym_set_section_contents _bfd_generic_set_section_contents
41 #define bfd_sym_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
42 #define bfd_sym_bfd_relax_section bfd_generic_relax_section
43 #define bfd_sym_bfd_gc_sections bfd_generic_gc_sections
44 #define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
45 #define bfd_sym_bfd_is_group_section bfd_generic_is_group_section
46 #define bfd_sym_bfd_discard_group bfd_generic_discard_group
47 #define bfd_sym_section_already_linked _bfd_generic_section_already_linked
48 #define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
49 #define bfd_sym_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
50 #define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
51 #define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
52 #define bfd_sym_bfd_final_link _bfd_generic_final_link
53 #define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
54 #define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
56 extern const bfd_target sym_vec
;
59 pstrcmp (const char *as
, const char *bs
)
61 const unsigned char *a
= (const unsigned char *) as
;
62 const unsigned char *b
= (const unsigned char *) bs
;
66 clen
= (a
[0] > b
[0]) ? b
[0] : a
[0];
67 ret
= memcmp (a
+ 1, b
+ 1, clen
);
80 compute_offset (unsigned long first_page
,
81 unsigned long page_size
,
82 unsigned long entry_size
,
85 unsigned long entries_per_page
= page_size
/ entry_size
;
86 unsigned long page_number
= first_page
+ (index
/ entries_per_page
);
87 unsigned long page_offset
= (index
% entries_per_page
) * entry_size
;
89 return (page_number
* page_size
) + page_offset
;
93 bfd_sym_mkobject (bfd
*abfd ATTRIBUTE_UNUSED
)
99 bfd_sym_print_symbol (bfd
*abfd ATTRIBUTE_UNUSED
,
100 void * afile ATTRIBUTE_UNUSED
,
101 asymbol
*symbol ATTRIBUTE_UNUSED
,
102 bfd_print_symbol_type how ATTRIBUTE_UNUSED
)
108 bfd_sym_valid (bfd
*abfd
)
110 if (abfd
== NULL
|| abfd
->xvec
== NULL
)
113 return abfd
->xvec
== &sym_vec
;
117 bfd_sym_read_name_table (bfd
*abfd
, bfd_sym_header_block
*dshb
)
121 size_t table_size
= dshb
->dshb_nte
.dti_page_count
* dshb
->dshb_page_size
;
122 size_t table_offset
= dshb
->dshb_nte
.dti_first_page
* dshb
->dshb_page_size
;
124 rstr
= bfd_alloc (abfd
, table_size
);
128 bfd_seek (abfd
, table_offset
, SEEK_SET
);
129 ret
= bfd_bread (rstr
, table_size
, abfd
);
130 if (ret
< 0 || (unsigned long) ret
!= table_size
)
132 bfd_release (abfd
, rstr
);
140 bfd_sym_parse_file_reference_v32 (unsigned char *buf
,
142 bfd_sym_file_reference
*entry
)
144 BFD_ASSERT (len
== 6);
146 entry
->fref_frte_index
= bfd_getb16 (buf
);
147 entry
->fref_offset
= bfd_getb32 (buf
+ 2);
151 bfd_sym_parse_disk_table_v32 (unsigned char *buf
,
153 bfd_sym_table_info
*table
)
155 BFD_ASSERT (len
== 8);
157 table
->dti_first_page
= bfd_getb16 (buf
);
158 table
->dti_page_count
= bfd_getb16 (buf
+ 2);
159 table
->dti_object_count
= bfd_getb32 (buf
+ 4);
163 bfd_sym_parse_header_v32 (unsigned char *buf
,
165 bfd_sym_header_block
*header
)
167 BFD_ASSERT (len
== 154);
169 memcpy (header
->dshb_id
, buf
, 32);
170 header
->dshb_page_size
= bfd_getb16 (buf
+ 32);
171 header
->dshb_hash_page
= bfd_getb16 (buf
+ 34);
172 header
->dshb_root_mte
= bfd_getb16 (buf
+ 36);
173 header
->dshb_mod_date
= bfd_getb32 (buf
+ 38);
175 bfd_sym_parse_disk_table_v32 (buf
+ 42, 8, &header
->dshb_frte
);
176 bfd_sym_parse_disk_table_v32 (buf
+ 50, 8, &header
->dshb_rte
);
177 bfd_sym_parse_disk_table_v32 (buf
+ 58, 8, &header
->dshb_mte
);
178 bfd_sym_parse_disk_table_v32 (buf
+ 66, 8, &header
->dshb_cmte
);
179 bfd_sym_parse_disk_table_v32 (buf
+ 74, 8, &header
->dshb_cvte
);
180 bfd_sym_parse_disk_table_v32 (buf
+ 82, 8, &header
->dshb_csnte
);
181 bfd_sym_parse_disk_table_v32 (buf
+ 90, 8, &header
->dshb_clte
);
182 bfd_sym_parse_disk_table_v32 (buf
+ 98, 8, &header
->dshb_ctte
);
183 bfd_sym_parse_disk_table_v32 (buf
+ 106, 8, &header
->dshb_tte
);
184 bfd_sym_parse_disk_table_v32 (buf
+ 114, 8, &header
->dshb_nte
);
185 bfd_sym_parse_disk_table_v32 (buf
+ 122, 8, &header
->dshb_tinfo
);
186 bfd_sym_parse_disk_table_v32 (buf
+ 130, 8, &header
->dshb_fite
);
187 bfd_sym_parse_disk_table_v32 (buf
+ 138, 8, &header
->dshb_const
);
189 memcpy (&header
->dshb_file_creator
, buf
+ 146, 4);
190 memcpy (&header
->dshb_file_type
, buf
+ 150, 4);
194 bfd_sym_read_header_v32 (bfd
*abfd
, bfd_sym_header_block
*header
)
196 unsigned char buf
[154];
199 ret
= bfd_bread (buf
, 154, abfd
);
203 bfd_sym_parse_header_v32 (buf
, 154, header
);
209 bfd_sym_read_header_v34 (bfd
*abfd ATTRIBUTE_UNUSED
,
210 bfd_sym_header_block
*header ATTRIBUTE_UNUSED
)
216 bfd_sym_read_header (bfd
*abfd
,
217 bfd_sym_header_block
*header
,
218 bfd_sym_version version
)
222 case BFD_SYM_VERSION_3_5
:
223 case BFD_SYM_VERSION_3_4
:
224 return bfd_sym_read_header_v34 (abfd
, header
);
225 case BFD_SYM_VERSION_3_3
:
226 case BFD_SYM_VERSION_3_2
:
227 return bfd_sym_read_header_v32 (abfd
, header
);
228 case BFD_SYM_VERSION_3_1
:
235 bfd_sym_read_version (bfd
*abfd
, bfd_sym_version
*version
)
237 char version_string
[32];
240 ret
= bfd_bread (version_string
, sizeof (version_string
), abfd
);
241 if (ret
!= sizeof (version_string
))
244 if (pstrcmp (version_string
, BFD_SYM_VERSION_STR_3_1
) == 0)
245 *version
= BFD_SYM_VERSION_3_1
;
246 else if (pstrcmp (version_string
, BFD_SYM_VERSION_STR_3_2
) == 0)
247 *version
= BFD_SYM_VERSION_3_2
;
248 else if (pstrcmp (version_string
, BFD_SYM_VERSION_STR_3_3
) == 0)
249 *version
= BFD_SYM_VERSION_3_3
;
250 else if (pstrcmp (version_string
, BFD_SYM_VERSION_STR_3_4
) == 0)
251 *version
= BFD_SYM_VERSION_3_4
;
252 else if (pstrcmp (version_string
, BFD_SYM_VERSION_STR_3_5
) == 0)
253 *version
= BFD_SYM_VERSION_3_5
;
261 bfd_sym_display_table_summary (FILE *f
,
262 bfd_sym_table_info
*dti
,
265 fprintf (f
, "%-6s %13ld %13ld %13ld\n",
269 dti
->dti_object_count
);
273 bfd_sym_display_header (FILE *f
, bfd_sym_header_block
*dshb
)
275 fprintf (f
, " Version: %.*s\n", dshb
->dshb_id
[0], dshb
->dshb_id
+ 1);
276 fprintf (f
, " Page Size: 0x%x\n", dshb
->dshb_page_size
);
277 fprintf (f
, " Hash Page: %lu\n", dshb
->dshb_hash_page
);
278 fprintf (f
, " Root MTE: %lu\n", dshb
->dshb_root_mte
);
279 fprintf (f
, " Modification Date: ");
280 fprintf (f
, "[unimplemented]");
281 fprintf (f
, " (0x%lx)\n", dshb
->dshb_mod_date
);
283 fprintf (f
, " File Creator: %.4s Type: %.4s\n\n",
284 dshb
->dshb_file_creator
, dshb
->dshb_file_type
);
286 fprintf (f
, "Table Name First Page Page Count Object Count\n");
287 fprintf (f
, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
289 bfd_sym_display_table_summary (f
, &dshb
->dshb_nte
, "NTE");
290 bfd_sym_display_table_summary (f
, &dshb
->dshb_rte
, "RTE");
291 bfd_sym_display_table_summary (f
, &dshb
->dshb_mte
, "MTE");
292 bfd_sym_display_table_summary (f
, &dshb
->dshb_frte
, "FRTE");
293 bfd_sym_display_table_summary (f
, &dshb
->dshb_cmte
, "CMTE");
294 bfd_sym_display_table_summary (f
, &dshb
->dshb_cvte
, "CVTE");
295 bfd_sym_display_table_summary (f
, &dshb
->dshb_csnte
, "CSNTE");
296 bfd_sym_display_table_summary (f
, &dshb
->dshb_clte
, "CLTE");
297 bfd_sym_display_table_summary (f
, &dshb
->dshb_ctte
, "CTTE");
298 bfd_sym_display_table_summary (f
, &dshb
->dshb_tte
, "TTE");
299 bfd_sym_display_table_summary (f
, &dshb
->dshb_tinfo
, "TINFO");
300 bfd_sym_display_table_summary (f
, &dshb
->dshb_fite
, "FITE");
301 bfd_sym_display_table_summary (f
, &dshb
->dshb_const
, "CONST");
307 bfd_sym_parse_resources_table_entry_v32 (unsigned char *buf
,
309 bfd_sym_resources_table_entry
*entry
)
311 BFD_ASSERT (len
== 18);
313 memcpy (&entry
->rte_res_type
, buf
, 4);
314 entry
->rte_res_number
= bfd_getb16 (buf
+ 4);
315 entry
->rte_nte_index
= bfd_getb32 (buf
+ 6);
316 entry
->rte_mte_first
= bfd_getb16 (buf
+ 10);
317 entry
->rte_mte_last
= bfd_getb16 (buf
+ 12);
318 entry
->rte_res_size
= bfd_getb32 (buf
+ 14);
322 bfd_sym_parse_modules_table_entry_v33 (unsigned char *buf
,
324 bfd_sym_modules_table_entry
*entry
)
326 BFD_ASSERT (len
== 46);
328 entry
->mte_rte_index
= bfd_getb16 (buf
);
329 entry
->mte_res_offset
= bfd_getb32 (buf
+ 2);
330 entry
->mte_size
= bfd_getb32 (buf
+ 6);
331 entry
->mte_kind
= buf
[10];
332 entry
->mte_scope
= buf
[11];
333 entry
->mte_parent
= bfd_getb16 (buf
+ 12);
334 bfd_sym_parse_file_reference_v32 (buf
+ 14, 6, &entry
->mte_imp_fref
);
335 entry
->mte_imp_end
= bfd_getb32 (buf
+ 20);
336 entry
->mte_nte_index
= bfd_getb32 (buf
+ 24);
337 entry
->mte_cmte_index
= bfd_getb16 (buf
+ 28);
338 entry
->mte_cvte_index
= bfd_getb32 (buf
+ 30);
339 entry
->mte_clte_index
= bfd_getb16 (buf
+ 34);
340 entry
->mte_ctte_index
= bfd_getb16 (buf
+ 36);
341 entry
->mte_csnte_idx_1
= bfd_getb32 (buf
+ 38);
342 entry
->mte_csnte_idx_2
= bfd_getb32 (buf
+ 42);
346 bfd_sym_parse_file_references_table_entry_v32 (unsigned char *buf
,
348 bfd_sym_file_references_table_entry
*entry
)
352 BFD_ASSERT (len
== 10);
354 memset (entry
, 0, sizeof (bfd_sym_file_references_table_entry
));
355 type
= bfd_getb16 (buf
);
359 case BFD_SYM_END_OF_LIST_3_2
:
360 entry
->generic
.type
= BFD_SYM_END_OF_LIST
;
363 case BFD_SYM_FILE_NAME_INDEX_3_2
:
364 entry
->filename
.type
= BFD_SYM_FILE_NAME_INDEX
;
365 entry
->filename
.nte_index
= bfd_getb32 (buf
+ 2);
366 entry
->filename
.mod_date
= bfd_getb32 (buf
+ 6);
370 entry
->entry
.mte_index
= type
;
371 entry
->entry
.file_offset
= bfd_getb32 (buf
+ 2);
376 bfd_sym_parse_contained_modules_table_entry_v32 (unsigned char *buf
,
378 bfd_sym_contained_modules_table_entry
*entry
)
382 BFD_ASSERT (len
== 6);
384 memset (entry
, 0, sizeof (bfd_sym_contained_modules_table_entry
));
385 type
= bfd_getb16 (buf
);
389 case BFD_SYM_END_OF_LIST_3_2
:
390 entry
->generic
.type
= BFD_SYM_END_OF_LIST
;
394 entry
->entry
.mte_index
= type
;
395 entry
->entry
.nte_index
= bfd_getb32 (buf
+ 2);
401 bfd_sym_parse_contained_variables_table_entry_v32 (unsigned char *buf
,
403 bfd_sym_contained_variables_table_entry
*entry
)
407 BFD_ASSERT (len
== 26);
409 memset (entry
, 0, sizeof (bfd_sym_contained_variables_table_entry
));
410 type
= bfd_getb16 (buf
);
414 case BFD_SYM_END_OF_LIST_3_2
:
415 entry
->generic
.type
= BFD_SYM_END_OF_LIST
;
418 case BFD_SYM_SOURCE_FILE_CHANGE_3_2
:
419 entry
->file
.type
= BFD_SYM_SOURCE_FILE_CHANGE
;
420 bfd_sym_parse_file_reference_v32 (buf
+ 2, 6, &entry
->file
.fref
);
424 entry
->entry
.tte_index
= type
;
425 entry
->entry
.nte_index
= bfd_getb32 (buf
+ 2);
426 entry
->entry
.file_delta
= bfd_getb16 (buf
+ 6);
427 entry
->entry
.scope
= buf
[8];
428 entry
->entry
.la_size
= buf
[9];
430 if (entry
->entry
.la_size
== BFD_SYM_CVTE_SCA
)
432 entry
->entry
.address
.scstruct
.sca_kind
= buf
[10];
433 entry
->entry
.address
.scstruct
.sca_class
= buf
[11];
434 entry
->entry
.address
.scstruct
.sca_offset
= bfd_getb32 (buf
+ 12);
436 else if (entry
->entry
.la_size
<= BFD_SYM_CVTE_SCA
)
438 #if BFD_SYM_CVTE_SCA > 0
439 memcpy (&entry
->entry
.address
.lastruct
.la
, buf
+ 10,
442 entry
->entry
.address
.lastruct
.la_kind
= buf
[23];
444 else if (entry
->entry
.la_size
== BFD_SYM_CVTE_BIG_LA
)
446 entry
->entry
.address
.biglastruct
.big_la
= bfd_getb32 (buf
+ 10);
447 entry
->entry
.address
.biglastruct
.big_la_kind
= buf
[12];
453 bfd_sym_parse_contained_statements_table_entry_v32 (unsigned char *buf
,
455 bfd_sym_contained_statements_table_entry
*entry
)
459 BFD_ASSERT (len
== 8);
461 memset (entry
, 0, sizeof (bfd_sym_contained_statements_table_entry
));
462 type
= bfd_getb16 (buf
);
466 case BFD_SYM_END_OF_LIST_3_2
:
467 entry
->generic
.type
= BFD_SYM_END_OF_LIST
;
470 case BFD_SYM_SOURCE_FILE_CHANGE_3_2
:
471 entry
->file
.type
= BFD_SYM_SOURCE_FILE_CHANGE
;
472 bfd_sym_parse_file_reference_v32 (buf
+ 2, 6, &entry
->file
.fref
);
476 entry
->entry
.mte_index
= type
;
477 entry
->entry
.mte_offset
= bfd_getb16 (buf
+ 2);
478 entry
->entry
.file_delta
= bfd_getb32 (buf
+ 4);
484 bfd_sym_parse_contained_labels_table_entry_v32 (unsigned char *buf
,
486 bfd_sym_contained_labels_table_entry
*entry
)
490 BFD_ASSERT (len
== 12);
492 memset (entry
, 0, sizeof (bfd_sym_contained_labels_table_entry
));
493 type
= bfd_getb16 (buf
);
497 case BFD_SYM_END_OF_LIST_3_2
:
498 entry
->generic
.type
= BFD_SYM_END_OF_LIST
;
501 case BFD_SYM_SOURCE_FILE_CHANGE_3_2
:
502 entry
->file
.type
= BFD_SYM_SOURCE_FILE_CHANGE
;
503 bfd_sym_parse_file_reference_v32 (buf
+ 2, 6, &entry
->file
.fref
);
507 entry
->entry
.mte_index
= type
;
508 entry
->entry
.mte_offset
= bfd_getb16 (buf
+ 2);
509 entry
->entry
.nte_index
= bfd_getb32 (buf
+ 4);
510 entry
->entry
.file_delta
= bfd_getb16 (buf
+ 8);
511 entry
->entry
.scope
= bfd_getb16 (buf
+ 10);
517 bfd_sym_parse_type_table_entry_v32 (unsigned char *buf
,
519 bfd_sym_type_table_entry
*entry
)
521 BFD_ASSERT (len
== 4);
523 *entry
= bfd_getb32 (buf
);
527 bfd_sym_fetch_resources_table_entry (bfd
*abfd
,
528 bfd_sym_resources_table_entry
*entry
,
531 void (*parser
) (unsigned char *, size_t, bfd_sym_resources_table_entry
*);
532 unsigned long offset
;
533 unsigned long entry_size
;
534 unsigned char buf
[18];
535 bfd_sym_data_struct
*sdata
= NULL
;
538 BFD_ASSERT (bfd_sym_valid (abfd
));
539 sdata
= abfd
->tdata
.sym_data
;
544 switch (sdata
->version
)
546 case BFD_SYM_VERSION_3_5
:
547 case BFD_SYM_VERSION_3_4
:
550 case BFD_SYM_VERSION_3_3
:
551 case BFD_SYM_VERSION_3_2
:
553 parser
= bfd_sym_parse_resources_table_entry_v32
;
556 case BFD_SYM_VERSION_3_1
:
563 offset
= compute_offset (sdata
->header
.dshb_rte
.dti_first_page
,
564 sdata
->header
.dshb_page_size
,
567 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
569 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
572 (*parser
) (buf
, entry_size
, entry
);
578 bfd_sym_fetch_modules_table_entry (bfd
*abfd
,
579 bfd_sym_modules_table_entry
*entry
,
582 void (*parser
) (unsigned char *, size_t, bfd_sym_modules_table_entry
*);
583 unsigned long offset
;
584 unsigned long entry_size
;
585 unsigned char buf
[46];
586 bfd_sym_data_struct
*sdata
= NULL
;
589 BFD_ASSERT (bfd_sym_valid (abfd
));
590 sdata
= abfd
->tdata
.sym_data
;
595 switch (sdata
->version
)
597 case BFD_SYM_VERSION_3_5
:
598 case BFD_SYM_VERSION_3_4
:
601 case BFD_SYM_VERSION_3_3
:
603 parser
= bfd_sym_parse_modules_table_entry_v33
;
606 case BFD_SYM_VERSION_3_2
:
607 case BFD_SYM_VERSION_3_1
:
614 offset
= compute_offset (sdata
->header
.dshb_mte
.dti_first_page
,
615 sdata
->header
.dshb_page_size
,
618 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
620 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
623 (*parser
) (buf
, entry_size
, entry
);
629 bfd_sym_fetch_file_references_table_entry (bfd
*abfd
,
630 bfd_sym_file_references_table_entry
*entry
,
633 void (*parser
) (unsigned char *, size_t, bfd_sym_file_references_table_entry
*);
634 unsigned long offset
;
635 unsigned long entry_size
= 0;
636 unsigned char buf
[8];
637 bfd_sym_data_struct
*sdata
= NULL
;
640 BFD_ASSERT (bfd_sym_valid (abfd
));
641 sdata
= abfd
->tdata
.sym_data
;
646 switch (sdata
->version
)
648 case BFD_SYM_VERSION_3_3
:
649 case BFD_SYM_VERSION_3_2
:
651 parser
= bfd_sym_parse_file_references_table_entry_v32
;
654 case BFD_SYM_VERSION_3_5
:
655 case BFD_SYM_VERSION_3_4
:
656 case BFD_SYM_VERSION_3_1
:
664 offset
= compute_offset (sdata
->header
.dshb_frte
.dti_first_page
,
665 sdata
->header
.dshb_page_size
,
668 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
670 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
673 (*parser
) (buf
, entry_size
, entry
);
679 bfd_sym_fetch_contained_modules_table_entry (bfd
*abfd
,
680 bfd_sym_contained_modules_table_entry
*entry
,
683 void (*parser
) (unsigned char *, size_t, bfd_sym_contained_modules_table_entry
*);
684 unsigned long offset
;
685 unsigned long entry_size
= 0;
686 unsigned char buf
[6];
687 bfd_sym_data_struct
*sdata
= NULL
;
690 BFD_ASSERT (bfd_sym_valid (abfd
));
691 sdata
= abfd
->tdata
.sym_data
;
696 switch (sdata
->version
)
698 case BFD_SYM_VERSION_3_3
:
699 case BFD_SYM_VERSION_3_2
:
701 parser
= bfd_sym_parse_contained_modules_table_entry_v32
;
704 case BFD_SYM_VERSION_3_5
:
705 case BFD_SYM_VERSION_3_4
:
706 case BFD_SYM_VERSION_3_1
:
714 offset
= compute_offset (sdata
->header
.dshb_cmte
.dti_first_page
,
715 sdata
->header
.dshb_page_size
,
718 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
720 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
723 (*parser
) (buf
, entry_size
, entry
);
729 bfd_sym_fetch_contained_variables_table_entry (bfd
*abfd
,
730 bfd_sym_contained_variables_table_entry
*entry
,
733 void (*parser
) (unsigned char *, size_t, bfd_sym_contained_variables_table_entry
*);
734 unsigned long offset
;
735 unsigned long entry_size
= 0;
736 unsigned char buf
[26];
737 bfd_sym_data_struct
*sdata
= NULL
;
740 BFD_ASSERT (bfd_sym_valid (abfd
));
741 sdata
= abfd
->tdata
.sym_data
;
746 switch (sdata
->version
)
748 case BFD_SYM_VERSION_3_3
:
749 case BFD_SYM_VERSION_3_2
:
751 parser
= bfd_sym_parse_contained_variables_table_entry_v32
;
754 case BFD_SYM_VERSION_3_5
:
755 case BFD_SYM_VERSION_3_4
:
756 case BFD_SYM_VERSION_3_1
:
764 offset
= compute_offset (sdata
->header
.dshb_cvte
.dti_first_page
,
765 sdata
->header
.dshb_page_size
,
768 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
770 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
773 (*parser
) (buf
, entry_size
, entry
);
779 bfd_sym_fetch_contained_statements_table_entry (bfd
*abfd
,
780 bfd_sym_contained_statements_table_entry
*entry
,
783 void (*parser
) (unsigned char *, size_t, bfd_sym_contained_statements_table_entry
*);
784 unsigned long offset
;
785 unsigned long entry_size
= 0;
786 unsigned char buf
[8];
787 bfd_sym_data_struct
*sdata
= NULL
;
790 BFD_ASSERT (bfd_sym_valid (abfd
));
791 sdata
= abfd
->tdata
.sym_data
;
796 switch (sdata
->version
)
798 case BFD_SYM_VERSION_3_3
:
799 case BFD_SYM_VERSION_3_2
:
801 parser
= bfd_sym_parse_contained_statements_table_entry_v32
;
804 case BFD_SYM_VERSION_3_5
:
805 case BFD_SYM_VERSION_3_4
:
806 case BFD_SYM_VERSION_3_1
:
814 offset
= compute_offset (sdata
->header
.dshb_csnte
.dti_first_page
,
815 sdata
->header
.dshb_page_size
,
818 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
820 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
823 (*parser
) (buf
, entry_size
, entry
);
829 bfd_sym_fetch_contained_labels_table_entry (bfd
*abfd
,
830 bfd_sym_contained_labels_table_entry
*entry
,
833 void (*parser
) (unsigned char *, size_t, bfd_sym_contained_labels_table_entry
*);
834 unsigned long offset
;
835 unsigned long entry_size
= 0;
836 unsigned char buf
[12];
837 bfd_sym_data_struct
*sdata
= NULL
;
840 BFD_ASSERT (bfd_sym_valid (abfd
));
841 sdata
= abfd
->tdata
.sym_data
;
846 switch (sdata
->version
)
848 case BFD_SYM_VERSION_3_3
:
849 case BFD_SYM_VERSION_3_2
:
851 parser
= bfd_sym_parse_contained_labels_table_entry_v32
;
854 case BFD_SYM_VERSION_3_5
:
855 case BFD_SYM_VERSION_3_4
:
856 case BFD_SYM_VERSION_3_1
:
864 offset
= compute_offset (sdata
->header
.dshb_clte
.dti_first_page
,
865 sdata
->header
.dshb_page_size
,
868 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
870 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
873 (*parser
) (buf
, entry_size
, entry
);
879 bfd_sym_fetch_contained_types_table_entry (bfd
*abfd
,
880 bfd_sym_contained_types_table_entry
*entry
,
883 void (*parser
) (unsigned char *, size_t, bfd_sym_contained_types_table_entry
*);
884 unsigned long offset
;
885 unsigned long entry_size
= 0;
886 unsigned char buf
[0];
887 bfd_sym_data_struct
*sdata
= NULL
;
890 BFD_ASSERT (bfd_sym_valid (abfd
));
891 sdata
= abfd
->tdata
.sym_data
;
896 switch (sdata
->version
)
898 case BFD_SYM_VERSION_3_3
:
899 case BFD_SYM_VERSION_3_2
:
904 case BFD_SYM_VERSION_3_5
:
905 case BFD_SYM_VERSION_3_4
:
906 case BFD_SYM_VERSION_3_1
:
914 offset
= compute_offset (sdata
->header
.dshb_ctte
.dti_first_page
,
915 sdata
->header
.dshb_page_size
,
918 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
920 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
923 (*parser
) (buf
, entry_size
, entry
);
929 bfd_sym_fetch_file_references_index_table_entry (bfd
*abfd
,
930 bfd_sym_file_references_index_table_entry
*entry
,
933 void (*parser
) (unsigned char *, size_t, bfd_sym_file_references_index_table_entry
*);
934 unsigned long offset
;
935 unsigned long entry_size
= 0;
936 unsigned char buf
[0];
937 bfd_sym_data_struct
*sdata
= NULL
;
940 BFD_ASSERT (bfd_sym_valid (abfd
));
941 sdata
= abfd
->tdata
.sym_data
;
946 switch (sdata
->version
)
948 case BFD_SYM_VERSION_3_3
:
949 case BFD_SYM_VERSION_3_2
:
954 case BFD_SYM_VERSION_3_5
:
955 case BFD_SYM_VERSION_3_4
:
956 case BFD_SYM_VERSION_3_1
:
964 offset
= compute_offset (sdata
->header
.dshb_fite
.dti_first_page
,
965 sdata
->header
.dshb_page_size
,
968 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
970 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
973 (*parser
) (buf
, entry_size
, entry
);
979 bfd_sym_fetch_constant_pool_entry (bfd
*abfd
,
980 bfd_sym_constant_pool_entry
*entry
,
983 void (*parser
) (unsigned char *, size_t, bfd_sym_constant_pool_entry
*);
984 unsigned long offset
;
985 unsigned long entry_size
= 0;
986 unsigned char buf
[0];
987 bfd_sym_data_struct
*sdata
= NULL
;
990 BFD_ASSERT (bfd_sym_valid (abfd
));
991 sdata
= abfd
->tdata
.sym_data
;
996 switch (sdata
->version
)
998 case BFD_SYM_VERSION_3_3
:
999 case BFD_SYM_VERSION_3_2
:
1004 case BFD_SYM_VERSION_3_5
:
1005 case BFD_SYM_VERSION_3_4
:
1006 case BFD_SYM_VERSION_3_1
:
1014 offset
= compute_offset (sdata
->header
.dshb_fite
.dti_first_page
,
1015 sdata
->header
.dshb_page_size
,
1018 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
1020 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
1023 (*parser
) (buf
, entry_size
, entry
);
1029 bfd_sym_fetch_type_table_entry (bfd
*abfd
,
1030 bfd_sym_type_table_entry
*entry
,
1031 unsigned long index
)
1033 void (*parser
) (unsigned char *, size_t, bfd_sym_type_table_entry
*);
1034 unsigned long offset
;
1035 unsigned long entry_size
= 0;
1036 unsigned char buf
[4];
1037 bfd_sym_data_struct
*sdata
= NULL
;
1040 BFD_ASSERT (bfd_sym_valid (abfd
));
1041 sdata
= abfd
->tdata
.sym_data
;
1043 switch (sdata
->version
)
1045 case BFD_SYM_VERSION_3_3
:
1046 case BFD_SYM_VERSION_3_2
:
1048 parser
= bfd_sym_parse_type_table_entry_v32
;
1051 case BFD_SYM_VERSION_3_5
:
1052 case BFD_SYM_VERSION_3_4
:
1053 case BFD_SYM_VERSION_3_1
:
1061 offset
= compute_offset (sdata
->header
.dshb_tte
.dti_first_page
,
1062 sdata
->header
.dshb_page_size
,
1065 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
1067 if (bfd_bread (buf
, entry_size
, abfd
) != entry_size
)
1070 (*parser
) (buf
, entry_size
, entry
);
1076 bfd_sym_fetch_type_information_table_entry (bfd
*abfd
,
1077 bfd_sym_type_information_table_entry
*entry
,
1078 unsigned long offset
)
1080 unsigned char buf
[4];
1081 bfd_sym_data_struct
*sdata
= NULL
;
1083 BFD_ASSERT (bfd_sym_valid (abfd
));
1084 sdata
= abfd
->tdata
.sym_data
;
1089 if (bfd_seek (abfd
, offset
, SEEK_SET
) < 0)
1092 if (bfd_bread (buf
, 4, abfd
) != 4)
1094 entry
->nte_index
= bfd_getb32 (buf
);
1096 if (bfd_bread (buf
, 2, abfd
) != 2)
1098 entry
->physical_size
= bfd_getb16 (buf
);
1100 if (entry
->physical_size
& 0x8000)
1102 if (bfd_bread (buf
, 4, abfd
) != 4)
1104 entry
->physical_size
&= 0x7fff;
1105 entry
->logical_size
= bfd_getb32 (buf
);
1106 entry
->offset
= offset
+ 10;
1110 if (bfd_bread (buf
, 2, abfd
) != 2)
1112 entry
->physical_size
&= 0x7fff;
1113 entry
->logical_size
= bfd_getb16 (buf
);
1114 entry
->offset
= offset
+ 8;
1121 bfd_sym_fetch_type_table_information (bfd
*abfd
,
1122 bfd_sym_type_information_table_entry
*entry
,
1123 unsigned long index
)
1125 bfd_sym_type_table_entry tindex
;
1126 bfd_sym_data_struct
*sdata
= NULL
;
1128 BFD_ASSERT (bfd_sym_valid (abfd
));
1129 sdata
= abfd
->tdata
.sym_data
;
1131 if (sdata
->header
.dshb_tte
.dti_object_count
<= 99)
1136 if (bfd_sym_fetch_type_table_entry (abfd
, &tindex
, index
- 100) < 0)
1138 if (bfd_sym_fetch_type_information_table_entry (abfd
, entry
, tindex
) < 0)
1144 const unsigned char *
1145 bfd_sym_symbol_name (bfd
*abfd
, unsigned long index
)
1147 bfd_sym_data_struct
*sdata
= NULL
;
1149 BFD_ASSERT (bfd_sym_valid (abfd
));
1150 sdata
= abfd
->tdata
.sym_data
;
1153 return (const unsigned char *) "";
1156 if ((index
/ sdata
->header
.dshb_page_size
)
1157 > sdata
->header
.dshb_nte
.dti_page_count
)
1158 return (const unsigned char *) "\09[INVALID]";
1160 return (const unsigned char *) sdata
->name_table
+ index
;
1163 const unsigned char *
1164 bfd_sym_module_name (bfd
*abfd
, unsigned long index
)
1166 bfd_sym_modules_table_entry entry
;
1168 if (bfd_sym_fetch_modules_table_entry (abfd
, &entry
, index
) < 0)
1169 return (const unsigned char *) "\09[INVALID]";
1171 return bfd_sym_symbol_name (abfd
, entry
.mte_nte_index
);
1175 bfd_sym_unparse_storage_kind (enum bfd_sym_storage_kind kind
)
1179 case BFD_SYM_STORAGE_KIND_LOCAL
: return "LOCAL";
1180 case BFD_SYM_STORAGE_KIND_VALUE
: return "VALUE";
1181 case BFD_SYM_STORAGE_KIND_REFERENCE
: return "REFERENCE";
1182 case BFD_SYM_STORAGE_KIND_WITH
: return "WITH";
1183 default: return "[UNKNOWN]";
1188 bfd_sym_unparse_storage_class (enum bfd_sym_storage_class kind
)
1192 case BFD_SYM_STORAGE_CLASS_REGISTER
: return "REGISTER";
1193 case BFD_SYM_STORAGE_CLASS_GLOBAL
: return "GLOBAL";
1194 case BFD_SYM_STORAGE_CLASS_FRAME_RELATIVE
: return "FRAME_RELATIVE";
1195 case BFD_SYM_STORAGE_CLASS_STACK_RELATIVE
: return "STACK_RELATIVE";
1196 case BFD_SYM_STORAGE_CLASS_ABSOLUTE
: return "ABSOLUTE";
1197 case BFD_SYM_STORAGE_CLASS_CONSTANT
: return "CONSTANT";
1198 case BFD_SYM_STORAGE_CLASS_RESOURCE
: return "RESOURCE";
1199 case BFD_SYM_STORAGE_CLASS_BIGCONSTANT
: return "BIGCONSTANT";
1200 default: return "[UNKNOWN]";
1205 bfd_sym_unparse_module_kind (enum bfd_sym_module_kind kind
)
1209 case BFD_SYM_MODULE_KIND_NONE
: return "NONE";
1210 case BFD_SYM_MODULE_KIND_PROGRAM
: return "PROGRAM";
1211 case BFD_SYM_MODULE_KIND_UNIT
: return "UNIT";
1212 case BFD_SYM_MODULE_KIND_PROCEDURE
: return "PROCEDURE";
1213 case BFD_SYM_MODULE_KIND_FUNCTION
: return "FUNCTION";
1214 case BFD_SYM_MODULE_KIND_DATA
: return "DATA";
1215 case BFD_SYM_MODULE_KIND_BLOCK
: return "BLOCK";
1216 default: return "[UNKNOWN]";
1221 bfd_sym_unparse_symbol_scope (enum bfd_sym_symbol_scope scope
)
1225 case BFD_SYM_SYMBOL_SCOPE_LOCAL
: return "LOCAL";
1226 case BFD_SYM_SYMBOL_SCOPE_GLOBAL
: return "GLOBAL";
1233 bfd_sym_print_file_reference (bfd
*abfd
,
1235 bfd_sym_file_reference
*entry
)
1237 bfd_sym_file_references_table_entry frtentry
;
1240 ret
= bfd_sym_fetch_file_references_table_entry (abfd
, &frtentry
,
1241 entry
->fref_frte_index
);
1242 fprintf (f
, "FILE ");
1244 if ((ret
< 0) || (frtentry
.generic
.type
!= BFD_SYM_FILE_NAME_INDEX
))
1245 fprintf (f
, "[INVALID]");
1247 fprintf (f
, "\"%.*s\"",
1248 bfd_sym_symbol_name (abfd
, frtentry
.filename
.nte_index
)[0],
1249 &bfd_sym_symbol_name (abfd
, frtentry
.filename
.nte_index
)[1]);
1251 fprintf (f
, " (FRTE %lu)", entry
->fref_frte_index
);
1255 bfd_sym_print_resources_table_entry (bfd
*abfd
,
1257 bfd_sym_resources_table_entry
*entry
)
1259 fprintf (f
, " \"%.*s\" (NTE %lu), type \"%.4s\", num %u, size %lu, MTE %lu -- %lu",
1260 bfd_sym_symbol_name (abfd
, entry
->rte_nte_index
)[0],
1261 &bfd_sym_symbol_name (abfd
, entry
->rte_nte_index
)[1],
1262 entry
->rte_nte_index
, entry
->rte_res_type
, entry
->rte_res_number
,
1263 entry
->rte_res_size
, entry
->rte_mte_first
, entry
->rte_mte_last
);
1267 bfd_sym_print_modules_table_entry (bfd
*abfd
,
1269 bfd_sym_modules_table_entry
*entry
)
1271 fprintf (f
, "\"%.*s\" (NTE %lu)",
1272 bfd_sym_symbol_name (abfd
, entry
->mte_nte_index
)[0],
1273 &bfd_sym_symbol_name (abfd
, entry
->mte_nte_index
)[1],
1274 entry
->mte_nte_index
);
1278 bfd_sym_print_file_reference (abfd
, f
, &entry
->mte_imp_fref
);
1279 fprintf (f
, " range %lu -- %lu",
1280 entry
->mte_imp_fref
.fref_offset
, entry
->mte_imp_end
);
1284 fprintf (f
, "kind %s", bfd_sym_unparse_module_kind (entry
->mte_kind
));
1285 fprintf (f
, ", scope %s", bfd_sym_unparse_symbol_scope (entry
->mte_scope
));
1287 fprintf (f
, ", RTE %lu, offset %lu, size %lu",
1288 entry
->mte_rte_index
, entry
->mte_res_offset
, entry
->mte_size
);
1292 fprintf (f
, "CMTE %lu, CVTE %lu, CLTE %lu, CTTE %lu, CSNTE1 %lu, CSNTE2 %lu",
1293 entry
->mte_cmte_index
, entry
->mte_cvte_index
,
1294 entry
->mte_clte_index
, entry
->mte_ctte_index
,
1295 entry
->mte_csnte_idx_1
, entry
->mte_csnte_idx_2
);
1297 if (entry
->mte_parent
!= 0)
1298 fprintf (f
, ", parent %lu", entry
->mte_parent
);
1300 fprintf (f
, ", no parent");
1302 if (entry
->mte_cmte_index
!= 0)
1303 fprintf (f
, ", child %lu", entry
->mte_cmte_index
);
1305 fprintf (f
, ", no child");
1309 bfd_sym_print_file_references_table_entry (bfd
*abfd
,
1311 bfd_sym_file_references_table_entry
*entry
)
1313 switch (entry
->generic
.type
)
1315 case BFD_SYM_FILE_NAME_INDEX
:
1316 fprintf (f
, "FILE \"%.*s\" (NTE %lu), modtime ",
1317 bfd_sym_symbol_name (abfd
, entry
->filename
.nte_index
)[0],
1318 &bfd_sym_symbol_name (abfd
, entry
->filename
.nte_index
)[1],
1319 entry
->filename
.nte_index
);
1321 fprintf (f
, "[UNIMPLEMENTED]");
1322 /* printModDate (entry->filename.mod_date); */
1323 fprintf (f
, " (0x%lx)", entry
->filename
.mod_date
);
1326 case BFD_SYM_END_OF_LIST
:
1331 fprintf (f
, "\"%.*s\" (MTE %lu), offset %lu",
1332 bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[0],
1333 &bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[1],
1334 entry
->entry
.mte_index
,
1335 entry
->entry
.file_offset
);
1341 bfd_sym_print_contained_modules_table_entry (bfd
*abfd
,
1343 bfd_sym_contained_modules_table_entry
*entry
)
1345 switch (entry
->generic
.type
)
1347 case BFD_SYM_END_OF_LIST
:
1352 fprintf (f
, "\"%.*s\" (MTE %lu, NTE %lu)",
1353 bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[0],
1354 &bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[1],
1355 entry
->entry
.mte_index
,
1356 entry
->entry
.nte_index
);
1362 bfd_sym_print_contained_variables_table_entry (bfd
*abfd
,
1364 bfd_sym_contained_variables_table_entry
*entry
)
1366 if (entry
->generic
.type
== BFD_SYM_END_OF_LIST
)
1372 if (entry
->generic
.type
== BFD_SYM_SOURCE_FILE_CHANGE
)
1374 bfd_sym_print_file_reference (abfd
, f
, &entry
->file
.fref
);
1375 fprintf (f
, " offset %lu", entry
->file
.fref
.fref_offset
);
1379 fprintf (f
, "\"%.*s\" (NTE %lu)",
1380 bfd_sym_symbol_name (abfd
, entry
->entry
.nte_index
)[0],
1381 &bfd_sym_symbol_name (abfd
, entry
->entry
.nte_index
)[1],
1382 entry
->entry
.nte_index
);
1384 fprintf (f
, ", TTE %lu", entry
->entry
.tte_index
);
1385 fprintf (f
, ", offset %lu", entry
->entry
.file_delta
);
1386 fprintf (f
, ", scope %s", bfd_sym_unparse_symbol_scope (entry
->entry
.scope
));
1388 if (entry
->entry
.la_size
== BFD_SYM_CVTE_SCA
)
1389 fprintf (f
, ", latype %s, laclass %s, laoffset %lu",
1390 bfd_sym_unparse_storage_kind (entry
->entry
.address
.scstruct
.sca_kind
),
1391 bfd_sym_unparse_storage_class (entry
->entry
.address
.scstruct
.sca_class
),
1392 entry
->entry
.address
.scstruct
.sca_offset
);
1393 else if (entry
->entry
.la_size
<= BFD_SYM_CVTE_LA_MAX_SIZE
)
1397 fprintf (f
, ", la [");
1398 for (i
= 0; i
< entry
->entry
.la_size
; i
++)
1399 fprintf (f
, "0x%02x ", entry
->entry
.address
.lastruct
.la
[i
]);
1402 else if (entry
->entry
.la_size
== BFD_SYM_CVTE_BIG_LA
)
1403 fprintf (f
, ", bigla %lu, biglakind %u",
1404 entry
->entry
.address
.biglastruct
.big_la
,
1405 entry
->entry
.address
.biglastruct
.big_la_kind
);
1408 fprintf (f
, ", la [INVALID]");
1412 bfd_sym_print_contained_statements_table_entry (bfd
*abfd
,
1414 bfd_sym_contained_statements_table_entry
*entry
)
1416 if (entry
->generic
.type
== BFD_SYM_END_OF_LIST
)
1422 if (entry
->generic
.type
== BFD_SYM_SOURCE_FILE_CHANGE
)
1424 bfd_sym_print_file_reference (abfd
, f
, &entry
->file
.fref
);
1425 fprintf (f
, " offset %lu", entry
->file
.fref
.fref_offset
);
1429 fprintf (f
, "\"%.*s\" (MTE %lu), offset %lu, delta %lu",
1430 bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[0],
1431 &bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[1],
1432 entry
->entry
.mte_index
,
1433 entry
->entry
.mte_offset
,
1434 entry
->entry
.file_delta
);
1438 bfd_sym_print_contained_labels_table_entry (bfd
*abfd
,
1440 bfd_sym_contained_labels_table_entry
*entry
)
1442 if (entry
->generic
.type
== BFD_SYM_END_OF_LIST
)
1448 if (entry
->generic
.type
== BFD_SYM_SOURCE_FILE_CHANGE
)
1450 bfd_sym_print_file_reference (abfd
, f
, &entry
->file
.fref
);
1451 fprintf (f
, " offset %lu", entry
->file
.fref
.fref_offset
);
1455 fprintf (f
, "\"%.*s\" (MTE %lu), offset %lu, delta %lu, scope %s",
1456 bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[0],
1457 &bfd_sym_module_name (abfd
, entry
->entry
.mte_index
)[1],
1458 entry
->entry
.mte_index
,
1459 entry
->entry
.mte_offset
,
1460 entry
->entry
.file_delta
,
1461 bfd_sym_unparse_symbol_scope (entry
->entry
.scope
));
1465 bfd_sym_print_contained_types_table_entry (bfd
*abfd ATTRIBUTE_UNUSED
,
1467 bfd_sym_contained_types_table_entry
*entry ATTRIBUTE_UNUSED
)
1469 fprintf (f
, "[UNIMPLEMENTED]");
1473 bfd_sym_type_operator_name (unsigned char num
)
1477 case 1: return "TTE";
1478 case 2: return "PointerTo";
1479 case 3: return "ScalarOf";
1480 case 4: return "ConstantOf";
1481 case 5: return "EnumerationOf";
1482 case 6: return "VectorOf";
1483 case 7: return "RecordOf";
1484 case 8: return "UnionOf";
1485 case 9: return "SubRangeOf";
1486 case 10: return "SetOf";
1487 case 11: return "NamedTypeOf";
1488 case 12: return "ProcOf";
1489 case 13: return "ValueOf";
1490 case 14: return "ArrayOf";
1491 default: return "[UNKNOWN OPERATOR]";
1496 bfd_sym_type_basic_name (unsigned char num
)
1500 case 0: return "void";
1501 case 1: return "pascal string";
1502 case 2: return "unsigned long";
1503 case 3: return "signed long";
1504 case 4: return "extended (10 bytes)";
1505 case 5: return "pascal boolean (1 byte)";
1506 case 6: return "unsigned byte";
1507 case 7: return "signed byte";
1508 case 8: return "character (1 byte)";
1509 case 9: return "wide character (2 bytes)";
1510 case 10: return "unsigned short";
1511 case 11: return "signed short";
1512 case 12: return "singled";
1513 case 13: return "double";
1514 case 14: return "extended (12 bytes)";
1515 case 15: return "computational (8 bytes)";
1516 case 16: return "c string";
1517 case 17: return "as-is string";
1518 default: return "[UNKNOWN BASIC TYPE]";
1523 bfd_sym_fetch_long (unsigned char *buf
,
1525 unsigned long offset
,
1526 unsigned long *offsetptr
,
1537 else if (! (buf
[offset
] & 0x80))
1539 *value
= buf
[offset
];
1543 else if (buf
[offset
] == 0xc0)
1545 if ((offset
+ 5) > len
)
1553 *value
= bfd_getb32 (buf
+ offset
+ 1);
1558 else if ((buf
[offset
] & 0xc0) == 0xc0)
1560 *value
= -(buf
[offset
] & 0x3f);
1564 else if ((buf
[offset
] & 0xc0) == 0x80)
1566 if ((offset
+ 2) > len
)
1574 *value
= bfd_getb16 (buf
+ offset
) & 0x3fff;
1582 if (offsetptr
!= NULL
)
1583 *offsetptr
= offset
;
1589 bfd_sym_print_type_information (bfd
*abfd
,
1593 unsigned long offset
,
1594 unsigned long *offsetptr
)
1600 fprintf (f
, "[NULL]");
1602 if (offsetptr
!= NULL
)
1603 *offsetptr
= offset
;
1610 if (! (type
& 0x80))
1612 fprintf (f
, "[%s] (0x%x)", bfd_sym_type_basic_name (type
& 0x7f), type
);
1614 if (offsetptr
!= NULL
)
1615 *offsetptr
= offset
;
1620 fprintf (f
, "[packed ");
1624 switch (type
& 0x3f)
1629 bfd_sym_type_information_table_entry tinfo
;
1631 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &value
);
1633 fprintf (f
, "[INVALID]");
1636 if (bfd_sym_fetch_type_table_information (abfd
, &tinfo
, value
) < 0)
1637 fprintf (f
, "[INVALID]");
1639 fprintf (f
, "\"%.*s\"",
1640 bfd_sym_symbol_name (abfd
, tinfo
.nte_index
)[0],
1641 &bfd_sym_symbol_name (abfd
, tinfo
.nte_index
)[1]);
1643 fprintf (f
, " (TTE %lu)", (unsigned long) value
);
1648 fprintf (f
, "pointer (0x%x) to ", type
);
1649 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1656 fprintf (f
, "scalar (0x%x) of ", type
);
1657 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1658 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &value
);
1659 fprintf (f
, " (%lu)", (unsigned long) value
);
1665 long lower
, upper
, nelem
;
1668 fprintf (f
, "enumeration (0x%x) of ", type
);
1669 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1670 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &lower
);
1671 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &upper
);
1672 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &nelem
);
1673 fprintf (f
, " from %lu to %lu with %lu elements: ",
1674 (unsigned long) lower
, (unsigned long) upper
,
1675 (unsigned long) nelem
);
1677 for (i
= 0; i
< nelem
; i
++)
1680 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1686 fprintf (f
, "vector (0x%x)", type
);
1687 fprintf (f
, "\n index ");
1688 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1689 fprintf (f
, "\n target ");
1690 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1696 long nrec
, eloff
, i
;
1698 if ((type
& 0x3f) == 7)
1699 fprintf (f
, "record (0x%x) of ", type
);
1701 fprintf (f
, "union (0x%x) of ", type
);
1703 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &nrec
);
1704 fprintf (f
, "%lu elements: ", (unsigned long) nrec
);
1706 for (i
= 0; i
< nrec
; i
++)
1708 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &eloff
);
1710 fprintf (f
, "offset %lu: ", (unsigned long) eloff
);
1711 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1717 fprintf (f
, "subrange (0x%x) of ", type
);
1718 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1719 fprintf (f
, " lower ");
1720 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1721 fprintf (f
, " upper ");
1722 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1729 fprintf (f
, "named type (0x%x) ", type
);
1730 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &value
);
1732 fprintf (f
, "[INVALID]");
1734 fprintf (f
, "\"%.*s\"",
1735 bfd_sym_symbol_name (abfd
, value
)[0],
1736 &bfd_sym_symbol_name (abfd
, value
)[1]);
1738 fprintf (f
, " (NTE %lu) with type ", (unsigned long) value
);
1739 bfd_sym_print_type_information (abfd
, f
, buf
, len
, offset
, &offset
);
1744 fprintf (f
, "%s (0x%x)", bfd_sym_type_operator_name (type
), type
);
1748 if (type
== (0x40 | 0x6))
1755 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &n
);
1756 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &width
);
1757 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &m
);
1758 /* fprintf (f, "\n "); */
1759 fprintf (f
, " N %ld, width %ld, M %ld, ", n
, width
, m
);
1760 for (i
= 0; i
< m
; i
++)
1762 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &l
);
1765 fprintf (f
, "%ld", l
);
1768 else if (type
& 0x40)
1770 /* Other packed type. */
1773 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &msb
);
1774 bfd_sym_fetch_long (buf
, len
, offset
, &offset
, &lsb
);
1775 /* fprintf (f, "\n "); */
1776 fprintf (f
, " msb %ld, lsb %ld", msb
, lsb
);
1781 if (offsetptr
!= NULL
)
1782 *offsetptr
= offset
;
1786 bfd_sym_print_type_information_table_entry (bfd
*abfd
,
1788 bfd_sym_type_information_table_entry
*entry
)
1791 unsigned long offset
;
1794 fprintf (f
, "\"%.*s\" (NTE %lu), %lu bytes at %lu, logical size %lu",
1795 bfd_sym_symbol_name (abfd
, entry
->nte_index
)[0],
1796 &bfd_sym_symbol_name (abfd
, entry
->nte_index
)[1],
1798 entry
->physical_size
, entry
->offset
, entry
->logical_size
);
1802 buf
= alloca (entry
->physical_size
);
1805 fprintf (f
, "[ERROR]\n");
1808 if (bfd_seek (abfd
, entry
->offset
, SEEK_SET
) < 0)
1810 fprintf (f
, "[ERROR]\n");
1813 if (bfd_bread (buf
, entry
->physical_size
, abfd
) != entry
->physical_size
)
1815 fprintf (f
, "[ERROR]\n");
1820 for (i
= 0; i
< entry
->physical_size
; i
++)
1823 fprintf (f
, "0x%02x", buf
[i
]);
1825 fprintf (f
, " 0x%02x", buf
[i
]);
1831 bfd_sym_print_type_information (abfd
, f
, buf
, entry
->physical_size
, 0, &offset
);
1833 if (offset
!= entry
->physical_size
)
1834 fprintf (f
, "\n [parser used %lu bytes instead of %lu]", offset
, entry
->physical_size
);
1838 bfd_sym_print_file_references_index_table_entry (bfd
*abfd ATTRIBUTE_UNUSED
,
1840 bfd_sym_file_references_index_table_entry
*entry ATTRIBUTE_UNUSED
)
1842 fprintf (f
, "[UNIMPLEMENTED]");
1846 bfd_sym_print_constant_pool_entry (bfd
*abfd ATTRIBUTE_UNUSED
,
1848 bfd_sym_constant_pool_entry
*entry ATTRIBUTE_UNUSED
)
1850 fprintf (f
, "[UNIMPLEMENTED]");
1854 bfd_sym_display_name_table_entry (bfd
*abfd
,
1856 unsigned char *entry
)
1858 unsigned long index
;
1859 unsigned long offset
;
1860 bfd_sym_data_struct
*sdata
= NULL
;
1862 BFD_ASSERT (bfd_sym_valid (abfd
));
1863 sdata
= abfd
->tdata
.sym_data
;
1864 index
= (entry
- sdata
->name_table
) / 2;
1866 if (sdata
->version
>= BFD_SYM_VERSION_3_4
&& entry
[0] == 255 && entry
[1] == 0)
1868 unsigned short length
= bfd_getb16 (entry
+ 2);
1869 fprintf (f
, "[%8lu] \"%.*s\"\n", index
, length
, entry
+ 4);
1870 offset
= 2 + length
+ 1;
1874 if (! (entry
[0] == 0 || (entry
[0] == 1 && entry
[1] == '\0')))
1875 fprintf (f
, "[%8lu] \"%.*s\"\n", index
, entry
[0], entry
+ 1);
1877 if (sdata
->version
>= BFD_SYM_VERSION_3_4
)
1878 offset
= entry
[0] + 2;
1880 offset
= entry
[0] + 1;
1883 return (entry
+ offset
+ (offset
% 2));
1887 bfd_sym_display_name_table (bfd
*abfd
, FILE *f
)
1889 unsigned long name_table_len
;
1890 unsigned char *name_table
, *name_table_end
, *cur
;
1891 bfd_sym_data_struct
*sdata
= NULL
;
1893 BFD_ASSERT (bfd_sym_valid (abfd
));
1894 sdata
= abfd
->tdata
.sym_data
;
1896 name_table_len
= sdata
->header
.dshb_nte
.dti_page_count
* sdata
->header
.dshb_page_size
;
1897 name_table
= sdata
->name_table
;
1898 name_table_end
= name_table
+ name_table_len
;
1900 fprintf (f
, "name table (NTE) contains %lu bytes:\n\n", name_table_len
);
1905 cur
= bfd_sym_display_name_table_entry (abfd
, f
, cur
);
1906 if (cur
>= name_table_end
)
1912 bfd_sym_display_resources_table (bfd
*abfd
, FILE *f
)
1915 bfd_sym_resources_table_entry entry
;
1916 bfd_sym_data_struct
*sdata
= NULL
;
1918 BFD_ASSERT (bfd_sym_valid (abfd
));
1919 sdata
= abfd
->tdata
.sym_data
;
1921 fprintf (f
, "resource table (RTE) contains %lu objects:\n\n",
1922 sdata
->header
.dshb_rte
.dti_object_count
);
1924 for (i
= 1; i
<= sdata
->header
.dshb_rte
.dti_object_count
; i
++)
1926 if (bfd_sym_fetch_resources_table_entry (abfd
, &entry
, i
) < 0)
1927 fprintf (f
, " [%8lu] [INVALID]\n", i
);
1930 fprintf (f
, " [%8lu] ", i
);
1931 bfd_sym_print_resources_table_entry (abfd
, f
, &entry
);
1938 bfd_sym_display_modules_table (bfd
*abfd
, FILE *f
)
1941 bfd_sym_modules_table_entry entry
;
1942 bfd_sym_data_struct
*sdata
= NULL
;
1944 BFD_ASSERT (bfd_sym_valid (abfd
));
1945 sdata
= abfd
->tdata
.sym_data
;
1947 fprintf (f
, "module table (MTE) contains %lu objects:\n\n",
1948 sdata
->header
.dshb_mte
.dti_object_count
);
1950 for (i
= 1; i
<= sdata
->header
.dshb_mte
.dti_object_count
; i
++)
1952 if (bfd_sym_fetch_modules_table_entry (abfd
, &entry
, i
) < 0)
1953 fprintf (f
, " [%8lu] [INVALID]\n", i
);
1956 fprintf (f
, " [%8lu] ", i
);
1957 bfd_sym_print_modules_table_entry (abfd
, f
, &entry
);
1964 bfd_sym_display_file_references_table (bfd
*abfd
, FILE *f
)
1967 bfd_sym_file_references_table_entry entry
;
1968 bfd_sym_data_struct
*sdata
= NULL
;
1970 BFD_ASSERT (bfd_sym_valid (abfd
));
1971 sdata
= abfd
->tdata
.sym_data
;
1973 fprintf (f
, "file reference table (FRTE) contains %lu objects:\n\n",
1974 sdata
->header
.dshb_frte
.dti_object_count
);
1976 for (i
= 1; i
<= sdata
->header
.dshb_frte
.dti_object_count
; i
++)
1978 if (bfd_sym_fetch_file_references_table_entry (abfd
, &entry
, i
) < 0)
1979 fprintf (f
, " [%8lu] [INVALID]\n", i
);
1982 fprintf (f
, " [%8lu] ", i
);
1983 bfd_sym_print_file_references_table_entry (abfd
, f
, &entry
);
1990 bfd_sym_display_contained_modules_table (bfd
*abfd
, FILE *f
)
1993 bfd_sym_contained_modules_table_entry entry
;
1994 bfd_sym_data_struct
*sdata
= NULL
;
1996 BFD_ASSERT (bfd_sym_valid (abfd
));
1997 sdata
= abfd
->tdata
.sym_data
;
1999 fprintf (f
, "contained modules table (CMTE) contains %lu objects:\n\n",
2000 sdata
->header
.dshb_cmte
.dti_object_count
);
2002 for (i
= 1; i
<= sdata
->header
.dshb_cmte
.dti_object_count
; i
++)
2004 if (bfd_sym_fetch_contained_modules_table_entry (abfd
, &entry
, i
) < 0)
2005 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2008 fprintf (f
, " [%8lu] ", i
);
2009 bfd_sym_print_contained_modules_table_entry (abfd
, f
, &entry
);
2016 bfd_sym_display_contained_variables_table (bfd
*abfd
, FILE *f
)
2019 bfd_sym_contained_variables_table_entry entry
;
2020 bfd_sym_data_struct
*sdata
= NULL
;
2022 BFD_ASSERT (bfd_sym_valid (abfd
));
2023 sdata
= abfd
->tdata
.sym_data
;
2025 fprintf (f
, "contained variables table (CVTE) contains %lu objects:\n\n",
2026 sdata
->header
.dshb_cvte
.dti_object_count
);
2028 for (i
= 1; i
<= sdata
->header
.dshb_cvte
.dti_object_count
; i
++)
2030 if (bfd_sym_fetch_contained_variables_table_entry (abfd
, &entry
, i
) < 0)
2031 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2034 fprintf (f
, " [%8lu] ", i
);
2035 bfd_sym_print_contained_variables_table_entry (abfd
, f
, &entry
);
2044 bfd_sym_display_contained_statements_table (bfd
*abfd
, FILE *f
)
2047 bfd_sym_contained_statements_table_entry entry
;
2048 bfd_sym_data_struct
*sdata
= NULL
;
2050 BFD_ASSERT (bfd_sym_valid (abfd
));
2051 sdata
= abfd
->tdata
.sym_data
;
2053 fprintf (f
, "contained statements table (CSNTE) contains %lu objects:\n\n",
2054 sdata
->header
.dshb_csnte
.dti_object_count
);
2056 for (i
= 1; i
<= sdata
->header
.dshb_csnte
.dti_object_count
; i
++)
2058 if (bfd_sym_fetch_contained_statements_table_entry (abfd
, &entry
, i
) < 0)
2059 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2062 fprintf (f
, " [%8lu] ", i
);
2063 bfd_sym_print_contained_statements_table_entry (abfd
, f
, &entry
);
2070 bfd_sym_display_contained_labels_table (bfd
*abfd
, FILE *f
)
2073 bfd_sym_contained_labels_table_entry entry
;
2074 bfd_sym_data_struct
*sdata
= NULL
;
2076 BFD_ASSERT (bfd_sym_valid (abfd
));
2077 sdata
= abfd
->tdata
.sym_data
;
2079 fprintf (f
, "contained labels table (CLTE) contains %lu objects:\n\n",
2080 sdata
->header
.dshb_clte
.dti_object_count
);
2082 for (i
= 1; i
<= sdata
->header
.dshb_clte
.dti_object_count
; i
++)
2084 if (bfd_sym_fetch_contained_labels_table_entry (abfd
, &entry
, i
) < 0)
2085 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2088 fprintf (f
, " [%8lu] ", i
);
2089 bfd_sym_print_contained_labels_table_entry (abfd
, f
, &entry
);
2096 bfd_sym_display_contained_types_table (bfd
*abfd
, FILE *f
)
2099 bfd_sym_contained_types_table_entry entry
;
2100 bfd_sym_data_struct
*sdata
= NULL
;
2102 BFD_ASSERT (bfd_sym_valid (abfd
));
2103 sdata
= abfd
->tdata
.sym_data
;
2105 fprintf (f
, "contained types table (CTTE) contains %lu objects:\n\n",
2106 sdata
->header
.dshb_ctte
.dti_object_count
);
2108 for (i
= 1; i
<= sdata
->header
.dshb_ctte
.dti_object_count
; i
++)
2110 if (bfd_sym_fetch_contained_types_table_entry (abfd
, &entry
, i
) < 0)
2111 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2114 fprintf (f
, " [%8lu] ", i
);
2115 bfd_sym_print_contained_types_table_entry (abfd
, f
, &entry
);
2122 bfd_sym_display_file_references_index_table (bfd
*abfd
, FILE *f
)
2125 bfd_sym_file_references_index_table_entry entry
;
2126 bfd_sym_data_struct
*sdata
= NULL
;
2128 BFD_ASSERT (bfd_sym_valid (abfd
));
2129 sdata
= abfd
->tdata
.sym_data
;
2131 fprintf (f
, "file references index table (FITE) contains %lu objects:\n\n",
2132 sdata
->header
.dshb_fite
.dti_object_count
);
2134 for (i
= 1; i
<= sdata
->header
.dshb_fite
.dti_object_count
; i
++)
2136 if (bfd_sym_fetch_file_references_index_table_entry (abfd
, &entry
, i
) < 0)
2137 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2140 fprintf (f
, " [%8lu] ", i
);
2141 bfd_sym_print_file_references_index_table_entry (abfd
, f
, &entry
);
2148 bfd_sym_display_constant_pool (bfd
*abfd
, FILE *f
)
2151 bfd_sym_constant_pool_entry entry
;
2152 bfd_sym_data_struct
*sdata
= NULL
;
2154 BFD_ASSERT (bfd_sym_valid (abfd
));
2155 sdata
= abfd
->tdata
.sym_data
;
2157 fprintf (f
, "constant pool (CONST) contains %lu objects:\n\n",
2158 sdata
->header
.dshb_const
.dti_object_count
);
2160 for (i
= 1; i
<= sdata
->header
.dshb_const
.dti_object_count
; i
++)
2162 if (bfd_sym_fetch_constant_pool_entry (abfd
, &entry
, i
) < 0)
2163 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2166 fprintf (f
, " [%8lu] ", i
);
2167 bfd_sym_print_constant_pool_entry (abfd
, f
, &entry
);
2174 bfd_sym_display_type_information_table (bfd
*abfd
, FILE *f
)
2177 bfd_sym_type_table_entry index
;
2178 bfd_sym_type_information_table_entry entry
;
2179 bfd_sym_data_struct
*sdata
= NULL
;
2181 BFD_ASSERT (bfd_sym_valid (abfd
));
2182 sdata
= abfd
->tdata
.sym_data
;
2184 if (sdata
->header
.dshb_tte
.dti_object_count
> 99)
2185 fprintf (f
, "type table (TINFO) contains %lu objects:\n\n",
2186 sdata
->header
.dshb_tte
.dti_object_count
- 99);
2189 fprintf (f
, "type table (TINFO) contains [INVALID] objects:\n\n");
2193 for (i
= 100; i
<= sdata
->header
.dshb_tte
.dti_object_count
; i
++)
2195 if (bfd_sym_fetch_type_table_entry (abfd
, &index
, i
- 100) < 0)
2196 fprintf (f
, " [%8lu] [INVALID]\n", i
);
2199 fprintf (f
, " [%8lu] (TINFO %lu) ", i
, index
);
2201 if (bfd_sym_fetch_type_information_table_entry (abfd
, &entry
, index
) < 0)
2202 fprintf (f
, "[INVALID]");
2204 bfd_sym_print_type_information_table_entry (abfd
, f
, &entry
);
2212 bfd_sym_scan (bfd
*abfd
, bfd_sym_version version
, bfd_sym_data_struct
*mdata
)
2215 const char *name
= "symbols";
2217 mdata
->name_table
= 0;
2219 mdata
->version
= version
;
2221 bfd_seek (abfd
, 0, SEEK_SET
);
2222 if (bfd_sym_read_header (abfd
, &mdata
->header
, mdata
->version
) != 0)
2225 mdata
->name_table
= bfd_sym_read_name_table (abfd
, &mdata
->header
);
2226 if (mdata
->name_table
== NULL
)
2229 bfdsec
= bfd_make_section_anyway_with_flags (abfd
, name
, SEC_HAS_CONTENTS
);
2236 bfdsec
->filepos
= 0;
2237 bfdsec
->alignment_power
= 0;
2239 abfd
->tdata
.sym_data
= mdata
;
2245 bfd_sym_object_p (bfd
*abfd
)
2247 struct bfd_preserve preserve
;
2248 bfd_sym_version version
= -1;
2250 preserve
.marker
= NULL
;
2251 bfd_seek (abfd
, 0, SEEK_SET
);
2252 if (bfd_sym_read_version (abfd
, &version
) != 0)
2255 preserve
.marker
= bfd_alloc (abfd
, sizeof (bfd_sym_data_struct
));
2256 if (preserve
.marker
== NULL
2257 || ! bfd_preserve_save (abfd
, &preserve
))
2260 if (bfd_sym_scan (abfd
, version
,
2261 (bfd_sym_data_struct
*) preserve
.marker
) != 0)
2264 bfd_preserve_finish (abfd
, &preserve
);
2268 bfd_set_error (bfd_error_wrong_format
);
2271 if (preserve
.marker
!= NULL
)
2272 bfd_preserve_restore (abfd
, &preserve
);
2276 #define bfd_sym_make_empty_symbol _bfd_generic_make_empty_symbol
2279 bfd_sym_get_symbol_info (bfd
*abfd ATTRIBUTE_UNUSED
, asymbol
*symbol
, symbol_info
*ret
)
2281 bfd_symbol_info (symbol
, ret
);
2285 bfd_sym_get_symtab_upper_bound (bfd
*abfd ATTRIBUTE_UNUSED
)
2291 bfd_sym_canonicalize_symtab (bfd
*abfd ATTRIBUTE_UNUSED
, asymbol
**sym ATTRIBUTE_UNUSED
)
2297 bfd_sym_sizeof_headers (bfd
*abfd ATTRIBUTE_UNUSED
,
2298 struct bfd_link_info
*info ATTRIBUTE_UNUSED
)
2303 const bfd_target sym_vec
=
2306 bfd_target_sym_flavour
, /* Flavour. */
2307 BFD_ENDIAN_BIG
, /* Byteorder. */
2308 BFD_ENDIAN_BIG
, /* Header byteorder. */
2309 (HAS_RELOC
| EXEC_P
| /* Object flags. */
2310 HAS_LINENO
| HAS_DEBUG
|
2311 HAS_SYMS
| HAS_LOCALS
| DYNAMIC
| WP_TEXT
| D_PAGED
),
2312 (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
| SEC_CODE
| SEC_DATA
2313 | SEC_ROM
| SEC_HAS_CONTENTS
), /* Section_flags. */
2314 0, /* Symbol_leading_char. */
2315 ' ', /* AR_pad_char. */
2316 16, /* AR_max_namelen. */
2317 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
2318 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
2319 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* Data. */
2320 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
2321 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
2322 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* Hdrs. */
2323 { /* bfd_check_format. */
2325 bfd_sym_object_p
, /* bfd_check_format. */
2329 { /* bfd_set_format. */
2335 { /* bfd_write_contents. */
2342 BFD_JUMP_TABLE_GENERIC (bfd_sym
),
2343 BFD_JUMP_TABLE_COPY (_bfd_generic
),
2344 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
2345 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive
),
2346 BFD_JUMP_TABLE_SYMBOLS (bfd_sym
),
2347 BFD_JUMP_TABLE_RELOCS (_bfd_norelocs
),
2348 BFD_JUMP_TABLE_WRITE (bfd_sym
),
2349 BFD_JUMP_TABLE_LINK (bfd_sym
),
2350 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),