- Copyright 1999, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2020 Free Software Foundation, Inc.
Contributed by Steve Chamberlan of Transmeta (sac@pobox.com).
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Contributed by Steve Chamberlan of Transmeta (sac@pobox.com).
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
(at your option) any later version.
This program is distributed in the hope that it will be useful,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_PJ_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_PJ_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_PJ_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_PJ_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_PJ_GNU_VTENTRY, /* type */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_PJ_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_PJ_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_PJ_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
- { BFD_RELOC_NONE, R_PJ_NONE },
- { BFD_RELOC_32, R_PJ_DATA_DIR32 },
- { BFD_RELOC_PJ_CODE_DIR16, R_PJ_CODE_DIR16 },
- { BFD_RELOC_PJ_CODE_DIR32, R_PJ_CODE_DIR32 },
- { BFD_RELOC_PJ_CODE_LO16, R_PJ_CODE_LO16 },
- { BFD_RELOC_PJ_CODE_HI16, R_PJ_CODE_HI16 },
- { BFD_RELOC_PJ_CODE_REL32, R_PJ_CODE_REL32 },
- { BFD_RELOC_PJ_CODE_REL16, R_PJ_CODE_REL16 },
+ { BFD_RELOC_NONE, R_PJ_NONE },
+ { BFD_RELOC_32, R_PJ_DATA_DIR32 },
+ { BFD_RELOC_PJ_CODE_DIR16, R_PJ_CODE_DIR16 },
+ { BFD_RELOC_PJ_CODE_DIR32, R_PJ_CODE_DIR32 },
+ { BFD_RELOC_PJ_CODE_LO16, R_PJ_CODE_LO16 },
+ { BFD_RELOC_PJ_CODE_HI16, R_PJ_CODE_HI16 },
+ { BFD_RELOC_PJ_CODE_REL32, R_PJ_CODE_REL32 },
+ { BFD_RELOC_PJ_CODE_REL16, R_PJ_CODE_REL16 },
{ BFD_RELOC_VTABLE_INHERIT, R_PJ_GNU_VTINHERIT },
{ BFD_RELOC_VTABLE_ENTRY, R_PJ_GNU_VTENTRY },
};
{ BFD_RELOC_VTABLE_INHERIT, R_PJ_GNU_VTINHERIT },
{ BFD_RELOC_VTABLE_ENTRY, R_PJ_GNU_VTENTRY },
};
- BFD_ASSERT (r < (unsigned int) R_PJ_max);
+ if (r >= R_PJ_max)
+ {
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
{
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_ARCH;
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_GNUCALLS;
{
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_ARCH;
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_GNUCALLS;
#define TARGET_LITTLE_NAME "elf32-pjl"
#define ELF_ARCH bfd_arch_pj
#define ELF_MACHINE_CODE EM_PJ
#define TARGET_LITTLE_NAME "elf32-pjl"
#define ELF_ARCH bfd_arch_pj
#define ELF_MACHINE_CODE EM_PJ
#define ELF_MAXPAGESIZE 0x1000
#define bfd_elf32_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define ELF_MAXPAGESIZE 0x1000
#define bfd_elf32_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define bfd_elf32_bfd_reloc_name_lookup pj_elf_reloc_name_lookup
#define elf_backend_final_write_processing pj_elf_final_write_processing
#define bfd_elf32_bfd_reloc_name_lookup pj_elf_reloc_name_lookup
#define elf_backend_final_write_processing pj_elf_final_write_processing