1 /* Motorola 68HC12-specific support for 32-bit ELF
2 Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
3 Contributed by Stephane Carrez (stcarrez@nerim.fr)
4 (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
6 This file is part of BFD, the Binary File Descriptor library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 #include "elf/m68hc11.h"
27 #include "opcode/m68hc11.h"
29 static reloc_howto_type
*bfd_elf32_bfd_reloc_type_lookup
30 PARAMS ((bfd
* abfd
, bfd_reloc_code_real_type code
));
31 static void m68hc11_info_to_howto_rel
32 PARAMS ((bfd
*, arelent
*, Elf32_Internal_Rel
*));
34 static bfd_reloc_status_type m68hc11_elf_ignore_reloc
35 PARAMS ((bfd
*abfd
, arelent
*reloc_entry
,
36 asymbol
*symbol
, PTR data
, asection
*input_section
,
37 bfd
*output_bfd
, char **error_message
));
38 static bfd_reloc_status_type m68hc12_elf_special_reloc
39 PARAMS ((bfd
*, arelent
*, asymbol
*, PTR
, asection
*, bfd
*, char **));
40 static int m68hc12_addr_is_banked
PARAMS ((bfd_vma
));
41 static bfd_vma m68hc12_phys_addr
PARAMS ((bfd_vma
));
42 static bfd_vma m68hc12_phys_page
PARAMS ((bfd_vma
));
44 /* GC mark and sweep. */
45 static asection
*elf32_m68hc11_gc_mark_hook
46 PARAMS ((bfd
*abfd
, struct bfd_link_info
*info
,
47 Elf_Internal_Rela
*rel
, struct elf_link_hash_entry
*h
,
48 Elf_Internal_Sym
*sym
));
49 static boolean elf32_m68hc11_gc_sweep_hook
50 PARAMS ((bfd
*abfd
, struct bfd_link_info
*info
,
51 asection
*sec
, const Elf_Internal_Rela
*relocs
));
53 boolean _bfd_m68hc12_elf_merge_private_bfd_data
PARAMS ((bfd
*, bfd
*));
54 boolean _bfd_m68hc12_elf_set_private_flags
PARAMS ((bfd
*, flagword
));
55 boolean _bfd_m68hc12_elf_print_private_bfd_data
PARAMS ((bfd
*, PTR
));
59 /* Use REL instead of RELA to save space */
62 /* The Motorola 68HC11 microcontroler only addresses 64Kb.
63 We must handle 8 and 16-bit relocations. The 32-bit relocation
64 is defined but not used except by gas when -gstabs is used (which
67 The 68HC12 microcontroler has a memory bank switching system
68 with a 16Kb window in the 64Kb address space. The extended memory
69 is mapped in the 16Kb window (at 0x8000). The page register controls
70 which 16Kb bank is mapped. The call/rtc instructions take care of
71 bank switching in function calls/returns.
73 For GNU Binutils to work, we consider there is a physical memory
74 at 0..0x0ffff and a kind of virtual memory above that. Symbols
75 in virtual memory have their addresses treated in a special way
76 when disassembling and when linking.
78 For the linker to work properly, we must always relocate the virtual
79 memory as if it is mapped at 0x8000. When a 16-bit relocation is
80 made in the virtual memory, we check that it does not cross the
81 memory bank where it is used. This would involve a page change
82 which would be wrong. The 24-bit relocation is for that and it
83 treats the address as a physical address + page number.
89 +---------------+ 0x1010000
94 +---------------+ 0x100C000
99 +---------------+ 0x1008000
101 | | call _foo | Page 1
103 | +---------------+ 0x1004000
105 Address Space | | | Page 0
107 +-----------+ 0x00FFFF | +---------------+ 0x1000000
111 +-----------+ 0x00BFFF -+---/
116 +-----------+ 0x008000 -+
125 The 'call _foo' must be relocated with page 3 and 16-bit address
128 The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */
129 static reloc_howto_type elf_m68hc11_howto_table
[] = {
130 /* This reloc does nothing. */
131 HOWTO (R_M68HC11_NONE
, /* type */
133 2, /* size (0 = byte, 1 = short, 2 = long) */
135 false, /* pc_relative */
137 complain_overflow_dont
,/* complain_on_overflow */
138 bfd_elf_generic_reloc
, /* special_function */
139 "R_M68HC12_NONE", /* name */
140 false, /* partial_inplace */
143 false), /* pcrel_offset */
145 /* A 8 bit absolute relocation */
146 HOWTO (R_M68HC11_8
, /* type */
148 0, /* size (0 = byte, 1 = short, 2 = long) */
150 false, /* pc_relative */
152 complain_overflow_bitfield
, /* complain_on_overflow */
153 bfd_elf_generic_reloc
, /* special_function */
154 "R_M68HC12_8", /* name */
155 false, /* partial_inplace */
156 0x00ff, /* src_mask */
157 0x00ff, /* dst_mask */
158 false), /* pcrel_offset */
160 /* A 8 bit absolute relocation (upper address) */
161 HOWTO (R_M68HC11_HI8
, /* type */
163 0, /* size (0 = byte, 1 = short, 2 = long) */
165 false, /* pc_relative */
167 complain_overflow_bitfield
, /* complain_on_overflow */
168 bfd_elf_generic_reloc
, /* special_function */
169 "R_M68HC12_HI8", /* name */
170 false, /* partial_inplace */
171 0x00ff, /* src_mask */
172 0x00ff, /* dst_mask */
173 false), /* pcrel_offset */
175 /* A 8 bit absolute relocation (upper address) */
176 HOWTO (R_M68HC11_LO8
, /* type */
178 0, /* size (0 = byte, 1 = short, 2 = long) */
180 false, /* pc_relative */
182 complain_overflow_dont
, /* complain_on_overflow */
183 bfd_elf_generic_reloc
, /* special_function */
184 "R_M68HC12_LO8", /* name */
185 false, /* partial_inplace */
186 0x00ff, /* src_mask */
187 0x00ff, /* dst_mask */
188 false), /* pcrel_offset */
190 /* A 8 bit PC-rel relocation */
191 HOWTO (R_M68HC11_PCREL_8
, /* type */
193 0, /* size (0 = byte, 1 = short, 2 = long) */
195 true, /* pc_relative */
197 complain_overflow_bitfield
, /* complain_on_overflow */
198 bfd_elf_generic_reloc
, /* special_function */
199 "R_M68HC12_PCREL_8", /* name */
200 false, /* partial_inplace */
201 0x00ff, /* src_mask */
202 0x00ff, /* dst_mask */
203 false), /* pcrel_offset */
205 /* A 16 bit absolute relocation */
206 HOWTO (R_M68HC11_16
, /* type */
208 1, /* size (0 = byte, 1 = short, 2 = long) */
210 false, /* pc_relative */
212 complain_overflow_dont
/*bitfield */ , /* complain_on_overflow */
213 m68hc12_elf_special_reloc
, /* special_function */
214 "R_M68HC12_16", /* name */
215 false, /* partial_inplace */
216 0xffff, /* src_mask */
217 0xffff, /* dst_mask */
218 false), /* pcrel_offset */
220 /* A 32 bit absolute relocation. This one is never used for the
221 code relocation. It's used by gas for -gstabs generation. */
222 HOWTO (R_M68HC11_32
, /* type */
224 2, /* size (0 = byte, 1 = short, 2 = long) */
226 false, /* pc_relative */
228 complain_overflow_bitfield
, /* complain_on_overflow */
229 bfd_elf_generic_reloc
, /* special_function */
230 "R_M68HC12_32", /* name */
231 false, /* partial_inplace */
232 0xffffffff, /* src_mask */
233 0xffffffff, /* dst_mask */
234 false), /* pcrel_offset */
236 /* A 3 bit absolute relocation */
237 HOWTO (R_M68HC11_3B
, /* type */
239 0, /* size (0 = byte, 1 = short, 2 = long) */
241 false, /* pc_relative */
243 complain_overflow_bitfield
, /* complain_on_overflow */
244 bfd_elf_generic_reloc
, /* special_function */
245 "R_M68HC12_4B", /* name */
246 false, /* partial_inplace */
247 0x003, /* src_mask */
248 0x003, /* dst_mask */
249 false), /* pcrel_offset */
251 /* A 16 bit PC-rel relocation */
252 HOWTO (R_M68HC11_PCREL_16
, /* type */
254 1, /* size (0 = byte, 1 = short, 2 = long) */
256 true, /* pc_relative */
258 complain_overflow_dont
, /* complain_on_overflow */
259 bfd_elf_generic_reloc
, /* special_function */
260 "R_M68HC12_PCREL_16", /* name */
261 false, /* partial_inplace */
262 0xffff, /* src_mask */
263 0xffff, /* dst_mask */
264 false), /* pcrel_offset */
266 /* GNU extension to record C++ vtable hierarchy */
267 HOWTO (R_M68HC11_GNU_VTINHERIT
, /* type */
269 1, /* size (0 = byte, 1 = short, 2 = long) */
271 false, /* pc_relative */
273 complain_overflow_dont
, /* complain_on_overflow */
274 NULL
, /* special_function */
275 "R_M68HC11_GNU_VTINHERIT", /* name */
276 false, /* partial_inplace */
279 false), /* pcrel_offset */
281 /* GNU extension to record C++ vtable member usage */
282 HOWTO (R_M68HC11_GNU_VTENTRY
, /* type */
284 1, /* size (0 = byte, 1 = short, 2 = long) */
286 false, /* pc_relative */
288 complain_overflow_dont
, /* complain_on_overflow */
289 _bfd_elf_rel_vtable_reloc_fn
, /* special_function */
290 "R_M68HC11_GNU_VTENTRY", /* name */
291 false, /* partial_inplace */
294 false), /* pcrel_offset */
296 /* A 24 bit relocation */
297 HOWTO (R_M68HC11_24
, /* type */
299 1, /* size (0 = byte, 1 = short, 2 = long) */
301 false, /* pc_relative */
303 complain_overflow_dont
, /* complain_on_overflow */
304 m68hc12_elf_special_reloc
, /* special_function */
305 "R_M68HC12_24", /* name */
306 false, /* partial_inplace */
307 0xffff, /* src_mask */
308 0xffff, /* dst_mask */
309 false), /* pcrel_offset */
311 /* A 16-bit low relocation */
312 HOWTO (R_M68HC11_LO16
, /* type */
314 1, /* size (0 = byte, 1 = short, 2 = long) */
316 false, /* pc_relative */
318 complain_overflow_dont
, /* complain_on_overflow */
319 m68hc12_elf_special_reloc
,/* special_function */
320 "R_M68HC12_LO16", /* name */
321 false, /* partial_inplace */
322 0xffff, /* src_mask */
323 0xffff, /* dst_mask */
324 false), /* pcrel_offset */
326 /* A page relocation */
327 HOWTO (R_M68HC11_PAGE
, /* type */
329 0, /* size (0 = byte, 1 = short, 2 = long) */
331 false, /* pc_relative */
333 complain_overflow_dont
, /* complain_on_overflow */
334 m68hc12_elf_special_reloc
,/* special_function */
335 "R_M68HC12_PAGE", /* name */
336 false, /* partial_inplace */
337 0x00ff, /* src_mask */
338 0x00ff, /* dst_mask */
339 false), /* pcrel_offset */
348 /* Mark beginning of a jump instruction (any form). */
349 HOWTO (R_M68HC11_RL_JUMP
, /* type */
351 1, /* size (0 = byte, 1 = short, 2 = long) */
353 false, /* pc_relative */
355 complain_overflow_dont
, /* complain_on_overflow */
356 m68hc11_elf_ignore_reloc
, /* special_function */
357 "R_M68HC12_RL_JUMP", /* name */
358 true, /* partial_inplace */
361 true), /* pcrel_offset */
363 /* Mark beginning of Gcc relaxation group instruction. */
364 HOWTO (R_M68HC11_RL_GROUP
, /* type */
366 1, /* size (0 = byte, 1 = short, 2 = long) */
368 false, /* pc_relative */
370 complain_overflow_dont
, /* complain_on_overflow */
371 m68hc11_elf_ignore_reloc
, /* special_function */
372 "R_M68HC12_RL_GROUP", /* name */
373 true, /* partial_inplace */
376 true), /* pcrel_offset */
379 /* Map BFD reloc types to M68HC11 ELF reloc types. */
381 struct m68hc11_reloc_map
383 bfd_reloc_code_real_type bfd_reloc_val
;
384 unsigned char elf_reloc_val
;
387 static const struct m68hc11_reloc_map m68hc11_reloc_map
[] = {
388 {BFD_RELOC_NONE
, R_M68HC11_NONE
,},
389 {BFD_RELOC_8
, R_M68HC11_8
},
390 {BFD_RELOC_M68HC11_HI8
, R_M68HC11_HI8
},
391 {BFD_RELOC_M68HC11_LO8
, R_M68HC11_LO8
},
392 {BFD_RELOC_8_PCREL
, R_M68HC11_PCREL_8
},
393 {BFD_RELOC_16_PCREL
, R_M68HC11_PCREL_16
},
394 {BFD_RELOC_16
, R_M68HC11_16
},
395 {BFD_RELOC_32
, R_M68HC11_32
},
396 {BFD_RELOC_M68HC11_3B
, R_M68HC11_3B
},
398 {BFD_RELOC_VTABLE_INHERIT
, R_M68HC11_GNU_VTINHERIT
},
399 {BFD_RELOC_VTABLE_ENTRY
, R_M68HC11_GNU_VTENTRY
},
401 {BFD_RELOC_M68HC11_LO16
, R_M68HC11_LO16
},
402 {BFD_RELOC_M68HC11_PAGE
, R_M68HC11_PAGE
},
403 {BFD_RELOC_M68HC11_24
, R_M68HC11_24
},
405 {BFD_RELOC_M68HC11_RL_JUMP
, R_M68HC11_RL_JUMP
},
406 {BFD_RELOC_M68HC11_RL_GROUP
, R_M68HC11_RL_GROUP
},
409 static reloc_howto_type
*
410 bfd_elf32_bfd_reloc_type_lookup (abfd
, code
)
411 bfd
*abfd ATTRIBUTE_UNUSED
;
412 bfd_reloc_code_real_type code
;
417 i
< sizeof (m68hc11_reloc_map
) / sizeof (struct m68hc11_reloc_map
);
420 if (m68hc11_reloc_map
[i
].bfd_reloc_val
== code
)
421 return &elf_m68hc11_howto_table
[m68hc11_reloc_map
[i
].elf_reloc_val
];
427 /* This function is used for relocs which are only used for relaxing,
428 which the linker should otherwise ignore. */
430 static bfd_reloc_status_type
431 m68hc11_elf_ignore_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
432 output_bfd
, error_message
)
433 bfd
*abfd ATTRIBUTE_UNUSED
;
434 arelent
*reloc_entry
;
435 asymbol
*symbol ATTRIBUTE_UNUSED
;
436 PTR data ATTRIBUTE_UNUSED
;
437 asection
*input_section
;
439 char **error_message ATTRIBUTE_UNUSED
;
441 if (output_bfd
!= NULL
)
442 reloc_entry
->address
+= input_section
->output_offset
;
447 m68hc12_addr_is_banked (addr
)
450 return (addr
>= M68HC12_BANK_VIRT
) ? 1 : 0;
453 /* Return the physical address seen by the processor, taking
454 into account banked memory. */
456 m68hc12_phys_addr (addr
)
459 if (addr
< M68HC12_BANK_VIRT
)
462 /* Map the address to the memory bank. */
463 addr
-= M68HC12_BANK_VIRT
;
464 addr
&= M68HC12_BANK_MASK
;
465 addr
+= M68HC12_BANK_BASE
;
469 /* Return the page number corresponding to an address in banked memory. */
471 m68hc12_phys_page (addr
)
474 if (addr
< M68HC12_BANK_VIRT
)
477 /* Map the address to the memory bank. */
478 addr
-= M68HC12_BANK_VIRT
;
479 addr
>>= M68HC12_BANK_SHIFT
;
480 addr
&= M68HC12_BANK_PAGE_MASK
;
484 static bfd_reloc_status_type
485 m68hc12_elf_special_reloc (abfd
, reloc_entry
, symbol
, data
, input_section
,
486 output_bfd
, error_message
)
488 arelent
*reloc_entry
;
491 asection
*input_section
;
493 char **error_message ATTRIBUTE_UNUSED
;
495 reloc_howto_type
*howto
;
502 if (output_bfd
!= (bfd
*) NULL
503 && (symbol
->flags
& BSF_SECTION_SYM
) == 0
504 && (! reloc_entry
->howto
->partial_inplace
505 || reloc_entry
->addend
== 0))
507 reloc_entry
->address
+= input_section
->output_offset
;
511 if (output_bfd
!= NULL
)
512 return bfd_reloc_continue
;
514 if (reloc_entry
->address
> input_section
->_cooked_size
)
515 return bfd_reloc_outofrange
;
517 /* Compute relocation. */
518 relocation
= (symbol
->value
519 + symbol
->section
->output_section
->vma
520 + symbol
->section
->output_offset
);
521 relocation
+= reloc_entry
->addend
;
522 relocation
+= bfd_get_16 (abfd
, (bfd_byte
*) data
+ reloc_entry
->address
);
524 /* Do the memory bank mapping. */
525 phys_addr
= m68hc12_phys_addr (relocation
);
526 phys_page
= m68hc12_phys_page (relocation
);
528 howto
= reloc_entry
->howto
;
529 if (howto
->complain_on_overflow
!= complain_overflow_dont
530 && (phys_addr
& (((bfd_vma
) -1) << 16)))
531 return bfd_reloc_overflow
;
536 /* Get virtual address of instruction having the relocation. */
537 insn_addr
= input_section
->output_section
->vma
538 + input_section
->output_offset
539 + reloc_entry
->address
;
541 insn_page
= m68hc12_phys_page (insn_addr
);
543 if (m68hc12_addr_is_banked (relocation
)
544 && m68hc12_addr_is_banked (insn_addr
)
545 && phys_page
!= insn_page
)
547 *error_message
= _("address is not in the same bank");
548 return bfd_reloc_dangerous
;
550 if (m68hc12_addr_is_banked (relocation
)
551 && !m68hc12_addr_is_banked (insn_addr
))
553 *error_message
= _("reference to a banked address in "
554 "the normal address space");
555 return bfd_reloc_dangerous
;
559 bfd_put_16 (abfd
, phys_addr
, (bfd_byte
*) data
+ reloc_entry
->address
);
563 bfd_put_16 (abfd
, phys_addr
, (bfd_byte
*) data
+ reloc_entry
->address
);
564 bfd_put_8 (abfd
, phys_page
, (bfd_byte
*) data
+ reloc_entry
->address
+ 2);
568 bfd_put_8 (abfd
, phys_page
, (bfd_byte
*) data
+ reloc_entry
->address
);
579 /* Set the howto pointer for an M68HC11 ELF reloc. */
582 m68hc11_info_to_howto_rel (abfd
, cache_ptr
, dst
)
583 bfd
*abfd ATTRIBUTE_UNUSED
;
585 Elf32_Internal_Rel
*dst
;
589 r_type
= ELF32_R_TYPE (dst
->r_info
);
590 BFD_ASSERT (r_type
< (unsigned int) R_M68HC11_max
);
591 cache_ptr
->howto
= &elf_m68hc11_howto_table
[r_type
];
595 elf32_m68hc11_gc_mark_hook (abfd
, info
, rel
, h
, sym
)
597 struct bfd_link_info
*info ATTRIBUTE_UNUSED
;
598 Elf_Internal_Rela
*rel
;
599 struct elf_link_hash_entry
*h
;
600 Elf_Internal_Sym
*sym
;
604 switch (ELF32_R_TYPE (rel
->r_info
))
607 switch (h
->root
.type
)
609 case bfd_link_hash_defined
:
610 case bfd_link_hash_defweak
:
611 return h
->root
.u
.def
.section
;
613 case bfd_link_hash_common
:
614 return h
->root
.u
.c
.p
->section
;
623 if (!(elf_bad_symtab (abfd
)
624 && ELF_ST_BIND (sym
->st_info
) != STB_LOCAL
)
625 && !((sym
->st_shndx
<= 0 || sym
->st_shndx
>= SHN_LORESERVE
)
626 && sym
->st_shndx
!= SHN_COMMON
))
628 return bfd_section_from_elf_index (abfd
, sym
->st_shndx
);
635 elf32_m68hc11_gc_sweep_hook (abfd
, info
, sec
, relocs
)
636 bfd
*abfd ATTRIBUTE_UNUSED
;
637 struct bfd_link_info
*info ATTRIBUTE_UNUSED
;
638 asection
*sec ATTRIBUTE_UNUSED
;
639 const Elf_Internal_Rela
*relocs ATTRIBUTE_UNUSED
;
641 /* We don't use got and plt entries for 68hc11/68hc12. */
646 /* Set and control ELF flags in ELF header. */
649 _bfd_m68hc12_elf_set_private_flags (abfd
, flags
)
653 BFD_ASSERT (!elf_flags_init (abfd
)
654 || elf_elfheader (abfd
)->e_flags
== flags
);
656 elf_elfheader (abfd
)->e_flags
= flags
;
657 elf_flags_init (abfd
) = true;
661 /* Merge backend specific data from an object file to the output
662 object file when linking. */
665 _bfd_m68hc12_elf_merge_private_bfd_data (ibfd
, obfd
)
673 /* Check if we have the same endianess */
674 if (_bfd_generic_verify_endian_match (ibfd
, obfd
) == false)
677 if (bfd_get_flavour (ibfd
) != bfd_target_elf_flavour
678 || bfd_get_flavour (obfd
) != bfd_target_elf_flavour
)
681 new_flags
= elf_elfheader (ibfd
)->e_flags
;
682 elf_elfheader (obfd
)->e_flags
|= new_flags
& EF_M68HC11_ABI
;
683 old_flags
= elf_elfheader (obfd
)->e_flags
;
685 if (! elf_flags_init (obfd
))
687 elf_flags_init (obfd
) = true;
688 elf_elfheader (obfd
)->e_flags
= new_flags
;
689 elf_elfheader (obfd
)->e_ident
[EI_CLASS
]
690 = elf_elfheader (ibfd
)->e_ident
[EI_CLASS
];
692 if (bfd_get_arch (obfd
) == bfd_get_arch (ibfd
)
693 && bfd_get_arch_info (obfd
)->the_default
)
695 if (! bfd_set_arch_mach (obfd
, bfd_get_arch (ibfd
),
696 bfd_get_mach (ibfd
)))
703 /* Check ABI compatibility. */
704 if ((new_flags
& E_M68HC11_I32
) != (old_flags
& E_M68HC11_I32
))
706 (*_bfd_error_handler
)
707 (_("%s: linking files compiled for 16-bit integers (-mshort) "
708 "and others for 32-bit integers"),
709 bfd_archive_filename (ibfd
));
712 if ((new_flags
& E_M68HC11_F64
) != (old_flags
& E_M68HC11_F64
))
714 (*_bfd_error_handler
)
715 (_("%s: linking files compiled for 32-bit double (-fshort-double) "
716 "and others for 64-bit double"),
717 bfd_archive_filename (ibfd
));
720 new_flags
&= ~EF_M68HC11_ABI
;
721 old_flags
&= ~EF_M68HC11_ABI
;
723 /* Warn about any other mismatches */
724 if (new_flags
!= old_flags
)
726 (*_bfd_error_handler
)
727 (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
728 bfd_archive_filename (ibfd
), (unsigned long) new_flags
,
729 (unsigned long) old_flags
);
735 bfd_set_error (bfd_error_bad_value
);
743 _bfd_m68hc12_elf_print_private_bfd_data (abfd
, ptr
)
747 FILE *file
= (FILE *) ptr
;
749 BFD_ASSERT (abfd
!= NULL
&& ptr
!= NULL
);
751 /* Print normal ELF private data. */
752 _bfd_elf_print_private_bfd_data (abfd
, ptr
);
754 /* xgettext:c-format */
755 fprintf (file
, _("private flags = %lx:"), elf_elfheader (abfd
)->e_flags
);
757 if (elf_elfheader (abfd
)->e_flags
& E_M68HC11_I32
)
758 fprintf (file
, _("[abi=32-bit int,"));
760 fprintf (file
, _("[abi=16-bit int,"));
762 if (elf_elfheader (abfd
)->e_flags
& E_M68HC11_F64
)
763 fprintf (file
, _(" 64-bit double]"));
765 fprintf (file
, _(" 32-bit double]"));
772 /* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c.
773 The Motorola spec says to use a different Elf machine code. */
774 #define ELF_ARCH bfd_arch_m68hc12
775 #define ELF_MACHINE_CODE EM_68HC12
776 #define ELF_MAXPAGESIZE 0x1000
778 #define TARGET_BIG_SYM bfd_elf32_m68hc12_vec
779 #define TARGET_BIG_NAME "elf32-m68hc12"
781 #define elf_info_to_howto 0
782 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel
783 #define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook
784 #define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook
785 #define elf_backend_object_p 0
786 #define elf_backend_final_write_processing 0
787 /* Disabled as this backend uses the generic linker. */
788 #define elf_backend_can_gc_sections 0
790 #define bfd_elf32_bfd_merge_private_bfd_data \
791 _bfd_m68hc12_elf_merge_private_bfd_data
792 #define bfd_elf32_bfd_set_private_flags _bfd_m68hc12_elf_set_private_flags
793 #define bfd_elf32_bfd_print_private_bfd_data \
794 _bfd_m68hc12_elf_print_private_bfd_data
796 #include "elf32-target.h"