summaryrefslogtreecommitdiffstats
path: root/bfd/elf32-moxie.c
diff options
context:
space:
mode:
authorAnthony Green <green@redhat.com>2009-06-11 11:27:58 +0000
committerAnthony Green <green@redhat.com>2009-06-11 11:27:58 +0000
commitf865a31d1ed571ccb8d17653b150e3a30f22b30d (patch)
tree53213b9fa3500e9762839a2a15d4447b6e7c04cc /bfd/elf32-moxie.c
parent1372b818548793632310cb702930171c849f62db (diff)
downloadppe42-binutils-f865a31d1ed571ccb8d17653b150e3a30f22b30d.tar.gz
ppe42-binutils-f865a31d1ed571ccb8d17653b150e3a30f22b30d.zip
Add PC-relative branch instructions to moxie port.
Diffstat (limited to 'bfd/elf32-moxie.c')
-rw-r--r--bfd/elf32-moxie.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index e3f01d2e8c..23a16ffe44 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -1,5 +1,4 @@
/* moxie-specific support for 32-bit ELF.
- Copyright 2008 Anthony Green.
Copyright 2009 Free Software Foundation, Inc.
Copied from elf32-fr30.c which is..
@@ -62,6 +61,21 @@ static reloc_howto_type moxie_elf_howto_table [] =
0x00000000, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+
+ /* A 10 bit PC-relative relocation. */
+ HOWTO (R_MOXIE_PCREL10, /* type. */
+ 1, /* rightshift. */
+ 1, /* size (0 = byte, 1 = short, 2 = long). */
+ 10, /* bitsize. */
+ TRUE, /* pc_relative. */
+ 0, /* bitpos. */
+ complain_overflow_signed, /* complain_on_overflow. */
+ bfd_elf_generic_reloc, /* special_function. */
+ "R_MOXIE_PCREL10", /* name. */
+ FALSE, /* partial_inplace. */
+ 0, /* src_mask. */
+ 0x000003FF, /* dst_mask. */
+ TRUE), /* pcrel_offset. */
};
/* Map BFD reloc types to MOXIE ELF reloc types. */
@@ -74,8 +88,9 @@ struct moxie_reloc_map
static const struct moxie_reloc_map moxie_reloc_map [] =
{
- { BFD_RELOC_NONE, R_MOXIE_NONE },
- { BFD_RELOC_32, R_MOXIE_32 },
+ { BFD_RELOC_NONE, R_MOXIE_NONE },
+ { BFD_RELOC_32, R_MOXIE_32 },
+ { BFD_RELOC_MOXIE_10_PCREL, R_MOXIE_PCREL10 },
};
static reloc_howto_type *
OpenPOWER on IntegriCloud