diff options
author | Anthony Green <green@redhat.com> | 2009-06-11 11:27:58 +0000 |
---|---|---|
committer | Anthony Green <green@redhat.com> | 2009-06-11 11:27:58 +0000 |
commit | f865a31d1ed571ccb8d17653b150e3a30f22b30d (patch) | |
tree | 53213b9fa3500e9762839a2a15d4447b6e7c04cc /bfd | |
parent | 1372b818548793632310cb702930171c849f62db (diff) | |
download | gdb-f865a31d1ed571ccb8d17653b150e3a30f22b30d.zip gdb-f865a31d1ed571ccb8d17653b150e3a30f22b30d.tar.gz gdb-f865a31d1ed571ccb8d17653b150e3a30f22b30d.tar.bz2 |
Add PC-relative branch instructions to moxie port.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 10 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 4 | ||||
-rw-r--r-- | bfd/elf32-moxie.c | 21 | ||||
-rw-r--r-- | bfd/libbfd.h | 2 | ||||
-rw-r--r-- | bfd/reloc.c | 6 |
5 files changed, 40 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8d59068..e5e3d97 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2009-06-11 Anthony Green <green@moxielogic.com> + + * reloc.c: Add BFD_RELOC_MOXIE_10_PCREL. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * elf32-moxie.c (moxie_elf_howto_table): Add R_MOXIE_PCREL10 + relocation support. + (moxie_reloc_map): Ditto. + Clean up copyright notice. + 2009-06-10 Paul Pluzhnikov <ppluzhnikov@google.com> * bfd-in2.h: bfd_mmap prototype. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 6583aa6..4baa1a4 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2737,6 +2737,10 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MIPS_JUMP_SLOT, +/* Moxie ELF relocations. */ + BFD_RELOC_MOXIE_10_PCREL, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c index e3f01d2..23a16ff 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 * diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 7d72e3b..a3bb580 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1033,6 +1033,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MIPS_COPY", "BFD_RELOC_MIPS_JUMP_SLOT", + "BFD_RELOC_MOXIE_10_PCREL", + "BFD_RELOC_FRV_LABEL16", "BFD_RELOC_FRV_LABEL24", "BFD_RELOC_FRV_LO16", diff --git a/bfd/reloc.c b/bfd/reloc.c index ad002d7..fd82c2d 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2316,6 +2316,12 @@ ENUMDOC COMMENT ENUM + BFD_RELOC_MOXIE_10_PCREL +ENUMDOC + Moxie ELF relocations. +COMMENT + +ENUM BFD_RELOC_FRV_LABEL16 ENUMX BFD_RELOC_FRV_LABEL24 |