| Index: bfd/elf32-m68hc12.c
|
| diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
|
| index 1788856f8f516dd788b44d05d20190c688642971..2b5a1b38a986a080d791a3cb42e18f961e9100b2 100644
|
| --- a/bfd/elf32-m68hc12.c
|
| +++ b/bfd/elf32-m68hc12.c
|
| @@ -1,5 +1,5 @@
|
| /* Motorola 68HC12-specific support for 32-bit ELF
|
| - Copyright 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007
|
| + Copyright 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012
|
| Free Software Foundation, Inc.
|
| Contributed by Stephane Carrez (stcarrez@nerim.fr)
|
| (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
|
| @@ -37,14 +37,7 @@ static void m68hc11_info_to_howto_rel
|
| (bfd *, arelent *, Elf_Internal_Rela *);
|
|
|
| /* Trampoline generation. */
|
| -static bfd_boolean m68hc12_elf_size_one_stub
|
| - (struct bfd_hash_entry *gen_entry, void *in_arg);
|
| -static bfd_boolean m68hc12_elf_build_one_stub
|
| - (struct bfd_hash_entry *gen_entry, void *in_arg);
|
| -static struct bfd_link_hash_table* m68hc12_elf_bfd_link_hash_table_create
|
| - (bfd*);
|
|
|
| -static bfd_boolean m68hc12_elf_set_mach_from_flags PARAMS ((bfd *));
|
|
|
| /* Use REL instead of RELA to save space */
|
| #define USE_REL 1
|
| @@ -324,11 +317,81 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
|
| FALSE), /* pcrel_offset */
|
|
|
| EMPTY_HOWTO (14),
|
| - EMPTY_HOWTO (15),
|
| - EMPTY_HOWTO (16),
|
| - EMPTY_HOWTO (17),
|
| - EMPTY_HOWTO (18),
|
| - EMPTY_HOWTO (19),
|
| +
|
| + /* A 16 bit absolute relocation. */
|
| + HOWTO (R_M68HC12_16B, /* type */
|
| + 0, /* rightshift */
|
| + 1, /* size (0 = byte, 1 = short, 2 = long) */
|
| + 16, /* bitsize */
|
| + FALSE, /* pc_relative */
|
| + 0, /* bitpos */
|
| + complain_overflow_bitfield, /* complain_on_overflow */
|
| + bfd_elf_generic_reloc, /* special_function */
|
| + "R_M68HC12_16B", /* name */
|
| + FALSE, /* partial_inplace */
|
| + 0xffff, /* src_mask */
|
| + 0xffff, /* dst_mask */
|
| + FALSE), /* pcrel_offset */
|
| +
|
| + /* A 9 bit PC-rel relocation. */
|
| + HOWTO (R_M68HC12_PCREL_9, /* type */
|
| + 1, /* rightshift */
|
| + 1, /* size (0 = byte, 1 = short, 2 = long) */
|
| + 10, /* bitsize (result is >>1) */
|
| + TRUE, /* pc_relative */
|
| + 0, /* bitpos */
|
| + complain_overflow_dont, /* complain_on_overflow */
|
| + bfd_elf_generic_reloc, /* special_function */
|
| + "R_M68HC12_PCREL_9", /* name */
|
| + TRUE, /* partial_inplace */
|
| + 0xfe00, /* src_mask */
|
| + 0x01ff, /* dst_mask */
|
| + TRUE), /* pcrel_offset */
|
| +
|
| + /* A 10 bit PC-rel relocation. */
|
| + HOWTO (R_M68HC12_PCREL_10, /* type */
|
| + 1, /* rightshift */
|
| + 1, /* size (0 = byte, 1 = short, 2 = long) */
|
| + 11, /* bitsize (result is >>1) */
|
| + TRUE, /* pc_relative */
|
| + 0, /* bitpos */
|
| + complain_overflow_dont, /* complain_on_overflow */
|
| + bfd_elf_generic_reloc, /* special_function */
|
| + "R_M68HC12_PCREL_10", /* name */
|
| + TRUE, /* partial_inplace */
|
| + 0xfc00, /* src_mask */
|
| + 0x03ff, /* dst_mask */
|
| + TRUE), /* pcrel_offset */
|
| +
|
| + /* A 8 bit absolute relocation (upper address). */
|
| + HOWTO (R_M68HC12_HI8XG, /* type */
|
| + 8, /* rightshift */
|
| + 0, /* size (0 = byte, 1 = short, 2 = long) */
|
| + 8, /* bitsize */
|
| + FALSE, /* pc_relative */
|
| + 0, /* bitpos */
|
| + complain_overflow_bitfield, /* complain_on_overflow */
|
| + bfd_elf_generic_reloc, /* special_function */
|
| + "R_M68HC12_HI8XG", /* name */
|
| + FALSE, /* partial_inplace */
|
| + 0x00ff, /* src_mask */
|
| + 0x00ff, /* dst_mask */
|
| + FALSE), /* pcrel_offset */
|
| +
|
| + /* A 8 bit absolute relocation (lower address). */
|
| + HOWTO (R_M68HC12_LO8XG, /* type */
|
| + 8, /* rightshift */
|
| + 0, /* size (0 = byte, 1 = short, 2 = long) */
|
| + 8, /* bitsize */
|
| + FALSE, /* pc_relative */
|
| + 0, /* bitpos */
|
| + complain_overflow_bitfield, /* complain_on_overflow */
|
| + bfd_elf_generic_reloc, /* special_function */
|
| + "R_M68HC12_LO8XG", /* name */
|
| + FALSE, /* partial_inplace */
|
| + 0x00ff, /* src_mask */
|
| + 0x00ff, /* dst_mask */
|
| + FALSE), /* pcrel_offset */
|
|
|
| /* Mark beginning of a jump instruction (any form). */
|
| HOWTO (R_M68HC11_RL_JUMP, /* type */
|
| @@ -369,7 +432,8 @@ struct m68hc11_reloc_map
|
| unsigned char elf_reloc_val;
|
| };
|
|
|
| -static const struct m68hc11_reloc_map m68hc11_reloc_map[] = {
|
| +static const struct m68hc11_reloc_map m68hc11_reloc_map[] =
|
| +{
|
| {BFD_RELOC_NONE, R_M68HC11_NONE,},
|
| {BFD_RELOC_8, R_M68HC11_8},
|
| {BFD_RELOC_M68HC11_HI8, R_M68HC11_HI8},
|
| @@ -389,6 +453,13 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = {
|
|
|
| {BFD_RELOC_M68HC11_RL_JUMP, R_M68HC11_RL_JUMP},
|
| {BFD_RELOC_M68HC11_RL_GROUP, R_M68HC11_RL_GROUP},
|
| +
|
| + {BFD_RELOC_M68HC12_16B, R_M68HC12_16B},
|
| +
|
| + {BFD_RELOC_M68HC12_9_PCREL, R_M68HC12_PCREL_9},
|
| + {BFD_RELOC_M68HC12_10_PCREL, R_M68HC12_PCREL_10},
|
| + {BFD_RELOC_M68HC12_HI8XG, R_M68HC12_HI8XG},
|
| + {BFD_RELOC_M68HC12_LO8XG, R_M68HC12_LO8XG},
|
| };
|
|
|
| static reloc_howto_type *
|
| @@ -581,6 +652,7 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] =
|
| #define elf_backend_special_sections elf32_m68hc12_special_sections
|
| #define elf_backend_post_process_headers elf32_m68hc11_post_process_headers
|
| #define elf_backend_add_symbol_hook elf32_m68hc11_add_symbol_hook
|
| +#define elf_backend_merge_symbol_attribute elf32_m68hc11_merge_symbol_attribute
|
|
|
| #define bfd_elf32_bfd_link_hash_table_create \
|
| m68hc12_elf_bfd_link_hash_table_create
|
|
|