/* BFD back-end for Renesas H8/300 ELF binaries.
- Copyright (C) 1993-2015 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
static unsigned long elf32_h8_mach (flagword);
static void elf32_h8_final_write_processing (bfd *, bfd_boolean);
static bfd_boolean elf32_h8_object_p (bfd *);
-static bfd_boolean elf32_h8_merge_private_bfd_data (bfd *, bfd *);
+static bfd_boolean elf32_h8_merge_private_bfd_data
+ (bfd *, struct bfd_link_info *);
static bfd_boolean elf32_h8_relax_section
(bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
static bfd_boolean elf32_h8_relax_delete_bytes
switch (r)
{
case bfd_reloc_overflow:
- if (! ((*info->callbacks->reloc_overflow)
- (info, (h ? &h->root : NULL), name, howto->name,
- (bfd_vma) 0, input_bfd, input_section,
- rel->r_offset)))
- return FALSE;
+ (*info->callbacks->reloc_overflow)
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
- if (! ((*info->callbacks->undefined_symbol)
- (info, name, input_bfd, input_section,
- rel->r_offset, TRUE)))
- return FALSE;
+ (*info->callbacks->undefined_symbol)
+ (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break;
case bfd_reloc_outofrange:
/* fall through */
common_error:
- if (!((*info->callbacks->warning)
- (info, msg, name, input_bfd, input_section,
- rel->r_offset)))
- return FALSE;
+ (*info->callbacks->warning) (info, msg, name, input_bfd,
+ input_section, rel->r_offset);
break;
}
}
time is the architecture/machine information. */
static bfd_boolean
-elf32_h8_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+elf32_h8_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
+ bfd *obfd = info->output_bfd;
+
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
There are a few relaxing opportunities available on the H8:
- jmp/jsr:24 -> bra/bsr:8 2 bytes
+ jmp/jsr:24 -> bra/bsr:8 2 bytes
The jmp may be completely eliminated if the previous insn is a
conditional branch to the insn after the jump. In that case
we invert the branch and delete the jump and save 4 bytes.
- bCC:16 -> bCC:8 2 bytes
- bsr:16 -> bsr:8 2 bytes
+ bCC:16 -> bCC:8 2 bytes
+ bsr:16 -> bsr:8 2 bytes
- bset:16 -> bset:8 2 bytes
- bset:24/32 -> bset:8 4 bytes
+ bset:16 -> bset:8 2 bytes
+ bset:24/32 -> bset:8 4 bytes
(also applicable to other bit manipulation instructions)
- mov.b:16 -> mov.b:8 2 bytes
- mov.b:24/32 -> mov.b:8 4 bytes
+ mov.b:16 -> mov.b:8 2 bytes
+ mov.b:24/32 -> mov.b:8 4 bytes
- bset:24/32 -> bset:16 2 bytes
+ bset:24/32 -> bset:16 2 bytes
(also applicable to other bit manipulation instructions)
- mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes
+ mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes
- mov.[bwl] @(displ:24/32+ERx) -> mov.[bwl] @(displ:16+ERx) 4 bytes. */
+ mov.[bwl] @(displ:24/32+ERx) -> mov.[bwl] @(displ:16+ERx) 4 bytes. */
static bfd_boolean
elf32_h8_relax_section (bfd *abfd, asection *sec,
&& h->root.type != bfd_link_hash_defweak)
{
/* This appears to be a reference to an undefined
- symbol. Just ignore it--it will be caught by the
- regular reloc processing. */
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
continue;
}
/* And relaxing stuff. */
#define bfd_elf32_bfd_relax_section elf32_h8_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
- elf32_h8_get_relocated_section_contents
+ elf32_h8_get_relocated_section_contents
#define elf_symbol_leading_char '_'