1 /* BFD back-end for ieee-695 objects.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 Free Software Foundation, Inc.
6 Written by Steve Chamberlain of Cygnus Support.
8 This file is part of BFD, the Binary File Descriptor library.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24 #define KEEPMINUSPCININST 0
26 /* IEEE 695 format is a stream of records, which we parse using a simple one-
27 token (which is one byte in this lexicon) lookahead recursive decent
38 struct output_buffer_struct
44 static boolean ieee_write_byte
PARAMS ((bfd
*, int));
45 static boolean ieee_write_2bytes
PARAMS ((bfd
*, int));
46 static boolean ieee_write_int
PARAMS ((bfd
*, bfd_vma
));
47 static boolean ieee_write_id
PARAMS ((bfd
*, const char *));
48 static unsigned short read_2bytes
PARAMS ((common_header_type
*));
49 static void bfd_get_string
PARAMS ((common_header_type
*, char *, size_t));
50 static char *read_id
PARAMS ((common_header_type
*));
51 static boolean ieee_write_expression
52 PARAMS ((bfd
*, bfd_vma
, asymbol
*, boolean
, unsigned int));
53 static void ieee_write_int5
PARAMS ((bfd_byte
*, bfd_vma
));
54 static boolean ieee_write_int5_out
PARAMS ((bfd
*, bfd_vma
));
55 static boolean parse_int
PARAMS ((common_header_type
*, bfd_vma
*));
56 static int parse_i
PARAMS ((common_header_type
*, boolean
*));
57 static bfd_vma must_parse_int
PARAMS ((common_header_type
*));
58 static void parse_expression
59 PARAMS ((ieee_data_type
*, bfd_vma
*, ieee_symbol_index_type
*,
60 boolean
*, unsigned int *, asection
**));
61 static file_ptr ieee_part_after
PARAMS ((ieee_data_type
*, file_ptr
));
62 static ieee_symbol_type
*get_symbol
63 PARAMS ((bfd
*, ieee_data_type
*, ieee_symbol_type
*, unsigned int *,
64 ieee_symbol_type
***, unsigned int *, char));
65 static boolean ieee_slurp_external_symbols
PARAMS ((bfd
*));
66 static boolean ieee_slurp_symbol_table
PARAMS ((bfd
*));
67 static long ieee_get_symtab_upper_bound
PARAMS ((bfd
*));
68 static long ieee_get_symtab
PARAMS ((bfd
*, asymbol
**));
69 static asection
*get_section_entry
70 PARAMS ((bfd
*, ieee_data_type
*i
, unsigned int));
71 static void ieee_slurp_sections
PARAMS ((bfd
*));
72 static boolean ieee_slurp_debug
PARAMS ((bfd
*));
73 const bfd_target
*ieee_archive_p
PARAMS ((bfd
*));
74 const bfd_target
*ieee_object_p
PARAMS ((bfd
*));
75 static void ieee_get_symbol_info
PARAMS ((bfd
*, asymbol
*, symbol_info
*));
76 static void ieee_print_symbol
77 PARAMS ((bfd
*, PTR
, asymbol
*, bfd_print_symbol_type
));
79 PARAMS ((ieee_data_type
*, ieee_per_section_type
*, unsigned char *,
81 static boolean ieee_slurp_section_data
PARAMS ((bfd
*));
82 static boolean ieee_new_section_hook
PARAMS ((bfd
*, asection
*));
83 static long ieee_get_reloc_upper_bound
PARAMS ((bfd
*, sec_ptr
));
84 static boolean ieee_get_section_contents
85 PARAMS ((bfd
*, sec_ptr
, PTR
, file_ptr
, bfd_size_type
));
86 static long ieee_canonicalize_reloc
87 PARAMS ((bfd
*, sec_ptr
, arelent
**, asymbol
**));
88 static int comp
PARAMS ((const PTR
, const PTR
));
89 static boolean ieee_write_section_part
PARAMS ((bfd
*));
90 static boolean do_with_relocs
PARAMS ((bfd
*, asection
*));
91 static boolean do_as_repeat
PARAMS ((bfd
*, asection
*));
92 static boolean do_without_relocs
PARAMS ((bfd
*, asection
*));
93 static boolean ieee_mkobject
PARAMS ((bfd
*));
94 static void fill
PARAMS ((void));
95 static void flush
PARAMS ((void));
96 static void write_int
PARAMS ((int));
97 static void copy_id
PARAMS ((void));
98 static void copy_expression
PARAMS ((void));
99 static void fill_int
PARAMS ((struct output_buffer_struct
*));
100 static void drop_int
PARAMS ((struct output_buffer_struct
*));
101 static void copy_int
PARAMS ((void));
102 static void f1_record
PARAMS ((void));
103 static void f0_record
PARAMS ((void));
104 static void copy_till_end
PARAMS ((void));
105 static void f2_record
PARAMS ((void));
106 static void f8_record
PARAMS ((void));
107 static void e2_record
PARAMS ((void));
108 static void block
PARAMS ((void));
109 static void relocate_debug
PARAMS ((bfd
*, bfd
*));
110 static boolean ieee_write_debug_part
PARAMS ((bfd
*));
111 static boolean ieee_write_data_part
PARAMS ((bfd
*));
112 static boolean init_for_output
PARAMS ((bfd
*));
113 static boolean ieee_set_section_contents
114 PARAMS ((bfd
*, sec_ptr
, PTR
, file_ptr
, bfd_size_type
));
115 static boolean ieee_write_external_part
PARAMS ((bfd
*));
116 static boolean ieee_write_me_part
PARAMS ((bfd
*));
117 static boolean ieee_write_processor
PARAMS ((bfd
*));
118 static boolean ieee_write_object_contents
PARAMS ((bfd
*));
119 static asymbol
*ieee_make_empty_symbol
PARAMS ((bfd
*));
120 static bfd
*ieee_openr_next_archived_file
PARAMS ((bfd
*, bfd
*));
121 static boolean ieee_find_nearest_line
122 PARAMS ((bfd
*, asection
*, asymbol
**, bfd_vma
, const char **,
123 const char **, unsigned int *));
124 static int ieee_generic_stat_arch_elt
PARAMS ((bfd
*, struct stat
*));
125 static int ieee_sizeof_headers
PARAMS ((bfd
*, boolean
));
127 /* Functions for writing to ieee files in the strange way that the
128 standard requires. */
131 ieee_write_byte (abfd
, barg
)
138 if (bfd_write ((PTR
) &byte
, 1, 1, abfd
) != 1)
144 ieee_write_2bytes (abfd
, bytes
)
150 buffer
[0] = bytes
>> 8;
151 buffer
[1] = bytes
& 0xff;
152 if (bfd_write ((PTR
) buffer
, 1, 2, abfd
) != 2)
158 ieee_write_int (abfd
, value
)
164 if (! ieee_write_byte (abfd
, (bfd_byte
) value
))
171 /* How many significant bytes ? */
172 /* FIXME FOR LONGER INTS */
173 if (value
& 0xff000000)
175 else if (value
& 0x00ff0000)
177 else if (value
& 0x0000ff00)
182 if (! ieee_write_byte (abfd
,
183 (bfd_byte
) ((int) ieee_number_repeat_start_enum
189 if (! ieee_write_byte (abfd
, (bfd_byte
) (value
>> 24)))
193 if (! ieee_write_byte (abfd
, (bfd_byte
) (value
>> 16)))
197 if (! ieee_write_byte (abfd
, (bfd_byte
) (value
>> 8)))
201 if (! ieee_write_byte (abfd
, (bfd_byte
) (value
)))
210 ieee_write_id (abfd
, id
)
214 size_t length
= strlen (id
);
218 if (! ieee_write_byte (abfd
, (bfd_byte
) length
))
221 else if (length
< 255)
223 if (! ieee_write_byte (abfd
, ieee_extension_length_1_enum
)
224 || ! ieee_write_byte (abfd
, (bfd_byte
) length
))
227 else if (length
< 65535)
229 if (! ieee_write_byte (abfd
, ieee_extension_length_2_enum
)
230 || ! ieee_write_2bytes (abfd
, (int) length
))
235 (*_bfd_error_handler
)
236 (_("%s: string too long (%d chars, max 65535)"),
237 bfd_get_filename (abfd
), length
);
238 bfd_set_error (bfd_error_invalid_operation
);
242 if (bfd_write ((PTR
) id
, 1, length
, abfd
) != length
)
247 /***************************************************************************
248 Functions for reading from ieee files in the strange way that the
252 #define this_byte(ieee) *((ieee)->input_p)
253 #define next_byte(ieee) ((ieee)->input_p++)
254 #define this_byte_and_next(ieee) (*((ieee)->input_p++))
256 static unsigned short
258 common_header_type
*ieee
;
260 unsigned char c1
= this_byte_and_next (ieee
);
261 unsigned char c2
= this_byte_and_next (ieee
);
262 return (c1
<< 8) | c2
;
266 bfd_get_string (ieee
, string
, length
)
267 common_header_type
*ieee
;
272 for (i
= 0; i
< length
; i
++)
274 string
[i
] = this_byte_and_next (ieee
);
280 common_header_type
*ieee
;
284 length
= this_byte_and_next (ieee
);
287 /* Simple string of length 0 to 127 */
289 else if (length
== 0xde)
291 /* Length is next byte, allowing 0..255 */
292 length
= this_byte_and_next (ieee
);
294 else if (length
== 0xdf)
296 /* Length is next two bytes, allowing 0..65535 */
297 length
= this_byte_and_next (ieee
);
298 length
= (length
* 256) + this_byte_and_next (ieee
);
300 /* Buy memory and read string */
301 string
= bfd_alloc (ieee
->abfd
, length
+ 1);
304 bfd_get_string (ieee
, string
, length
);
310 ieee_write_expression (abfd
, value
, symbol
, pcrel
, index
)
317 unsigned int term_count
= 0;
321 if (! ieee_write_int (abfd
, value
))
326 if (bfd_is_com_section (symbol
->section
)
327 || bfd_is_und_section (symbol
->section
))
329 /* Def of a common symbol */
330 if (! ieee_write_byte (abfd
, ieee_variable_X_enum
)
331 || ! ieee_write_int (abfd
, symbol
->value
))
335 else if (! bfd_is_abs_section (symbol
->section
))
337 /* Ref to defined symbol - */
339 if (symbol
->flags
& BSF_GLOBAL
)
341 if (! ieee_write_byte (abfd
, ieee_variable_I_enum
)
342 || ! ieee_write_int (abfd
, symbol
->value
))
346 else if (symbol
->flags
& (BSF_LOCAL
| BSF_SECTION_SYM
))
348 /* This is a reference to a defined local symbol. We can
349 easily do a local as a section+offset. */
350 if (! ieee_write_byte (abfd
, ieee_variable_R_enum
)
351 || ! ieee_write_byte (abfd
,
352 (bfd_byte
) (symbol
->section
->index
353 + IEEE_SECTION_NUMBER_BASE
)))
356 if (symbol
->value
!= 0)
358 if (! ieee_write_int (abfd
, symbol
->value
))
365 (*_bfd_error_handler
)
366 (_("%s: unrecognized symbol `%s' flags 0x%x"),
367 bfd_get_filename (abfd
), bfd_asymbol_name (symbol
),
369 bfd_set_error (bfd_error_invalid_operation
);
376 /* subtract the pc from here by asking for PC of this section*/
377 if (! ieee_write_byte (abfd
, ieee_variable_P_enum
)
378 || ! ieee_write_byte (abfd
,
379 (bfd_byte
) (index
+ IEEE_SECTION_NUMBER_BASE
))
380 || ! ieee_write_byte (abfd
, ieee_function_minus_enum
))
384 /* Handle the degenerate case of a 0 address. */
387 if (! ieee_write_int (abfd
, 0))
391 while (term_count
> 1)
393 if (! ieee_write_byte (abfd
, ieee_function_plus_enum
))
401 /*****************************************************************************/
404 writes any integer into the buffer supplied and always takes 5 bytes
407 ieee_write_int5 (buffer
, value
)
411 buffer
[0] = (bfd_byte
) ieee_number_repeat_4_enum
;
412 buffer
[1] = (value
>> 24) & 0xff;
413 buffer
[2] = (value
>> 16) & 0xff;
414 buffer
[3] = (value
>> 8) & 0xff;
415 buffer
[4] = (value
>> 0) & 0xff;
419 ieee_write_int5_out (abfd
, value
)
425 ieee_write_int5 (b
, value
);
426 if (bfd_write ((PTR
) b
, 1, 5, abfd
) != 5)
432 parse_int (ieee
, value_ptr
)
433 common_header_type
*ieee
;
436 int value
= this_byte (ieee
);
438 if (value
>= 0 && value
<= 127)
444 else if (value
>= 0x80 && value
<= 0x88)
446 unsigned int count
= value
& 0xf;
451 result
= (result
<< 8) | this_byte_and_next (ieee
);
462 common_header_type
*ieee
;
466 *ok
= parse_int (ieee
, &x
);
471 must_parse_int (ieee
)
472 common_header_type
*ieee
;
475 BFD_ASSERT (parse_int (ieee
, &result
) == true);
483 ieee_symbol_index_type symbol
;
487 #if KEEPMINUSPCININST
489 #define SRC_MASK(arg) arg
490 #define PCREL_OFFSET false
494 #define SRC_MASK(arg) 0
495 #define PCREL_OFFSET true
499 static reloc_howto_type abs32_howto
=
506 complain_overflow_bitfield
,
514 static reloc_howto_type abs16_howto
=
521 complain_overflow_bitfield
,
529 static reloc_howto_type abs8_howto
=
536 complain_overflow_bitfield
,
544 static reloc_howto_type rel32_howto
=
551 complain_overflow_signed
,
555 SRC_MASK (0xffffffff),
559 static reloc_howto_type rel16_howto
=
566 complain_overflow_signed
,
570 SRC_MASK (0x0000ffff),
574 static reloc_howto_type rel8_howto
=
581 complain_overflow_signed
,
585 SRC_MASK (0x000000ff),
589 static ieee_symbol_index_type NOSYMBOL
= {0, 0};
592 parse_expression (ieee
, value
, symbol
, pcrel
, extra
, section
)
593 ieee_data_type
*ieee
;
595 ieee_symbol_index_type
*symbol
;
608 ieee_value_type stack
[10];
610 /* The stack pointer always points to the next unused location */
611 #define PUSH(x,y,z) TOS.symbol=x;TOS.section=y;TOS.value=z;INC;
612 #define POP(x,y,z) DEC;x=TOS.symbol;y=TOS.section;z=TOS.value;
613 ieee_value_type
*sp
= stack
;
616 while (loop
&& ieee
->h
.input_p
< ieee
->h
.last_byte
)
618 switch (this_byte (&(ieee
->h
)))
620 case ieee_variable_P_enum
:
621 /* P variable, current program counter for section n */
624 next_byte (&(ieee
->h
));
626 section_n
= must_parse_int (&(ieee
->h
));
627 PUSH (NOSYMBOL
, bfd_abs_section_ptr
, 0);
630 case ieee_variable_L_enum
:
631 /* L variable address of section N */
632 next_byte (&(ieee
->h
));
633 PUSH (NOSYMBOL
, ieee
->section_table
[must_parse_int (&(ieee
->h
))], 0);
635 case ieee_variable_R_enum
:
636 /* R variable, logical address of section module */
637 /* FIXME, this should be different to L */
638 next_byte (&(ieee
->h
));
639 PUSH (NOSYMBOL
, ieee
->section_table
[must_parse_int (&(ieee
->h
))], 0);
641 case ieee_variable_S_enum
:
642 /* S variable, size in MAUS of section module */
643 next_byte (&(ieee
->h
));
646 ieee
->section_table
[must_parse_int (&(ieee
->h
))]->_raw_size
);
648 case ieee_variable_I_enum
:
649 /* Push the address of variable n */
651 ieee_symbol_index_type sy
;
652 next_byte (&(ieee
->h
));
653 sy
.index
= (int) must_parse_int (&(ieee
->h
));
656 PUSH (sy
, bfd_abs_section_ptr
, 0);
659 case ieee_variable_X_enum
:
660 /* Push the address of external variable n */
662 ieee_symbol_index_type sy
;
663 next_byte (&(ieee
->h
));
664 sy
.index
= (int) (must_parse_int (&(ieee
->h
)));
667 PUSH (sy
, bfd_und_section_ptr
, 0);
670 case ieee_function_minus_enum
:
672 bfd_vma value1
, value2
;
673 asection
*section1
, *section_dummy
;
674 ieee_symbol_index_type sy
;
675 next_byte (&(ieee
->h
));
677 POP (sy
, section1
, value1
);
678 POP (sy
, section_dummy
, value2
);
679 PUSH (sy
, section1
? section1
: section_dummy
, value2
- value1
);
682 case ieee_function_plus_enum
:
684 bfd_vma value1
, value2
;
687 ieee_symbol_index_type sy1
;
688 ieee_symbol_index_type sy2
;
689 next_byte (&(ieee
->h
));
691 POP (sy1
, section1
, value1
);
692 POP (sy2
, section2
, value2
);
693 PUSH (sy1
.letter
? sy1
: sy2
,
694 bfd_is_abs_section (section1
) ? section2
: section1
,
701 BFD_ASSERT (this_byte (&(ieee
->h
)) < (int) ieee_variable_A_enum
702 || this_byte (&(ieee
->h
)) > (int) ieee_variable_Z_enum
);
703 if (parse_int (&(ieee
->h
), &va
))
705 PUSH (NOSYMBOL
, bfd_abs_section_ptr
, va
);
709 /* Thats all that we can understand. */
716 /* As far as I can see there is a bug in the Microtec IEEE output
717 which I'm using to scan, whereby the comma operator is omitted
718 sometimes in an expression, giving expressions with too many
719 terms. We can tell if that's the case by ensuring that
720 sp == stack here. If not, then we've pushed something too far,
721 so we keep adding. */
723 while (sp
!= stack
+ 1)
726 ieee_symbol_index_type sy1
;
727 POP (sy1
, section1
, *extra
);
730 POP (*symbol
, dummy
, *value
);
736 #define ieee_seek(ieee, offset) \
739 ieee->h.input_p = ieee->h.first_byte + offset; \
740 ieee->h.last_byte = (ieee->h.first_byte \
741 + ieee_part_after (ieee, offset)); \
745 #define ieee_pos(ieee) \
746 (ieee->h.input_p - ieee->h.first_byte)
748 /* Find the first part of the ieee file after HERE. */
751 ieee_part_after (ieee
, here
)
752 ieee_data_type
*ieee
;
756 file_ptr after
= ieee
->w
.r
.me_record
;
758 /* File parts can come in any order, except that module end is
759 guaranteed to be last (and the header first). */
760 for (part
= 0; part
< N_W_VARIABLES
; part
++)
761 if (ieee
->w
.offset
[part
] > here
&& after
> ieee
->w
.offset
[part
])
762 after
= ieee
->w
.offset
[part
];
767 static unsigned int last_index
;
768 static char last_type
; /* is the index for an X or a D */
770 static ieee_symbol_type
*
771 get_symbol (abfd
, ieee
, last_symbol
, symbol_count
, pptr
, max_index
, this_type
)
772 bfd
*abfd ATTRIBUTE_UNUSED
;
773 ieee_data_type
*ieee
;
774 ieee_symbol_type
*last_symbol
;
775 unsigned int *symbol_count
;
776 ieee_symbol_type
***pptr
;
777 unsigned int *max_index
;
780 /* Need a new symbol */
781 unsigned int new_index
= must_parse_int (&(ieee
->h
));
782 if (new_index
!= last_index
|| this_type
!= last_type
)
784 ieee_symbol_type
*new_symbol
= (ieee_symbol_type
*) bfd_alloc (ieee
->h
.abfd
,
785 sizeof (ieee_symbol_type
));
789 new_symbol
->index
= new_index
;
790 last_index
= new_index
;
793 *pptr
= &new_symbol
->next
;
794 if (new_index
> *max_index
)
796 *max_index
= new_index
;
798 last_type
= this_type
;
799 new_symbol
->symbol
.section
= bfd_abs_section_ptr
;
806 ieee_slurp_external_symbols (abfd
)
809 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
810 file_ptr offset
= ieee
->w
.r
.external_part
;
812 ieee_symbol_type
**prev_symbols_ptr
= &ieee
->external_symbols
;
813 ieee_symbol_type
**prev_reference_ptr
= &ieee
->external_reference
;
814 ieee_symbol_type
*symbol
= (ieee_symbol_type
*) NULL
;
815 unsigned int symbol_count
= 0;
817 last_index
= 0xffffff;
818 ieee
->symbol_table_full
= true;
820 ieee_seek (ieee
, offset
);
824 switch (this_byte (&(ieee
->h
)))
827 next_byte (&(ieee
->h
));
829 symbol
= get_symbol (abfd
, ieee
, symbol
, &symbol_count
,
831 &ieee
->external_symbol_max_index
, 'I');
835 symbol
->symbol
.the_bfd
= abfd
;
836 symbol
->symbol
.name
= read_id (&(ieee
->h
));
837 symbol
->symbol
.udata
.p
= (PTR
) NULL
;
838 symbol
->symbol
.flags
= BSF_NO_FLAGS
;
840 case ieee_external_symbol_enum
:
841 next_byte (&(ieee
->h
));
843 symbol
= get_symbol (abfd
, ieee
, symbol
, &symbol_count
,
845 &ieee
->external_symbol_max_index
, 'D');
849 BFD_ASSERT (symbol
->index
>= ieee
->external_symbol_min_index
);
851 symbol
->symbol
.the_bfd
= abfd
;
852 symbol
->symbol
.name
= read_id (&(ieee
->h
));
853 symbol
->symbol
.udata
.p
= (PTR
) NULL
;
854 symbol
->symbol
.flags
= BSF_NO_FLAGS
;
856 case ieee_attribute_record_enum
>> 8:
858 unsigned int symbol_name_index
;
859 unsigned int symbol_type_index
;
860 unsigned int symbol_attribute_def
;
862 switch (read_2bytes (&ieee
->h
))
864 case ieee_attribute_record_enum
:
865 symbol_name_index
= must_parse_int (&(ieee
->h
));
866 symbol_type_index
= must_parse_int (&(ieee
->h
));
867 symbol_attribute_def
= must_parse_int (&(ieee
->h
));
868 switch (symbol_attribute_def
)
872 parse_int (&ieee
->h
, &value
);
875 (*_bfd_error_handler
)
876 (_("%s: unimplemented ATI record %u for symbol %u"),
877 bfd_get_filename (abfd
), symbol_attribute_def
,
879 bfd_set_error (bfd_error_bad_value
);
884 case ieee_external_reference_info_record_enum
:
885 /* Skip over ATX record. */
886 parse_int (&(ieee
->h
), &value
);
887 parse_int (&(ieee
->h
), &value
);
888 parse_int (&(ieee
->h
), &value
);
889 parse_int (&(ieee
->h
), &value
);
891 case ieee_atn_record_enum
:
892 /* We may get call optimization information here,
893 which we just ignore. The format is
894 {$F1}${CE}{index}{$00}{$3F}{$3F}{#_of_ASNs} */
895 parse_int (&ieee
->h
, &value
);
896 parse_int (&ieee
->h
, &value
);
897 parse_int (&ieee
->h
, &value
);
900 (*_bfd_error_handler
)
901 (_("%s: unexpected ATN type %d in external part"),
902 bfd_get_filename (abfd
), (int) value
);
903 bfd_set_error (bfd_error_bad_value
);
906 parse_int (&ieee
->h
, &value
);
907 parse_int (&ieee
->h
, &value
);
914 switch (read_2bytes (&ieee
->h
))
916 case ieee_asn_record_enum
:
917 parse_int (&ieee
->h
, &val1
);
918 parse_int (&ieee
->h
, &val1
);
922 (*_bfd_error_handler
)
923 (_("%s: unexpected type after ATN"),
924 bfd_get_filename (abfd
));
925 bfd_set_error (bfd_error_bad_value
);
932 case ieee_value_record_enum
>> 8:
934 unsigned int symbol_name_index
;
935 ieee_symbol_index_type symbol_ignore
;
936 boolean pcrel_ignore
;
938 next_byte (&(ieee
->h
));
939 next_byte (&(ieee
->h
));
941 symbol_name_index
= must_parse_int (&(ieee
->h
));
942 parse_expression (ieee
,
943 &symbol
->symbol
.value
,
947 &symbol
->symbol
.section
);
949 /* Fully linked IEEE-695 files tend to give every symbol
950 an absolute value. Try to convert that back into a
951 section relative value. FIXME: This won't always to
953 if (bfd_is_abs_section (symbol
->symbol
.section
)
954 && (abfd
->flags
& HAS_RELOC
) == 0)
959 val
= symbol
->symbol
.value
;
960 for (s
= abfd
->sections
; s
!= NULL
; s
= s
->next
)
962 if (val
>= s
->vma
&& val
< s
->vma
+ s
->_raw_size
)
964 symbol
->symbol
.section
= s
;
965 symbol
->symbol
.value
-= s
->vma
;
971 symbol
->symbol
.flags
= BSF_GLOBAL
| BSF_EXPORT
;
975 case ieee_weak_external_reference_enum
:
979 next_byte (&(ieee
->h
));
980 /* Throw away the external reference index */
981 (void) must_parse_int (&(ieee
->h
));
982 /* Fetch the default size if not resolved */
983 size
= must_parse_int (&(ieee
->h
));
984 /* Fetch the defautlt value if available */
985 if (parse_int (&(ieee
->h
), &value
) == false)
989 /* This turns into a common */
990 symbol
->symbol
.section
= bfd_com_section_ptr
;
991 symbol
->symbol
.value
= size
;
995 case ieee_external_reference_enum
:
996 next_byte (&(ieee
->h
));
998 symbol
= get_symbol (abfd
, ieee
, symbol
, &symbol_count
,
1000 &ieee
->external_reference_max_index
, 'X');
1004 symbol
->symbol
.the_bfd
= abfd
;
1005 symbol
->symbol
.name
= read_id (&(ieee
->h
));
1006 symbol
->symbol
.udata
.p
= (PTR
) NULL
;
1007 symbol
->symbol
.section
= bfd_und_section_ptr
;
1008 symbol
->symbol
.value
= (bfd_vma
) 0;
1009 symbol
->symbol
.flags
= 0;
1011 BFD_ASSERT (symbol
->index
>= ieee
->external_reference_min_index
);
1019 if (ieee
->external_symbol_max_index
!= 0)
1021 ieee
->external_symbol_count
=
1022 ieee
->external_symbol_max_index
-
1023 ieee
->external_symbol_min_index
+ 1;
1027 ieee
->external_symbol_count
= 0;
1030 if (ieee
->external_reference_max_index
!= 0)
1032 ieee
->external_reference_count
=
1033 ieee
->external_reference_max_index
-
1034 ieee
->external_reference_min_index
+ 1;
1038 ieee
->external_reference_count
= 0;
1042 ieee
->external_reference_count
+ ieee
->external_symbol_count
;
1044 if (symbol_count
!= abfd
->symcount
)
1046 /* There are gaps in the table -- */
1047 ieee
->symbol_table_full
= false;
1050 *prev_symbols_ptr
= (ieee_symbol_type
*) NULL
;
1051 *prev_reference_ptr
= (ieee_symbol_type
*) NULL
;
1057 ieee_slurp_symbol_table (abfd
)
1060 if (IEEE_DATA (abfd
)->read_symbols
== false)
1062 if (! ieee_slurp_external_symbols (abfd
))
1064 IEEE_DATA (abfd
)->read_symbols
= true;
1070 ieee_get_symtab_upper_bound (abfd
)
1073 if (! ieee_slurp_symbol_table (abfd
))
1076 return (abfd
->symcount
!= 0) ?
1077 (abfd
->symcount
+ 1) * (sizeof (ieee_symbol_type
*)) : 0;
1081 Move from our internal lists to the canon table, and insert in
1085 extern const bfd_target ieee_vec
;
1088 ieee_get_symtab (abfd
, location
)
1092 ieee_symbol_type
*symp
;
1093 static bfd dummy_bfd
;
1094 static asymbol empty_symbol
=
1102 /* K&R compilers can't initialise unions. */
1109 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
1110 dummy_bfd
.xvec
= &ieee_vec
;
1111 if (! ieee_slurp_symbol_table (abfd
))
1114 if (ieee
->symbol_table_full
== false)
1116 /* Arrgh - there are gaps in the table, run through and fill them */
1117 /* up with pointers to a null place */
1119 for (i
= 0; i
< abfd
->symcount
; i
++)
1121 location
[i
] = &empty_symbol
;
1125 ieee
->external_symbol_base_offset
= -ieee
->external_symbol_min_index
;
1126 for (symp
= IEEE_DATA (abfd
)->external_symbols
;
1127 symp
!= (ieee_symbol_type
*) NULL
;
1130 /* Place into table at correct index locations */
1131 location
[symp
->index
+ ieee
->external_symbol_base_offset
] = &symp
->symbol
;
1134 /* The external refs are indexed in a bit */
1135 ieee
->external_reference_base_offset
=
1136 -ieee
->external_reference_min_index
+ ieee
->external_symbol_count
;
1138 for (symp
= IEEE_DATA (abfd
)->external_reference
;
1139 symp
!= (ieee_symbol_type
*) NULL
;
1142 location
[symp
->index
+ ieee
->external_reference_base_offset
] =
1149 location
[abfd
->symcount
] = (asymbol
*) NULL
;
1151 return abfd
->symcount
;
1155 get_section_entry (abfd
, ieee
, index
)
1157 ieee_data_type
*ieee
;
1160 if (index
>= ieee
->section_table_size
)
1165 c
= ieee
->section_table_size
;
1172 bfd_realloc (ieee
->section_table
, c
* sizeof (asection
*)));
1176 for (i
= ieee
->section_table_size
; i
< c
; i
++)
1179 ieee
->section_table
= n
;
1180 ieee
->section_table_size
= c
;
1183 if (ieee
->section_table
[index
] == (asection
*) NULL
)
1185 char *tmp
= bfd_alloc (abfd
, 11);
1190 sprintf (tmp
, " fsec%4d", index
);
1191 section
= bfd_make_section (abfd
, tmp
);
1192 ieee
->section_table
[index
] = section
;
1193 section
->flags
= SEC_NO_FLAGS
;
1194 section
->target_index
= index
;
1195 ieee
->section_table
[index
] = section
;
1197 return ieee
->section_table
[index
];
1201 ieee_slurp_sections (abfd
)
1204 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
1205 file_ptr offset
= ieee
->w
.r
.section_part
;
1206 asection
*section
= (asection
*) NULL
;
1211 bfd_byte section_type
[3];
1212 ieee_seek (ieee
, offset
);
1215 switch (this_byte (&(ieee
->h
)))
1217 case ieee_section_type_enum
:
1219 unsigned int section_index
;
1220 next_byte (&(ieee
->h
));
1221 section_index
= must_parse_int (&(ieee
->h
));
1223 section
= get_section_entry (abfd
, ieee
, section_index
);
1225 section_type
[0] = this_byte_and_next (&(ieee
->h
));
1227 /* Set minimal section attributes. Attributes are
1228 extended later, based on section contents. */
1230 switch (section_type
[0])
1233 /* Normal attributes for absolute sections */
1234 section_type
[1] = this_byte (&(ieee
->h
));
1235 section
->flags
= SEC_ALLOC
;
1236 switch (section_type
[1])
1238 case 0xD3: /* AS Absolute section attributes */
1239 next_byte (&(ieee
->h
));
1240 section_type
[2] = this_byte (&(ieee
->h
));
1241 switch (section_type
[2])
1245 next_byte (&(ieee
->h
));
1246 section
->flags
|= SEC_CODE
;
1250 next_byte (&(ieee
->h
));
1251 section
->flags
|= SEC_DATA
;
1254 next_byte (&(ieee
->h
));
1255 /* Normal rom data */
1256 section
->flags
|= SEC_ROM
| SEC_DATA
;
1263 case 0xC3: /* Named relocatable sections (type C) */
1264 section_type
[1] = this_byte (&(ieee
->h
));
1265 section
->flags
= SEC_ALLOC
;
1266 switch (section_type
[1])
1268 case 0xD0: /* Normal code (CP) */
1269 next_byte (&(ieee
->h
));
1270 section
->flags
|= SEC_CODE
;
1272 case 0xC4: /* Normal data (CD) */
1273 next_byte (&(ieee
->h
));
1274 section
->flags
|= SEC_DATA
;
1276 case 0xD2: /* Normal rom data (CR) */
1277 next_byte (&(ieee
->h
));
1278 section
->flags
|= SEC_ROM
| SEC_DATA
;
1285 /* Read section name, use it if non empty. */
1286 name
= read_id (&ieee
->h
);
1288 section
->name
= name
;
1290 /* Skip these fields, which we don't care about */
1292 bfd_vma parent
, brother
, context
;
1293 parse_int (&(ieee
->h
), &parent
);
1294 parse_int (&(ieee
->h
), &brother
);
1295 parse_int (&(ieee
->h
), &context
);
1299 case ieee_section_alignment_enum
:
1301 unsigned int section_index
;
1304 next_byte (&(ieee
->h
));
1305 section_index
= must_parse_int (&ieee
->h
);
1306 section
= get_section_entry (abfd
, ieee
, section_index
);
1307 if (section_index
> ieee
->section_count
)
1309 ieee
->section_count
= section_index
;
1311 section
->alignment_power
=
1312 bfd_log2 (must_parse_int (&ieee
->h
));
1313 (void) parse_int (&(ieee
->h
), &value
);
1316 case ieee_e2_first_byte_enum
:
1318 ieee_record_enum_type t
= (ieee_record_enum_type
) (read_2bytes (&(ieee
->h
)));
1322 case ieee_section_size_enum
:
1323 section
= ieee
->section_table
[must_parse_int (&(ieee
->h
))];
1324 section
->_raw_size
= must_parse_int (&(ieee
->h
));
1326 case ieee_physical_region_size_enum
:
1327 section
= ieee
->section_table
[must_parse_int (&(ieee
->h
))];
1328 section
->_raw_size
= must_parse_int (&(ieee
->h
));
1330 case ieee_region_base_address_enum
:
1331 section
= ieee
->section_table
[must_parse_int (&(ieee
->h
))];
1332 section
->vma
= must_parse_int (&(ieee
->h
));
1333 section
->lma
= section
->vma
;
1335 case ieee_mau_size_enum
:
1336 must_parse_int (&(ieee
->h
));
1337 must_parse_int (&(ieee
->h
));
1339 case ieee_m_value_enum
:
1340 must_parse_int (&(ieee
->h
));
1341 must_parse_int (&(ieee
->h
));
1343 case ieee_section_base_address_enum
:
1344 section
= ieee
->section_table
[must_parse_int (&(ieee
->h
))];
1345 section
->vma
= must_parse_int (&(ieee
->h
));
1346 section
->lma
= section
->vma
;
1348 case ieee_section_offset_enum
:
1349 (void) must_parse_int (&(ieee
->h
));
1350 (void) must_parse_int (&(ieee
->h
));
1364 /* Make a section for the debugging information, if any. We don't try
1365 to interpret the debugging information; we just point the section
1366 at the area in the file so that program which understand can dig it
1370 ieee_slurp_debug (abfd
)
1373 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
1377 if (ieee
->w
.r
.debug_information_part
== 0)
1380 sec
= bfd_make_section (abfd
, ".debug");
1383 sec
->flags
|= SEC_DEBUGGING
| SEC_HAS_CONTENTS
;
1384 sec
->filepos
= ieee
->w
.r
.debug_information_part
;
1386 debug_end
= ieee_part_after (ieee
, ieee
->w
.r
.debug_information_part
);
1387 sec
->_raw_size
= debug_end
- ieee
->w
.r
.debug_information_part
;
1392 /***********************************************************************
1397 ieee_archive_p (abfd
)
1402 unsigned char buffer
[512];
1403 file_ptr buffer_offset
= 0;
1404 ieee_ar_data_type
*save
= abfd
->tdata
.ieee_ar_data
;
1405 ieee_ar_data_type
*ieee
;
1406 unsigned int alc_elts
;
1407 ieee_ar_obstack_type
*elts
= NULL
;
1409 abfd
->tdata
.ieee_ar_data
=
1410 (ieee_ar_data_type
*) bfd_alloc (abfd
, sizeof (ieee_ar_data_type
));
1411 if (!abfd
->tdata
.ieee_ar_data
)
1413 ieee
= IEEE_AR_DATA (abfd
);
1415 /* Ignore the return value here. It doesn't matter if we don't read
1416 the entire buffer. We might have a very small ieee file. */
1417 bfd_read ((PTR
) buffer
, 1, sizeof (buffer
), abfd
);
1419 ieee
->h
.first_byte
= buffer
;
1420 ieee
->h
.input_p
= buffer
;
1422 ieee
->h
.abfd
= abfd
;
1424 if (this_byte (&(ieee
->h
)) != Module_Beginning
)
1425 goto got_wrong_format_error
;
1427 next_byte (&(ieee
->h
));
1428 library
= read_id (&(ieee
->h
));
1429 if (strcmp (library
, "LIBRARY") != 0)
1430 goto got_wrong_format_error
;
1432 /* Throw away the filename. */
1433 read_id (&(ieee
->h
));
1435 ieee
->element_count
= 0;
1436 ieee
->element_index
= 0;
1438 next_byte (&(ieee
->h
)); /* Drop the ad part. */
1439 must_parse_int (&(ieee
->h
)); /* And the two dummy numbers. */
1440 must_parse_int (&(ieee
->h
));
1443 elts
= (ieee_ar_obstack_type
*) bfd_malloc (alc_elts
* sizeof *elts
);
1447 /* Read the index of the BB table. */
1451 ieee_ar_obstack_type
*t
;
1453 rec
= read_2bytes (&(ieee
->h
));
1454 if (rec
!= (int) ieee_assign_value_to_variable_enum
)
1457 if (ieee
->element_count
>= alc_elts
)
1459 ieee_ar_obstack_type
*n
;
1462 n
= ((ieee_ar_obstack_type
*)
1463 bfd_realloc (elts
, alc_elts
* sizeof *elts
));
1469 t
= &elts
[ieee
->element_count
];
1470 ieee
->element_count
++;
1472 must_parse_int (&(ieee
->h
));
1473 t
->file_offset
= must_parse_int (&(ieee
->h
));
1474 t
->abfd
= (bfd
*) NULL
;
1476 /* Make sure that we don't go over the end of the buffer. */
1477 if ((size_t) ieee_pos (IEEE_DATA (abfd
)) > sizeof (buffer
) / 2)
1479 /* Past half way, reseek and reprime. */
1480 buffer_offset
+= ieee_pos (IEEE_DATA (abfd
));
1481 if (bfd_seek (abfd
, buffer_offset
, SEEK_SET
) != 0)
1484 /* Again ignore return value of bfd_read. */
1485 bfd_read ((PTR
) buffer
, 1, sizeof (buffer
), abfd
);
1486 ieee
->h
.first_byte
= buffer
;
1487 ieee
->h
.input_p
= buffer
;
1491 ieee
->elements
= ((ieee_ar_obstack_type
*)
1493 ieee
->element_count
* sizeof *ieee
->elements
));
1494 if (ieee
->elements
== NULL
)
1497 memcpy (ieee
->elements
, elts
,
1498 ieee
->element_count
* sizeof *ieee
->elements
);
1502 /* Now scan the area again, and replace BB offsets with file offsets. */
1503 for (i
= 2; i
< ieee
->element_count
; i
++)
1505 if (bfd_seek (abfd
, ieee
->elements
[i
].file_offset
, SEEK_SET
) != 0)
1508 /* Again ignore return value of bfd_read. */
1509 bfd_read ((PTR
) buffer
, 1, sizeof (buffer
), abfd
);
1510 ieee
->h
.first_byte
= buffer
;
1511 ieee
->h
.input_p
= buffer
;
1513 next_byte (&(ieee
->h
)); /* Drop F8. */
1514 next_byte (&(ieee
->h
)); /* Drop 14. */
1515 must_parse_int (&(ieee
->h
)); /* Drop size of block. */
1517 if (must_parse_int (&(ieee
->h
)) != 0)
1518 /* This object has been deleted. */
1519 ieee
->elements
[i
].file_offset
= 0;
1521 ieee
->elements
[i
].file_offset
= must_parse_int (&(ieee
->h
));
1524 /* abfd->has_armap = ;*/
1528 got_wrong_format_error
:
1529 bfd_release (abfd
, ieee
);
1530 abfd
->tdata
.ieee_ar_data
= save
;
1531 bfd_set_error (bfd_error_wrong_format
);
1541 ieee_object_p (abfd
)
1546 ieee_data_type
*ieee
;
1547 unsigned char buffer
[300];
1548 ieee_data_type
*save
= IEEE_DATA (abfd
);
1550 abfd
->tdata
.ieee_data
= 0;
1551 ieee_mkobject (abfd
);
1553 ieee
= IEEE_DATA (abfd
);
1554 if (bfd_seek (abfd
, (file_ptr
) 0, SEEK_SET
) != 0)
1556 /* Read the first few bytes in to see if it makes sense. Ignore
1557 bfd_read return value; The file might be very small. */
1558 bfd_read ((PTR
) buffer
, 1, sizeof (buffer
), abfd
);
1560 ieee
->h
.input_p
= buffer
;
1561 if (this_byte_and_next (&(ieee
->h
)) != Module_Beginning
)
1562 goto got_wrong_format
;
1564 ieee
->read_symbols
= false;
1565 ieee
->read_data
= false;
1566 ieee
->section_count
= 0;
1567 ieee
->external_symbol_max_index
= 0;
1568 ieee
->external_symbol_min_index
= IEEE_PUBLIC_BASE
;
1569 ieee
->external_reference_min_index
= IEEE_REFERENCE_BASE
;
1570 ieee
->external_reference_max_index
= 0;
1571 ieee
->h
.abfd
= abfd
;
1572 ieee
->section_table
= NULL
;
1573 ieee
->section_table_size
= 0;
1575 processor
= ieee
->mb
.processor
= read_id (&(ieee
->h
));
1576 if (strcmp (processor
, "LIBRARY") == 0)
1577 goto got_wrong_format
;
1578 ieee
->mb
.module_name
= read_id (&(ieee
->h
));
1579 if (abfd
->filename
== (const char *) NULL
)
1581 abfd
->filename
= ieee
->mb
.module_name
;
1583 /* Determine the architecture and machine type of the object file.
1586 const bfd_arch_info_type
*arch
;
1589 /* IEEE does not specify the format of the processor identificaton
1590 string, so the compiler is free to put in it whatever it wants.
1591 We try here to recognize different processors belonging to the
1592 m68k family. Code for other processors can be added here. */
1593 if ((processor
[0] == '6') && (processor
[1] == '8'))
1595 if (processor
[2] == '3') /* 683xx integrated processors */
1597 switch (processor
[3])
1599 case '0': /* 68302, 68306, 68307 */
1600 case '2': /* 68322, 68328 */
1601 case '5': /* 68356 */
1602 strcpy (family
, "68000"); /* MC68000-based controllers */
1605 case '3': /* 68330, 68331, 68332, 68333,
1606 68334, 68335, 68336, 68338 */
1607 case '6': /* 68360 */
1608 case '7': /* 68376 */
1609 strcpy (family
, "68332"); /* CPU32 and CPU32+ */
1613 if (processor
[4] == '9') /* 68349 */
1614 strcpy (family
, "68030"); /* CPU030 */
1615 else /* 68340, 68341 */
1616 strcpy (family
, "68332"); /* CPU32 and CPU32+ */
1619 default: /* Does not exist yet */
1620 strcpy (family
, "68332"); /* Guess it will be CPU32 */
1623 else if (toupper (processor
[3]) == 'F') /* 68F333 */
1624 strcpy (family
, "68332"); /* CPU32 */
1625 else if ((toupper (processor
[3]) == 'C') /* Embedded controllers */
1626 && ((toupper (processor
[2]) == 'E')
1627 || (toupper (processor
[2]) == 'H')
1628 || (toupper (processor
[2]) == 'L')))
1630 strcpy (family
, "68");
1631 strncat (family
, processor
+ 4, 7);
1634 else /* "Regular" processors */
1636 strncpy (family
, processor
, 9);
1640 else if ((strncmp (processor
, "cpu32", 5) == 0) /* CPU32 and CPU32+ */
1641 || (strncmp (processor
, "CPU32", 5) == 0))
1642 strcpy (family
, "68332");
1645 strncpy (family
, processor
, 9);
1649 arch
= bfd_scan_arch (family
);
1651 goto got_wrong_format
;
1652 abfd
->arch_info
= arch
;
1655 if (this_byte (&(ieee
->h
)) != (int) ieee_address_descriptor_enum
)
1659 next_byte (&(ieee
->h
));
1661 if (parse_int (&(ieee
->h
), &ieee
->ad
.number_of_bits_mau
) == false)
1665 if (parse_int (&(ieee
->h
), &ieee
->ad
.number_of_maus_in_address
) == false)
1670 /* If there is a byte order info, take it */
1671 if (this_byte (&(ieee
->h
)) == (int) ieee_variable_L_enum
||
1672 this_byte (&(ieee
->h
)) == (int) ieee_variable_M_enum
)
1673 next_byte (&(ieee
->h
));
1675 for (part
= 0; part
< N_W_VARIABLES
; part
++)
1678 if (read_2bytes (&(ieee
->h
)) != (int) ieee_assign_value_to_variable_enum
)
1682 if (this_byte_and_next (&(ieee
->h
)) != part
)
1687 ieee
->w
.offset
[part
] = parse_i (&(ieee
->h
), &ok
);
1695 if (ieee
->w
.r
.external_part
!= 0)
1696 abfd
->flags
= HAS_SYMS
;
1698 /* By now we know that this is a real IEEE file, we're going to read
1699 the whole thing into memory so that we can run up and down it
1700 quickly. We can work out how big the file is from the trailer
1703 IEEE_DATA (abfd
)->h
.first_byte
=
1704 (unsigned char *) bfd_alloc (ieee
->h
.abfd
, ieee
->w
.r
.me_record
+ 1);
1705 if (!IEEE_DATA (abfd
)->h
.first_byte
)
1707 if (bfd_seek (abfd
, (file_ptr
) 0, SEEK_SET
) != 0)
1709 /* FIXME: Check return value. I'm not sure whether it needs to read
1710 the entire buffer or not. */
1711 bfd_read ((PTR
) (IEEE_DATA (abfd
)->h
.first_byte
), 1,
1712 ieee
->w
.r
.me_record
+ 1, abfd
);
1714 ieee_slurp_sections (abfd
);
1716 if (! ieee_slurp_debug (abfd
))
1719 /* Parse section data to activate file and section flags implied by
1720 section contents. */
1722 if (! ieee_slurp_section_data (abfd
))
1727 bfd_set_error (bfd_error_wrong_format
);
1729 (void) bfd_release (abfd
, ieee
);
1730 abfd
->tdata
.ieee_data
= save
;
1731 return (const bfd_target
*) NULL
;
1735 ieee_get_symbol_info (ignore_abfd
, symbol
, ret
)
1736 bfd
*ignore_abfd ATTRIBUTE_UNUSED
;
1740 bfd_symbol_info (symbol
, ret
);
1741 if (symbol
->name
[0] == ' ')
1742 ret
->name
= "* empty table entry ";
1743 if (!symbol
->section
)
1744 ret
->type
= (symbol
->flags
& BSF_LOCAL
) ? 'a' : 'A';
1748 ieee_print_symbol (abfd
, afile
, symbol
, how
)
1752 bfd_print_symbol_type how
;
1754 FILE *file
= (FILE *) afile
;
1758 case bfd_print_symbol_name
:
1759 fprintf (file
, "%s", symbol
->name
);
1761 case bfd_print_symbol_more
:
1763 fprintf (file
, "%4x %2x", aout_symbol (symbol
)->desc
& 0xffff,
1764 aout_symbol (symbol
)->other
& 0xff);
1768 case bfd_print_symbol_all
:
1770 const char *section_name
=
1771 (symbol
->section
== (asection
*) NULL
1773 : symbol
->section
->name
);
1774 if (symbol
->name
[0] == ' ')
1776 fprintf (file
, "* empty table entry ");
1780 bfd_print_symbol_vandf (abfd
, (PTR
) file
, symbol
);
1782 fprintf (file
, " %-5s %04x %02x %s",
1784 (unsigned) ieee_symbol (symbol
)->index
,
1794 do_one (ieee
, current_map
, location_ptr
, s
, iterations
)
1795 ieee_data_type
*ieee
;
1796 ieee_per_section_type
*current_map
;
1797 unsigned char *location_ptr
;
1801 switch (this_byte (&(ieee
->h
)))
1803 case ieee_load_constant_bytes_enum
:
1805 unsigned int number_of_maus
;
1807 next_byte (&(ieee
->h
));
1808 number_of_maus
= must_parse_int (&(ieee
->h
));
1810 for (i
= 0; i
< number_of_maus
; i
++)
1812 location_ptr
[current_map
->pc
++] = this_byte (&(ieee
->h
));
1813 next_byte (&(ieee
->h
));
1818 case ieee_load_with_relocation_enum
:
1820 boolean loop
= true;
1821 next_byte (&(ieee
->h
));
1824 switch (this_byte (&(ieee
->h
)))
1826 case ieee_variable_R_enum
:
1828 case ieee_function_signed_open_b_enum
:
1829 case ieee_function_unsigned_open_b_enum
:
1830 case ieee_function_either_open_b_enum
:
1832 unsigned int extra
= 4;
1833 boolean pcrel
= false;
1835 ieee_reloc_type
*r
=
1836 (ieee_reloc_type
*) bfd_alloc (ieee
->h
.abfd
,
1837 sizeof (ieee_reloc_type
));
1841 *(current_map
->reloc_tail_ptr
) = r
;
1842 current_map
->reloc_tail_ptr
= &r
->next
;
1843 r
->next
= (ieee_reloc_type
*) NULL
;
1844 next_byte (&(ieee
->h
));
1846 r
->relent
.sym_ptr_ptr
= 0;
1847 parse_expression (ieee
,
1850 &pcrel
, &extra
, §ion
);
1851 r
->relent
.address
= current_map
->pc
;
1852 s
->flags
|= SEC_RELOC
;
1853 s
->owner
->flags
|= HAS_RELOC
;
1855 if (r
->relent
.sym_ptr_ptr
== NULL
&& section
!= NULL
)
1856 r
->relent
.sym_ptr_ptr
= section
->symbol_ptr_ptr
;
1858 if (this_byte (&(ieee
->h
)) == (int) ieee_comma
)
1860 next_byte (&(ieee
->h
));
1861 /* Fetch number of bytes to pad */
1862 extra
= must_parse_int (&(ieee
->h
));
1865 switch (this_byte (&(ieee
->h
)))
1867 case ieee_function_signed_close_b_enum
:
1868 next_byte (&(ieee
->h
));
1870 case ieee_function_unsigned_close_b_enum
:
1871 next_byte (&(ieee
->h
));
1873 case ieee_function_either_close_b_enum
:
1874 next_byte (&(ieee
->h
));
1879 /* Build a relocation entry for this type */
1880 /* If pc rel then stick -ve pc into instruction
1881 and take out of reloc ..
1883 I've changed this. It's all too complicated. I
1884 keep 0 in the instruction now. */
1893 #if KEEPMINUSPCININST
1894 bfd_put_32 (ieee
->h
.abfd
, -current_map
->pc
, location_ptr
+
1896 r
->relent
.howto
= &rel32_howto
;
1900 bfd_put_32 (ieee
->h
.abfd
, 0, location_ptr
+
1902 r
->relent
.howto
= &rel32_howto
;
1907 bfd_put_32 (ieee
->h
.abfd
, 0, location_ptr
+
1909 r
->relent
.howto
= &abs32_howto
;
1911 current_map
->pc
+= 4;
1916 #if KEEPMINUSPCININST
1917 bfd_put_16 (ieee
->h
.abfd
, (int) (-current_map
->pc
), location_ptr
+ current_map
->pc
);
1918 r
->relent
.addend
-= current_map
->pc
;
1919 r
->relent
.howto
= &rel16_howto
;
1922 bfd_put_16 (ieee
->h
.abfd
, 0, location_ptr
+ current_map
->pc
);
1923 r
->relent
.howto
= &rel16_howto
;
1929 bfd_put_16 (ieee
->h
.abfd
, 0, location_ptr
+ current_map
->pc
);
1930 r
->relent
.howto
= &abs16_howto
;
1932 current_map
->pc
+= 2;
1937 #if KEEPMINUSPCININST
1938 bfd_put_8 (ieee
->h
.abfd
, (int) (-current_map
->pc
), location_ptr
+ current_map
->pc
);
1939 r
->relent
.addend
-= current_map
->pc
;
1940 r
->relent
.howto
= &rel8_howto
;
1942 bfd_put_8 (ieee
->h
.abfd
, 0, location_ptr
+ current_map
->pc
);
1943 r
->relent
.howto
= &rel8_howto
;
1948 bfd_put_8 (ieee
->h
.abfd
, 0, location_ptr
+ current_map
->pc
);
1949 r
->relent
.howto
= &abs8_howto
;
1951 current_map
->pc
+= 1;
1963 if (parse_int (&(ieee
->h
), &this_size
) == true)
1966 for (i
= 0; i
< this_size
; i
++)
1968 location_ptr
[current_map
->pc
++] = this_byte (&(ieee
->h
));
1969 next_byte (&(ieee
->h
));
1979 /* Prevent more than the first load-item of an LR record
1980 from being repeated (MRI convention). */
1981 if (iterations
!= 1)
1989 /* Read in all the section data and relocation stuff too */
1991 ieee_slurp_section_data (abfd
)
1994 bfd_byte
*location_ptr
= (bfd_byte
*) NULL
;
1995 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
1996 unsigned int section_number
;
1998 ieee_per_section_type
*current_map
= (ieee_per_section_type
*) NULL
;
2000 /* Seek to the start of the data area */
2001 if (ieee
->read_data
== true)
2003 ieee
->read_data
= true;
2004 ieee_seek (ieee
, ieee
->w
.r
.data_part
);
2006 /* Allocate enough space for all the section contents */
2008 for (s
= abfd
->sections
; s
!= (asection
*) NULL
; s
= s
->next
)
2010 ieee_per_section_type
*per
= (ieee_per_section_type
*) s
->used_by_bfd
;
2011 if ((s
->flags
& SEC_DEBUGGING
) != 0)
2013 per
->data
= (bfd_byte
*) bfd_alloc (ieee
->h
.abfd
, s
->_raw_size
);
2017 per
->reloc_tail_ptr
=
2018 (ieee_reloc_type
**) & (s
->relocation
);
2023 switch (this_byte (&(ieee
->h
)))
2025 /* IF we see anything strange then quit */
2029 case ieee_set_current_section_enum
:
2030 next_byte (&(ieee
->h
));
2031 section_number
= must_parse_int (&(ieee
->h
));
2032 s
= ieee
->section_table
[section_number
];
2033 s
->flags
|= SEC_LOAD
| SEC_HAS_CONTENTS
;
2034 current_map
= (ieee_per_section_type
*) s
->used_by_bfd
;
2035 location_ptr
= current_map
->data
- s
->vma
;
2036 /* The document I have says that Microtec's compilers reset */
2037 /* this after a sec section, even though the standard says not */
2039 current_map
->pc
= s
->vma
;
2042 case ieee_e2_first_byte_enum
:
2043 next_byte (&(ieee
->h
));
2044 switch (this_byte (&(ieee
->h
)))
2046 case ieee_set_current_pc_enum
& 0xff:
2049 ieee_symbol_index_type symbol
;
2052 next_byte (&(ieee
->h
));
2053 must_parse_int (&(ieee
->h
)); /* Throw away section #*/
2054 parse_expression (ieee
, &value
,
2058 current_map
->pc
= value
;
2059 BFD_ASSERT ((unsigned) (value
- s
->vma
) <= s
->_raw_size
);
2063 case ieee_value_starting_address_enum
& 0xff:
2064 next_byte (&(ieee
->h
));
2065 if (this_byte (&(ieee
->h
)) == ieee_function_either_open_b_enum
)
2066 next_byte (&(ieee
->h
));
2067 abfd
->start_address
= must_parse_int (&(ieee
->h
));
2068 /* We've got to the end of the data now - */
2075 case ieee_repeat_data_enum
:
2077 /* Repeat the following LD or LR n times - we do this by
2078 remembering the stream pointer before running it and
2079 resetting it and running it n times. We special case
2080 the repetition of a repeat_data/load_constant
2083 unsigned int iterations
;
2084 unsigned char *start
;
2085 next_byte (&(ieee
->h
));
2086 iterations
= must_parse_int (&(ieee
->h
));
2087 start
= ieee
->h
.input_p
;
2088 if (start
[0] == (int) ieee_load_constant_bytes_enum
&&
2091 while (iterations
!= 0)
2093 location_ptr
[current_map
->pc
++] = start
[2];
2096 next_byte (&(ieee
->h
));
2097 next_byte (&(ieee
->h
));
2098 next_byte (&(ieee
->h
));
2102 while (iterations
!= 0)
2104 ieee
->h
.input_p
= start
;
2105 if (!do_one (ieee
, current_map
, location_ptr
, s
,
2113 case ieee_load_constant_bytes_enum
:
2114 case ieee_load_with_relocation_enum
:
2116 if (!do_one (ieee
, current_map
, location_ptr
, s
, 1))
2124 ieee_new_section_hook (abfd
, newsect
)
2128 newsect
->used_by_bfd
= (PTR
)
2129 bfd_alloc (abfd
, sizeof (ieee_per_section_type
));
2130 if (!newsect
->used_by_bfd
)
2132 ieee_per_section (newsect
)->data
= (bfd_byte
*) NULL
;
2133 ieee_per_section (newsect
)->section
= newsect
;
2138 ieee_get_reloc_upper_bound (abfd
, asect
)
2142 if ((asect
->flags
& SEC_DEBUGGING
) != 0)
2144 if (! ieee_slurp_section_data (abfd
))
2146 return (asect
->reloc_count
+ 1) * sizeof (arelent
*);
2150 ieee_get_section_contents (abfd
, section
, location
, offset
, count
)
2155 bfd_size_type count
;
2157 ieee_per_section_type
*p
= (ieee_per_section_type
*) section
->used_by_bfd
;
2158 if ((section
->flags
& SEC_DEBUGGING
) != 0)
2159 return _bfd_generic_get_section_contents (abfd
, section
, location
,
2161 ieee_slurp_section_data (abfd
);
2162 (void) memcpy ((PTR
) location
, (PTR
) (p
->data
+ offset
), (unsigned) count
);
2167 ieee_canonicalize_reloc (abfd
, section
, relptr
, symbols
)
2173 /* ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;*/
2174 ieee_reloc_type
*src
= (ieee_reloc_type
*) (section
->relocation
);
2175 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
2177 if ((section
->flags
& SEC_DEBUGGING
) != 0)
2180 while (src
!= (ieee_reloc_type
*) NULL
)
2182 /* Work out which symbol to attach it this reloc to */
2183 switch (src
->symbol
.letter
)
2186 src
->relent
.sym_ptr_ptr
=
2187 symbols
+ src
->symbol
.index
+ ieee
->external_symbol_base_offset
;
2190 src
->relent
.sym_ptr_ptr
=
2191 symbols
+ src
->symbol
.index
+ ieee
->external_reference_base_offset
;
2194 if (src
->relent
.sym_ptr_ptr
!= NULL
)
2195 src
->relent
.sym_ptr_ptr
=
2196 src
->relent
.sym_ptr_ptr
[0]->section
->symbol_ptr_ptr
;
2202 *relptr
++ = &src
->relent
;
2205 *relptr
= (arelent
*) NULL
;
2206 return section
->reloc_count
;
2214 arelent
*a
= *((arelent
**) ap
);
2215 arelent
*b
= *((arelent
**) bp
);
2216 return a
->address
- b
->address
;
2219 /* Write the section headers. */
2222 ieee_write_section_part (abfd
)
2225 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
2227 ieee
->w
.r
.section_part
= bfd_tell (abfd
);
2228 for (s
= abfd
->sections
; s
!= (asection
*) NULL
; s
= s
->next
)
2230 if (! bfd_is_abs_section (s
)
2231 && (s
->flags
& SEC_DEBUGGING
) == 0)
2233 if (! ieee_write_byte (abfd
, ieee_section_type_enum
)
2234 || ! ieee_write_byte (abfd
,
2235 (bfd_byte
) (s
->index
2236 + IEEE_SECTION_NUMBER_BASE
)))
2239 if (abfd
->flags
& EXEC_P
)
2241 /* This image is executable, so output absolute sections */
2242 if (! ieee_write_byte (abfd
, ieee_variable_A_enum
)
2243 || ! ieee_write_byte (abfd
, ieee_variable_S_enum
))
2248 if (! ieee_write_byte (abfd
, ieee_variable_C_enum
))
2252 switch (s
->flags
& (SEC_CODE
| SEC_DATA
| SEC_ROM
))
2254 case SEC_CODE
| SEC_LOAD
:
2256 if (! ieee_write_byte (abfd
, ieee_variable_P_enum
))
2261 if (! ieee_write_byte (abfd
, ieee_variable_D_enum
))
2265 case SEC_ROM
| SEC_DATA
:
2266 case SEC_ROM
| SEC_LOAD
:
2267 case SEC_ROM
| SEC_DATA
| SEC_LOAD
:
2268 if (! ieee_write_byte (abfd
, ieee_variable_R_enum
))
2273 if (! ieee_write_id (abfd
, s
->name
))
2276 ieee_write_int (abfd
, 0); /* Parent */
2277 ieee_write_int (abfd
, 0); /* Brother */
2278 ieee_write_int (abfd
, 0); /* Context */
2281 if (! ieee_write_byte (abfd
, ieee_section_alignment_enum
)
2282 || ! ieee_write_byte (abfd
,
2283 (bfd_byte
) (s
->index
2284 + IEEE_SECTION_NUMBER_BASE
))
2285 || ! ieee_write_int (abfd
, 1 << s
->alignment_power
))
2289 if (! ieee_write_2bytes (abfd
, ieee_section_size_enum
)
2290 || ! ieee_write_byte (abfd
,
2291 (bfd_byte
) (s
->index
2292 + IEEE_SECTION_NUMBER_BASE
))
2293 || ! ieee_write_int (abfd
, s
->_raw_size
))
2295 if (abfd
->flags
& EXEC_P
)
2297 /* Relocateable sections don't have asl records */
2299 if (! ieee_write_2bytes (abfd
, ieee_section_base_address_enum
)
2300 || ! ieee_write_byte (abfd
,
2303 + IEEE_SECTION_NUMBER_BASE
)))
2304 || ! ieee_write_int (abfd
, s
->lma
))
2315 do_with_relocs (abfd
, s
)
2319 unsigned int number_of_maus_in_address
=
2320 bfd_arch_bits_per_address (abfd
) / bfd_arch_bits_per_byte (abfd
);
2321 unsigned int relocs_to_go
= s
->reloc_count
;
2322 bfd_byte
*stream
= ieee_per_section (s
)->data
;
2323 arelent
**p
= s
->orelocation
;
2324 bfd_size_type current_byte_index
= 0;
2326 qsort (s
->orelocation
,
2328 sizeof (arelent
**),
2331 /* Output the section preheader */
2332 if (! ieee_write_byte (abfd
, ieee_set_current_section_enum
)
2333 || ! ieee_write_byte (abfd
,
2334 (bfd_byte
) (s
->index
+ IEEE_SECTION_NUMBER_BASE
))
2335 || ! ieee_write_2bytes (abfd
, ieee_set_current_pc_enum
)
2336 || ! ieee_write_byte (abfd
,
2337 (bfd_byte
) (s
->index
+ IEEE_SECTION_NUMBER_BASE
)))
2340 if ((abfd
->flags
& EXEC_P
) != 0 && relocs_to_go
== 0)
2342 if (! ieee_write_int (abfd
, s
->lma
))
2347 if (! ieee_write_expression (abfd
, 0, s
->symbol
, 0, 0))
2351 if (relocs_to_go
== 0)
2353 /* If there aren't any relocations then output the load constant
2354 byte opcode rather than the load with relocation opcode */
2356 while (current_byte_index
< s
->_raw_size
)
2359 unsigned int MAXRUN
= 127;
2361 if (run
> s
->_raw_size
- current_byte_index
)
2363 run
= s
->_raw_size
- current_byte_index
;
2368 if (! ieee_write_byte (abfd
, ieee_load_constant_bytes_enum
))
2370 /* Output a stream of bytes */
2371 if (! ieee_write_int (abfd
, run
))
2373 if (bfd_write ((PTR
) (stream
+ current_byte_index
),
2379 current_byte_index
+= run
;
2385 if (! ieee_write_byte (abfd
, ieee_load_with_relocation_enum
))
2388 /* Output the data stream as the longest sequence of bytes
2389 possible, allowing for the a reasonable packet size and
2390 relocation stuffs. */
2392 if ((PTR
) stream
== (PTR
) NULL
)
2394 /* Outputting a section without data, fill it up */
2395 stream
= (unsigned char *) (bfd_alloc (abfd
, s
->_raw_size
));
2398 memset ((PTR
) stream
, 0, (size_t) s
->_raw_size
);
2400 while (current_byte_index
< s
->_raw_size
)
2403 unsigned int MAXRUN
= 127;
2406 run
= (*p
)->address
- current_byte_index
;
2414 if (run
> s
->_raw_size
- current_byte_index
)
2416 run
= s
->_raw_size
- current_byte_index
;
2421 /* Output a stream of bytes */
2422 if (! ieee_write_int (abfd
, run
))
2424 if (bfd_write ((PTR
) (stream
+ current_byte_index
),
2430 current_byte_index
+= run
;
2432 /* Output any relocations here */
2433 if (relocs_to_go
&& (*p
) && (*p
)->address
== current_byte_index
)
2436 && (*p
) && (*p
)->address
== current_byte_index
)
2442 if (r
->howto
->pc_relative
)
2444 r
->addend
+= current_byte_index
;
2448 switch (r
->howto
->size
)
2452 ov
= bfd_get_signed_32 (abfd
,
2453 stream
+ current_byte_index
);
2454 current_byte_index
+= 4;
2457 ov
= bfd_get_signed_16 (abfd
,
2458 stream
+ current_byte_index
);
2459 current_byte_index
+= 2;
2462 ov
= bfd_get_signed_8 (abfd
,
2463 stream
+ current_byte_index
);
2464 current_byte_index
++;
2472 ov
&= r
->howto
->src_mask
;
2474 if (r
->howto
->pc_relative
2475 && ! r
->howto
->pcrel_offset
)
2478 if (! ieee_write_byte (abfd
,
2479 ieee_function_either_open_b_enum
))
2484 if (r
->sym_ptr_ptr
!= (asymbol
**) NULL
)
2486 if (! ieee_write_expression (abfd
, r
->addend
+ ov
,
2488 r
->howto
->pc_relative
,
2494 if (! ieee_write_expression (abfd
, r
->addend
+ ov
,
2496 r
->howto
->pc_relative
,
2501 if (number_of_maus_in_address
2502 != bfd_get_reloc_size (r
->howto
))
2504 if (! ieee_write_int (abfd
,
2505 bfd_get_reloc_size (r
->howto
)))
2508 if (! ieee_write_byte (abfd
,
2509 ieee_function_either_close_b_enum
))
2523 /* If there are no relocations in the output section then we can be
2524 clever about how we write. We block items up into a max of 127
2528 do_as_repeat (abfd
, s
)
2534 if (! ieee_write_byte (abfd
, ieee_set_current_section_enum
)
2535 || ! ieee_write_byte (abfd
,
2536 (bfd_byte
) (s
->index
2537 + IEEE_SECTION_NUMBER_BASE
))
2538 || ! ieee_write_byte (abfd
, ieee_set_current_pc_enum
>> 8)
2539 || ! ieee_write_byte (abfd
, ieee_set_current_pc_enum
& 0xff)
2540 || ! ieee_write_byte (abfd
,
2541 (bfd_byte
) (s
->index
2542 + IEEE_SECTION_NUMBER_BASE
)))
2545 if ((abfd
->flags
& EXEC_P
) != 0)
2547 if (! ieee_write_int (abfd
, s
->lma
))
2552 if (! ieee_write_expression (abfd
, 0, s
->symbol
, 0, 0))
2556 if (! ieee_write_byte (abfd
, ieee_repeat_data_enum
)
2557 || ! ieee_write_int (abfd
, s
->_raw_size
)
2558 || ! ieee_write_byte (abfd
, ieee_load_constant_bytes_enum
)
2559 || ! ieee_write_byte (abfd
, 1)
2560 || ! ieee_write_byte (abfd
, 0))
2568 do_without_relocs (abfd
, s
)
2572 bfd_byte
*stream
= ieee_per_section (s
)->data
;
2574 if (stream
== 0 || ((s
->flags
& SEC_LOAD
) == 0))
2576 if (! do_as_repeat (abfd
, s
))
2582 for (i
= 0; i
< s
->_raw_size
; i
++)
2586 if (! do_with_relocs (abfd
, s
))
2591 if (! do_as_repeat (abfd
, s
))
2599 static unsigned char *output_ptr_start
;
2600 static unsigned char *output_ptr
;
2601 static unsigned char *output_ptr_end
;
2602 static unsigned char *input_ptr_start
;
2603 static unsigned char *input_ptr
;
2604 static unsigned char *input_ptr_end
;
2605 static bfd
*input_bfd
;
2606 static bfd
*output_bfd
;
2607 static int output_buffer
;
2610 ieee_mkobject (abfd
)
2613 output_ptr_start
= NULL
;
2615 output_ptr_end
= NULL
;
2616 input_ptr_start
= NULL
;
2618 input_ptr_end
= NULL
;
2622 abfd
->tdata
.ieee_data
= (ieee_data_type
*) bfd_zalloc (abfd
, sizeof (ieee_data_type
));
2623 return abfd
->tdata
.ieee_data
? true : false;
2629 /* FIXME: Check return value. I'm not sure whether it needs to read
2630 the entire buffer or not. */
2631 bfd_read ((PTR
) input_ptr_start
, 1, input_ptr_end
- input_ptr_start
, input_bfd
);
2632 input_ptr
= input_ptr_start
;
2638 if (bfd_write ((PTR
) (output_ptr_start
), 1, output_ptr
- output_ptr_start
,
2640 != (bfd_size_type
) (output_ptr
- output_ptr_start
))
2642 output_ptr
= output_ptr_start
;
2646 #define THIS() ( *input_ptr )
2647 #define NEXT() { input_ptr++; if (input_ptr == input_ptr_end) fill(); }
2648 #define OUT(x) { *output_ptr++ = (x); if(output_ptr == output_ptr_end) flush(); }
2654 if (value
>= 0 && value
<= 127)
2660 unsigned int length
;
2661 /* How many significant bytes ? */
2662 /* FIXME FOR LONGER INTS */
2663 if (value
& 0xff000000)
2667 else if (value
& 0x00ff0000)
2671 else if (value
& 0x0000ff00)
2678 OUT ((int) ieee_number_repeat_start_enum
+ length
);
2697 int length
= THIS ();
2709 #define VAR(x) ((x | 0x80))
2724 value
= (value
<< 8) | THIS ();
2726 value
= (value
<< 8) | THIS ();
2728 value
= (value
<< 8) | THIS ();
2736 value
= (value
<< 8) | THIS ();
2738 value
= (value
<< 8) | THIS ();
2746 value
= (value
<< 8) | THIS ();
2763 /* Not a number, just bug out with the answer */
2764 write_int (*(--tos
));
2774 int value
= *(--tos
);
2783 ieee_data_type
*ieee
;
2786 section_number
= THIS ();
2789 ieee
= IEEE_DATA (input_bfd
);
2790 s
= ieee
->section_table
[section_number
];
2791 if (s
->output_section
)
2793 value
= s
->output_section
->lma
;
2799 value
+= s
->output_offset
;
2807 write_int (*(--tos
));
2817 /* Drop the int in the buffer, and copy a null into the gap, which we
2818 will overwrite later */
2822 struct output_buffer_struct
*buf
;
2824 if (buf
->buffer
== output_buffer
)
2826 /* Still a chance to output the size */
2827 int value
= output_ptr
- buf
->ptrp
+ 3;
2828 buf
->ptrp
[0] = value
>> 24;
2829 buf
->ptrp
[1] = value
>> 16;
2830 buf
->ptrp
[2] = value
>> 8;
2831 buf
->ptrp
[3] = value
>> 0;
2837 struct output_buffer_struct
*buf
;
2863 buf
->ptrp
= output_ptr
;
2864 buf
->buffer
= output_buffer
;
2904 #define ID copy_id()
2905 #define INT copy_int()
2906 #define EXP copy_expression()
2907 #define INTn(q) copy_int()
2908 #define EXPn(q) copy_expression()
2947 EXPn (instruction address
);
2981 EXPn (external function
);
2991 INTn (locked
register);
3014 /* Attribute record */
3083 /* Unique typedefs for module */
3084 /* GLobal typedefs */
3085 /* High level module scope beginning */
3087 struct output_buffer_struct ob
;
3102 /* Global function */
3104 struct output_buffer_struct ob
;
3118 EXPn (size of block
);
3124 /* File name for source line numbers */
3126 struct output_buffer_struct ob
;
3146 /* Local function */
3148 struct output_buffer_struct ob
;
3166 /* Assembler module scope beginning -*/
3168 struct output_buffer_struct ob
;
3194 struct output_buffer_struct ob
;
3201 INTn (section index
);
3209 EXPn (Size in Maus
);
3264 moves all the debug information from the source bfd to the output
3265 bfd, and relocates any expressions it finds
3269 relocate_debug (output
, input
)
3270 bfd
*output ATTRIBUTE_UNUSED
;
3275 unsigned char input_buffer
[IBS
];
3277 input_ptr_start
= input_ptr
= input_buffer
;
3278 input_ptr_end
= input_buffer
+ IBS
;
3280 /* FIXME: Check return value. I'm not sure whether it needs to read
3281 the entire buffer or not. */
3282 bfd_read ((PTR
) input_ptr_start
, 1, IBS
, input
);
3286 /* Gather together all the debug information from each input BFD into
3287 one place, relocating it and emitting it as we go. */
3290 ieee_write_debug_part (abfd
)
3293 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
3294 bfd_chain_type
*chain
= ieee
->chain_root
;
3295 unsigned char output_buffer
[OBS
];
3296 boolean some_debug
= false;
3297 file_ptr here
= bfd_tell (abfd
);
3299 output_ptr_start
= output_ptr
= output_buffer
;
3300 output_ptr_end
= output_buffer
+ OBS
;
3301 output_ptr
= output_buffer
;
3304 if (chain
== (bfd_chain_type
*) NULL
)
3308 for (s
= abfd
->sections
; s
!= NULL
; s
= s
->next
)
3309 if ((s
->flags
& SEC_DEBUGGING
) != 0)
3313 ieee
->w
.r
.debug_information_part
= 0;
3317 ieee
->w
.r
.debug_information_part
= here
;
3318 if (bfd_write (s
->contents
, 1, s
->_raw_size
, abfd
) != s
->_raw_size
)
3323 while (chain
!= (bfd_chain_type
*) NULL
)
3325 bfd
*entry
= chain
->this;
3326 ieee_data_type
*entry_ieee
= IEEE_DATA (entry
);
3327 if (entry_ieee
->w
.r
.debug_information_part
)
3329 if (bfd_seek (entry
, entry_ieee
->w
.r
.debug_information_part
,
3333 relocate_debug (abfd
, entry
);
3336 chain
= chain
->next
;
3340 ieee
->w
.r
.debug_information_part
= here
;
3344 ieee
->w
.r
.debug_information_part
= 0;
3353 /* Write the data in an ieee way. */
3356 ieee_write_data_part (abfd
)
3360 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
3361 ieee
->w
.r
.data_part
= bfd_tell (abfd
);
3362 for (s
= abfd
->sections
; s
!= (asection
*) NULL
; s
= s
->next
)
3364 /* Skip sections that have no loadable contents (.bss,
3366 if ((s
->flags
& SEC_LOAD
) == 0)
3369 /* Sort the reloc records so we can insert them in the correct
3371 if (s
->reloc_count
!= 0)
3373 if (! do_with_relocs (abfd
, s
))
3378 if (! do_without_relocs (abfd
, s
))
3388 init_for_output (abfd
)
3392 for (s
= abfd
->sections
; s
!= (asection
*) NULL
; s
= s
->next
)
3394 if ((s
->flags
& SEC_DEBUGGING
) != 0)
3396 if (s
->_raw_size
!= 0)
3398 ieee_per_section (s
)->data
= (bfd_byte
*) (bfd_alloc (abfd
, s
->_raw_size
));
3399 if (!ieee_per_section (s
)->data
)
3406 /** exec and core file sections */
3408 /* set section contents is complicated with IEEE since the format is
3409 * not a byte image, but a record stream.
3412 ieee_set_section_contents (abfd
, section
, location
, offset
, count
)
3417 bfd_size_type count
;
3419 if ((section
->flags
& SEC_DEBUGGING
) != 0)
3421 if (section
->contents
== NULL
)
3423 section
->contents
= ((unsigned char *)
3424 bfd_alloc (abfd
, section
->_raw_size
));
3425 if (section
->contents
== NULL
)
3428 /* bfd_set_section_contents has already checked that everything
3430 memcpy (section
->contents
+ offset
, location
, count
);
3434 if (ieee_per_section (section
)->data
== (bfd_byte
*) NULL
)
3436 if (!init_for_output (abfd
))
3439 memcpy ((PTR
) (ieee_per_section (section
)->data
+ offset
),
3441 (unsigned int) count
);
3445 /* Write the external symbols of a file. IEEE considers two sorts of
3446 external symbols, public, and referenced. It uses to internal
3447 forms to index them as well. When we write them out we turn their
3448 symbol values into indexes from the right base. */
3451 ieee_write_external_part (abfd
)
3455 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
3457 unsigned int reference_index
= IEEE_REFERENCE_BASE
;
3458 unsigned int public_index
= IEEE_PUBLIC_BASE
+ 2;
3459 file_ptr here
= bfd_tell (abfd
);
3460 boolean hadone
= false;
3461 if (abfd
->outsymbols
!= (asymbol
**) NULL
)
3464 for (q
= abfd
->outsymbols
; *q
!= (asymbol
*) NULL
; q
++)
3467 if (bfd_is_und_section (p
->section
))
3469 /* This must be a symbol reference .. */
3470 if (! ieee_write_byte (abfd
, ieee_external_reference_enum
)
3471 || ! ieee_write_int (abfd
, reference_index
)
3472 || ! ieee_write_id (abfd
, p
->name
))
3474 p
->value
= reference_index
;
3478 else if (bfd_is_com_section (p
->section
))
3480 /* This is a weak reference */
3481 if (! ieee_write_byte (abfd
, ieee_external_reference_enum
)
3482 || ! ieee_write_int (abfd
, reference_index
)
3483 || ! ieee_write_id (abfd
, p
->name
)
3484 || ! ieee_write_byte (abfd
,
3485 ieee_weak_external_reference_enum
)
3486 || ! ieee_write_int (abfd
, reference_index
)
3487 || ! ieee_write_int (abfd
, p
->value
))
3489 p
->value
= reference_index
;
3493 else if (p
->flags
& BSF_GLOBAL
)
3495 /* This must be a symbol definition */
3497 if (! ieee_write_byte (abfd
, ieee_external_symbol_enum
)
3498 || ! ieee_write_int (abfd
, public_index
)
3499 || ! ieee_write_id (abfd
, p
->name
)
3500 || ! ieee_write_2bytes (abfd
, ieee_attribute_record_enum
)
3501 || ! ieee_write_int (abfd
, public_index
)
3502 || ! ieee_write_byte (abfd
, 15) /* instruction address */
3503 || ! ieee_write_byte (abfd
, 19) /* static symbol */
3504 || ! ieee_write_byte (abfd
, 1)) /* one of them */
3507 /* Write out the value */
3508 if (! ieee_write_2bytes (abfd
, ieee_value_record_enum
)
3509 || ! ieee_write_int (abfd
, public_index
))
3511 if (! bfd_is_abs_section (p
->section
))
3513 if (abfd
->flags
& EXEC_P
)
3515 /* If fully linked, then output all symbols
3517 if (! (ieee_write_int
3520 + p
->section
->output_offset
3521 + p
->section
->output_section
->vma
))))
3526 if (! (ieee_write_expression
3528 p
->value
+ p
->section
->output_offset
,
3529 p
->section
->output_section
->symbol
,
3536 if (! ieee_write_expression (abfd
,
3538 bfd_abs_section_ptr
->symbol
,
3542 p
->value
= public_index
;
3548 /* This can happen - when there are gaps in the symbols read */
3549 /* from an input ieee file */
3554 ieee
->w
.r
.external_part
= here
;
3560 static const unsigned char exten
[] =
3563 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3 */
3564 0xf1, 0xce, 0x20, 0x00, 39, 2,/* keep symbol in original case */
3565 0xf1, 0xce, 0x20, 0x00, 38 /* set object type relocateable to x */
3568 static const unsigned char envi
[] =
3572 /* 0xf1, 0xce, 0x21, 00, 50, 0x82, 0x07, 0xc7, 0x09, 0x11, 0x11,
3575 0xf1, 0xce, 0x21, 00, 52, 0x00, /* exec ok */
3577 0xf1, 0xce, 0x21, 0, 53, 0x03,/* host unix */
3578 /* 0xf1, 0xce, 0x21, 0, 54, 2,1,1 tool & version # */
3582 ieee_write_me_part (abfd
)
3585 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
3586 ieee
->w
.r
.trailer_part
= bfd_tell (abfd
);
3587 if (abfd
->start_address
)
3589 if (! ieee_write_2bytes (abfd
, ieee_value_starting_address_enum
)
3590 || ! ieee_write_byte (abfd
, ieee_function_either_open_b_enum
)
3591 || ! ieee_write_int (abfd
, abfd
->start_address
)
3592 || ! ieee_write_byte (abfd
, ieee_function_either_close_b_enum
))
3595 ieee
->w
.r
.me_record
= bfd_tell (abfd
);
3596 if (! ieee_write_byte (abfd
, ieee_module_end_enum
))
3601 /* Write out the IEEE processor ID. */
3604 ieee_write_processor (abfd
)
3607 const bfd_arch_info_type
*arch
;
3609 arch
= bfd_get_arch_info (abfd
);
3613 if (! ieee_write_id (abfd
, bfd_printable_name (abfd
)))
3618 if (! ieee_write_id (abfd
, "29000"))
3622 case bfd_arch_h8300
:
3623 if (! ieee_write_id (abfd
, "H8/300"))
3627 case bfd_arch_h8500
:
3628 if (! ieee_write_id (abfd
, "H8/500"))
3636 case bfd_mach_i960_core
:
3637 case bfd_mach_i960_ka_sa
:
3638 if (! ieee_write_id (abfd
, "80960KA"))
3642 case bfd_mach_i960_kb_sb
:
3643 if (! ieee_write_id (abfd
, "80960KB"))
3647 case bfd_mach_i960_ca
:
3648 if (! ieee_write_id (abfd
, "80960CA"))
3652 case bfd_mach_i960_mc
:
3653 case bfd_mach_i960_xa
:
3654 if (! ieee_write_id (abfd
, "80960MC"))
3666 default: id
= "68020"; break;
3667 case bfd_mach_m68000
: id
= "68000"; break;
3668 case bfd_mach_m68008
: id
= "68008"; break;
3669 case bfd_mach_m68010
: id
= "68010"; break;
3670 case bfd_mach_m68020
: id
= "68020"; break;
3671 case bfd_mach_m68030
: id
= "68030"; break;
3672 case bfd_mach_m68040
: id
= "68040"; break;
3673 case bfd_mach_m68060
: id
= "68060"; break;
3674 case bfd_mach_cpu32
: id
= "cpu32"; break;
3675 case bfd_mach_mcf5200
:id
= "5200"; break;
3676 case bfd_mach_mcf5206e
:id
= "5206e"; break;
3677 case bfd_mach_mcf5307
:id
= "5307"; break;
3678 case bfd_mach_mcf5407
:id
= "5407"; break;
3681 if (! ieee_write_id (abfd
, id
))
3691 ieee_write_object_contents (abfd
)
3694 ieee_data_type
*ieee
= IEEE_DATA (abfd
);
3698 /* Fast forward over the header area */
3699 if (bfd_seek (abfd
, (file_ptr
) 0, SEEK_SET
) != 0)
3702 if (! ieee_write_byte (abfd
, ieee_module_beginning_enum
)
3703 || ! ieee_write_processor (abfd
)
3704 || ! ieee_write_id (abfd
, abfd
->filename
))
3707 /* Fast forward over the variable bits */
3708 if (! ieee_write_byte (abfd
, ieee_address_descriptor_enum
))
3712 if (! ieee_write_byte (abfd
, (bfd_byte
) (bfd_arch_bits_per_byte (abfd
))))
3714 /* MAU's per address */
3715 if (! ieee_write_byte (abfd
,
3716 (bfd_byte
) (bfd_arch_bits_per_address (abfd
)
3717 / bfd_arch_bits_per_byte (abfd
))))
3720 old
= bfd_tell (abfd
);
3721 if (bfd_seek (abfd
, (file_ptr
) (8 * N_W_VARIABLES
), SEEK_CUR
) != 0)
3724 ieee
->w
.r
.extension_record
= bfd_tell (abfd
);
3725 if (bfd_write ((char *) exten
, 1, sizeof (exten
), abfd
) != sizeof (exten
))
3727 if (abfd
->flags
& EXEC_P
)
3729 if (! ieee_write_byte (abfd
, 0x1)) /* Absolute */
3734 if (! ieee_write_byte (abfd
, 0x2)) /* Relocateable */
3738 ieee
->w
.r
.environmental_record
= bfd_tell (abfd
);
3739 if (bfd_write ((char *) envi
, 1, sizeof (envi
), abfd
) != sizeof (envi
))
3742 /* The HP emulator database requires a timestamp in the file. */
3748 t
= (struct tm
*) localtime (&now
);
3749 if (! ieee_write_2bytes (abfd
, (int) ieee_atn_record_enum
)
3750 || ! ieee_write_byte (abfd
, 0x21)
3751 || ! ieee_write_byte (abfd
, 0)
3752 || ! ieee_write_byte (abfd
, 50)
3753 || ! ieee_write_int (abfd
, t
->tm_year
+ 1900)
3754 || ! ieee_write_int (abfd
, t
->tm_mon
+ 1)
3755 || ! ieee_write_int (abfd
, t
->tm_mday
)
3756 || ! ieee_write_int (abfd
, t
->tm_hour
)
3757 || ! ieee_write_int (abfd
, t
->tm_min
)
3758 || ! ieee_write_int (abfd
, t
->tm_sec
))
3766 if (! ieee_write_section_part (abfd
))
3768 /* First write the symbols. This changes their values into table
3769 indeces so we cant use it after this point. */
3770 if (! ieee_write_external_part (abfd
))
3773 /* ieee_write_byte(abfd, ieee_record_seperator_enum);*/
3775 /* ieee_write_byte(abfd, ieee_record_seperator_enum);*/
3778 /* Write any debugs we have been told about. */
3779 if (! ieee_write_debug_part (abfd
))
3782 /* Can only write the data once the symbols have been written, since
3783 the data contains relocation information which points to the
3785 if (! ieee_write_data_part (abfd
))
3788 /* At the end we put the end! */
3789 if (! ieee_write_me_part (abfd
))
3792 /* Generate the header */
3793 if (bfd_seek (abfd
, old
, SEEK_SET
) != 0)
3796 for (i
= 0; i
< N_W_VARIABLES
; i
++)
3798 if (! ieee_write_2bytes (abfd
, ieee_assign_value_to_variable_enum
)
3799 || ! ieee_write_byte (abfd
, (bfd_byte
) i
)
3800 || ! ieee_write_int5_out (abfd
, ieee
->w
.offset
[i
]))
3807 /* Native-level interface to symbols. */
3809 /* We read the symbols into a buffer, which is discarded when this
3810 function exits. We read the strings into a buffer large enough to
3811 hold them all plus all the cached symbol entries. */
3814 ieee_make_empty_symbol (abfd
)
3817 ieee_symbol_type
*new =
3818 (ieee_symbol_type
*) bfd_zalloc (abfd
, sizeof (ieee_symbol_type
));
3821 new->symbol
.the_bfd
= abfd
;
3822 return &new->symbol
;
3826 ieee_openr_next_archived_file (arch
, prev
)
3830 ieee_ar_data_type
*ar
= IEEE_AR_DATA (arch
);
3831 /* take the next one from the arch state, or reset */
3832 if (prev
== (bfd
*) NULL
)
3834 /* Reset the index - the first two entries are bogus*/
3835 ar
->element_index
= 2;
3839 ieee_ar_obstack_type
*p
= ar
->elements
+ ar
->element_index
;
3840 ar
->element_index
++;
3841 if (ar
->element_index
<= ar
->element_count
)
3843 if (p
->file_offset
!= (file_ptr
) 0)
3845 if (p
->abfd
== (bfd
*) NULL
)
3847 p
->abfd
= _bfd_create_empty_archive_element_shell (arch
);
3848 p
->abfd
->origin
= p
->file_offset
;
3855 bfd_set_error (bfd_error_no_more_archived_files
);
3856 return (bfd
*) NULL
;
3863 ieee_find_nearest_line (abfd
, section
, symbols
, offset
, filename_ptr
,
3864 functionname_ptr
, line_ptr
)
3865 bfd
*abfd ATTRIBUTE_UNUSED
;
3866 asection
*section ATTRIBUTE_UNUSED
;
3867 asymbol
**symbols ATTRIBUTE_UNUSED
;
3868 bfd_vma offset ATTRIBUTE_UNUSED
;
3869 const char **filename_ptr ATTRIBUTE_UNUSED
;
3870 const char **functionname_ptr ATTRIBUTE_UNUSED
;
3871 unsigned int *line_ptr ATTRIBUTE_UNUSED
;
3877 ieee_generic_stat_arch_elt (abfd
, buf
)
3881 ieee_ar_data_type
*ar
= (ieee_ar_data_type
*) NULL
;
3882 ieee_data_type
*ieee
;
3884 if (abfd
->my_archive
!= NULL
)
3885 ar
= abfd
->my_archive
->tdata
.ieee_ar_data
;
3886 if (ar
== (ieee_ar_data_type
*) NULL
)
3888 bfd_set_error (bfd_error_invalid_operation
);
3892 if (IEEE_DATA (abfd
) == NULL
)
3894 if (ieee_object_p (abfd
) == NULL
)
3896 bfd_set_error (bfd_error_wrong_format
);
3901 ieee
= IEEE_DATA (abfd
);
3903 buf
->st_size
= ieee
->w
.r
.me_record
+ 1;
3904 buf
->st_mode
= 0644;
3909 ieee_sizeof_headers (abfd
, x
)
3910 bfd
*abfd ATTRIBUTE_UNUSED
;
3911 boolean x ATTRIBUTE_UNUSED
;
3917 /* The debug info routines are never used. */
3921 ieee_bfd_debug_info_start (abfd
)
3928 ieee_bfd_debug_info_end (abfd
)
3935 /* Add this section to the list of sections we have debug info for, to
3936 be ready to output it at close time
3939 ieee_bfd_debug_info_accumulate (abfd
, section
)
3943 ieee_data_type
*ieee
= IEEE_DATA (section
->owner
);
3944 ieee_data_type
*output_ieee
= IEEE_DATA (abfd
);
3945 /* can only accumulate data from other ieee bfds */
3946 if (section
->owner
->xvec
!= abfd
->xvec
)
3948 /* Only bother once per bfd */
3949 if (ieee
->done_debug
== true)
3951 ieee
->done_debug
= true;
3953 /* Don't bother if there is no debug info */
3954 if (ieee
->w
.r
.debug_information_part
== 0)
3960 bfd_chain_type
*n
= (bfd_chain_type
*) bfd_alloc (abfd
, sizeof (bfd_chain_type
));
3962 abort (); /* FIXME */
3963 n
->this = section
->owner
;
3964 n
->next
= (bfd_chain_type
*) NULL
;
3966 if (output_ieee
->chain_head
)
3968 output_ieee
->chain_head
->next
= n
;
3972 output_ieee
->chain_root
= n
;
3975 output_ieee
->chain_head
= n
;
3981 #define ieee_close_and_cleanup _bfd_generic_close_and_cleanup
3982 #define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
3984 #define ieee_slurp_armap bfd_true
3985 #define ieee_slurp_extended_name_table bfd_true
3986 #define ieee_construct_extended_name_table \
3987 ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
3989 #define ieee_truncate_arname bfd_dont_truncate_arname
3990 #define ieee_write_armap \
3992 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
3994 #define ieee_read_ar_hdr bfd_nullvoidptr
3995 #define ieee_update_armap_timestamp bfd_true
3996 #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index
3998 #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name
3999 #define ieee_get_lineno _bfd_nosymbols_get_lineno
4000 #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
4001 #define ieee_read_minisymbols _bfd_generic_read_minisymbols
4002 #define ieee_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
4004 #define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
4006 #define ieee_set_arch_mach _bfd_generic_set_arch_mach
4008 #define ieee_get_section_contents_in_window \
4009 _bfd_generic_get_section_contents_in_window
4010 #define ieee_bfd_get_relocated_section_contents \
4011 bfd_generic_get_relocated_section_contents
4012 #define ieee_bfd_relax_section bfd_generic_relax_section
4013 #define ieee_bfd_gc_sections bfd_generic_gc_sections
4014 #define ieee_bfd_merge_sections bfd_generic_merge_sections
4015 #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
4016 #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
4017 #define ieee_bfd_final_link _bfd_generic_final_link
4018 #define ieee_bfd_link_split_section _bfd_generic_link_split_section
4021 const bfd_target ieee_vec
=
4024 bfd_target_ieee_flavour
,
4025 BFD_ENDIAN_UNKNOWN
, /* target byte order */
4026 BFD_ENDIAN_UNKNOWN
, /* target headers byte order */
4027 (HAS_RELOC
| EXEC_P
| /* object flags */
4028 HAS_LINENO
| HAS_DEBUG
|
4029 HAS_SYMS
| HAS_LOCALS
| WP_TEXT
| D_PAGED
),
4030 (SEC_CODE
| SEC_DATA
| SEC_ROM
| SEC_HAS_CONTENTS
4031 | SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
), /* section flags */
4032 '_', /* leading underscore */
4033 ' ', /* ar_pad_char */
4034 16, /* ar_max_namelen */
4035 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
4036 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
4037 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* data */
4038 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
4039 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
4040 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
, /* hdrs */
4043 ieee_object_p
, /* bfd_check_format */
4050 _bfd_generic_mkarchive
,
4055 ieee_write_object_contents
,
4056 _bfd_write_archive_contents
,
4060 /* ieee_close_and_cleanup, ieee_bfd_free_cached_info, ieee_new_section_hook,
4061 ieee_get_section_contents, ieee_get_section_contents_in_window */
4062 BFD_JUMP_TABLE_GENERIC (ieee
),
4064 BFD_JUMP_TABLE_COPY (_bfd_generic
),
4065 BFD_JUMP_TABLE_CORE (_bfd_nocore
),
4067 /* ieee_slurp_armap, ieee_slurp_extended_name_table,
4068 ieee_construct_extended_name_table, ieee_truncate_arname,
4069 ieee_write_armap, ieee_read_ar_hdr, ieee_openr_next_archived_file,
4070 ieee_get_elt_at_index, ieee_generic_stat_arch_elt,
4071 ieee_update_armap_timestamp */
4072 BFD_JUMP_TABLE_ARCHIVE (ieee
),
4074 /* ieee_get_symtab_upper_bound, ieee_get_symtab, ieee_make_empty_symbol,
4075 ieee_print_symbol, ieee_get_symbol_info, ieee_bfd_is_local_label_name,
4076 ieee_get_lineno, ieee_find_nearest_line, ieee_bfd_make_debug_symbol,
4077 ieee_read_minisymbols, ieee_minisymbol_to_symbol */
4078 BFD_JUMP_TABLE_SYMBOLS (ieee
),
4080 /* ieee_get_reloc_upper_bound, ieee_canonicalize_reloc,
4081 ieee_bfd_reloc_type_lookup */
4082 BFD_JUMP_TABLE_RELOCS (ieee
),
4084 /* ieee_set_arch_mach, ieee_set_section_contents */
4085 BFD_JUMP_TABLE_WRITE (ieee
),
4087 /* ieee_sizeof_headers, ieee_bfd_get_relocated_section_contents,
4088 ieee_bfd_relax_section, ieee_bfd_link_hash_table_create,
4089 ieee_bfd_link_add_symbols, ieee_bfd_final_link,
4090 ieee_bfd_link_split_section, ieee_bfd_gc_sections,
4091 ieee_bfd_merge_sections */
4092 BFD_JUMP_TABLE_LINK (ieee
),
4094 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic
),