* archive.c (_bfd_write_archive_contents): Revert June 1 change.
[deliverable/binutils-gdb.git] / bfd / coff-a29k.c
index 7eeb6bd21b25166b0dead429a1972f157b0804e4..fdcb430008d132e6904dcbe74b4463bc4ac840c9 100644 (file)
@@ -34,13 +34,16 @@ static bfd_reloc_status_type a29k_reloc
 static boolean coff_a29k_relocate_section
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
           struct internal_reloc *, struct internal_syment *, asection **));
+static boolean coff_a29k_adjust_symndx
+  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
+          struct internal_reloc *, boolean *));
 
 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
 
 #define INSERT_HWORD(WORD,HWORD)       \
     (((WORD) & 0xff00ff00) | (((HWORD) & 0xff00) << 8) | ((HWORD)& 0xff))
 #define EXTRACT_HWORD(WORD) \
-    (((WORD) & 0x00ff0000) >> 8) | ((WORD)& 0xff)
+    ((((WORD) & 0x00ff0000) >> 8) | ((WORD)& 0xff))
 #define SIGN_EXTEND_HWORD(HWORD) \
     ((HWORD) & 0x8000 ? (HWORD)|0xffff0000 : (HWORD))
 
@@ -385,7 +388,8 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else
            {
-             if (h->root.type == bfd_link_hash_defined)
+             if (h->root.type == bfd_link_hash_defined
+                 || h->root.type == bfd_link_hash_defweak)
                {
                  sec = h->root.u.def.section;
                  val = (h->root.u.def.value
@@ -536,6 +540,28 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
 
 #define coff_relocate_section coff_a29k_relocate_section
 
+/* We don't want to change the symndx of a R_IHCONST reloc, since it
+   is actually an addend, not a symbol index at all.  */
+
+/*ARGSUSED*/
+static boolean
+coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
+     bfd *obfd;
+     struct bfd_link_info *info;
+     bfd *ibfd;
+     asection *sec;
+     struct internal_reloc *irel;
+     boolean *adjustedp;
+{
+  if (irel->r_type == R_IHCONST)
+    *adjustedp = true;
+  else
+    *adjustedp = false;
+  return true;
+}
+
+#define coff_adjust_symndx coff_a29k_adjust_symndx
+
 #include "coffcode.h"
 
 const bfd_target a29kcoff_big_vec =
This page took 0.02322 seconds and 4 git commands to generate.