* c-typeprint.c (cp_type_print_derivation_info): Fix comment.
[deliverable/binutils-gdb.git] / bfd / elf32-moxie.c
index e3f01d2e8cad25776ec4ab382c89e2059d2dbf6b..9a031b498f6efe29e3795de73b12f8fde34e6364 100644 (file)
@@ -1,6 +1,5 @@
 /* moxie-specific support for 32-bit ELF.
-   Copyright 2008 Anthony Green.
-   Copyright 2009 Free Software Foundation, Inc.
+   Copyright 2009, 2010, 2012 Free Software Foundation, Inc.
 
    Copied from elf32-fr30.c which is..
    Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
@@ -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.  */
 };
 \f
 /* 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 *
@@ -207,10 +222,8 @@ moxie_elf_relocate_section (bfd *output_bfd,
       int r_type;
 
       r_type = ELF32_R_TYPE (rel->r_info);
-
       r_symndx = ELF32_R_SYM (rel->r_info);
-
-      howto  = moxie_elf_howto_table + ELF32_R_TYPE (rel->r_info);
+      howto  = moxie_elf_howto_table + r_type;
       h      = NULL;
       sym    = NULL;
       sec    = NULL;
@@ -237,16 +250,9 @@ moxie_elf_relocate_section (bfd *output_bfd,
          name = h->root.root.string;
        }
 
-      if (sec != NULL && elf_discarded_section (sec))
-       {
-         /* For relocs against symbols from removed linkonce sections,
-            or sections discarded by a linker script, we just want the
-            section contents zeroed.  Avoid any special processing.  */
-         _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
-         rel->r_info = 0;
-         rel->r_addend = 0;
-         continue;
-       }
+      if (sec != NULL && discarded_section (sec))
+       RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+                                        rel, 1, relend, howto, 0, contents);
 
       if (info->relocatable)
        continue;
@@ -360,8 +366,10 @@ moxie_elf_check_relocs (bfd *abfd,
 #define ELF_MACHINE_CODE       EM_MOXIE
 #define ELF_MAXPAGESIZE                0x1
 
-#define TARGET_BIG_SYM          bfd_elf32_moxie_vec
-#define TARGET_BIG_NAME                "elf32-moxie"
+#define TARGET_BIG_SYM          bfd_elf32_bigmoxie_vec
+#define TARGET_BIG_NAME                "elf32-bigmoxie"
+#define TARGET_LITTLE_SYM       bfd_elf32_littlemoxie_vec
+#define TARGET_LITTLE_NAME     "elf32-littlemoxie"
 
 #define elf_info_to_howto_rel                  NULL
 #define elf_info_to_howto                      moxie_info_to_howto_rela
This page took 0.023854 seconds and 4 git commands to generate.