i960xl changes (sanitized)
authorKen Raeburn <raeburn@cygnus>
Wed, 27 Jul 1994 00:21:43 +0000 (00:21 +0000)
committerKen Raeburn <raeburn@cygnus>
Wed, 27 Jul 1994 00:21:43 +0000 (00:21 +0000)
bfd/ChangeLog
bfd/bfd-in2.h
bfd/coffcode.h

index db4900b..ba43195 100644 (file)
@@ -1,3 +1,28 @@
+Tue Jul 26 17:38:01 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
+
+       * cpu-i960.c (MAX_ARCH): New macro.
+       (compatible): Use it in computing array bounds.  Put comma after
+       last entry in array, for regularity.
+       (arch_info_struct): Adjust spacing for easier reading.
+
+       * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use
+       HOWTO macro.
+
+       start-sanitize-i960xl
+       * cpu-i960.c (XL): Define as bfd_mach_i960_xl.
+       (scan_960_mach): Recognize xl machine.
+       (MAX_ARCH): Define to be XL.
+       (compatible): Add XL row to array.
+       (arch_info_struct): Add XL entry.
+
+       * archures.c (bfd_mach_i960_xl): New macro.
+       * bfd-in2.h: Regenerated.
+
+       * coffcode.h (coff_set_arch_mach_hook): For F_I960XL, set machine
+       to bfd_mach_i960_xl.
+       (coff_set_flags): For bfd_mach_i960_xl, set F_I960XL.
+       end-sanitize-i960xl
+
 Tue Jul 26 11:04:00 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
 
        * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak
index 09f5338..622651a 100644 (file)
@@ -982,6 +982,9 @@ enum bfd_architecture
 #define bfd_mach_i960_mc        4
 #define bfd_mach_i960_xa        5
 #define bfd_mach_i960_ca        6
+  /* start-sanitize-i960xl */
+#define bfd_mach_i960_xl        7
+  /* end-sanitize-i960xl */
 
   bfd_arch_a29k,       /* AMD 29000 */
   bfd_arch_sparc,      /* SPARC */
@@ -1195,17 +1198,6 @@ struct reloc_howto_struct
                                             bfd *output_bfd,
                                             char **error_message));
 
-
-        /* If this field is non null, then the supplied function is
-          called rather than the normal function. This is similar
-          to special_function (previous), but takes different arguments,
-          and is used for the new linking code. */
-  bfd_reloc_status_type (*special_function1)
-                           PARAMS((const reloc_howto_type *howto,
-                                   bfd *input_bfd,
-                                   bfd_vma relocation,
-                                   bfd_byte *location));
-
         /* The textual name of the relocation type. */
   char *name;
 
@@ -1238,9 +1230,7 @@ struct reloc_howto_struct
 
 };
 #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
-  {(unsigned)C,R,S,B, P, BI, O,SF, 0,NAME,INPLACE,MASKSRC,MASKDST,PC}
-#define HOWTO2(C, R,S,B, P, BI, O, SF, SF1,NAME, INPLACE, MASKSRC, MASKDST, PC) \
-  {(unsigned)C,R,S,B, P, BI, O,SF, SF1,NAME,INPLACE,MASKSRC,MASKDST,PC}
+  {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
 
 #define HOWTO_PREPARE(relocation, symbol)      \
index 4dbda14..3e208e2 100644 (file)
@@ -447,11 +447,15 @@ styp_to_sec_flags (abfd, hdr)
     }
   else if (styp_flags & STYP_INFO)
     {
-      /* This should be marked as SEC_DEBUGGING, but that can't be
-        done until we make sure that strip can still work.  strip
-        will probably have to preserve the same number of sections to
-        ensure that the section vma matches the section file
-        position.  */
+      /* We mark these as SEC_DEBUGGING, but only if COFF_PAGE_SIZE is
+        defined.  coff_compute_section_file_positions uses
+        COFF_PAGE_SIZE to ensure that the low order bits of the
+        section VMA and the file offset match.  If we don't know
+        COFF_PAGE_SIZE, we can't ensure the correct correspondence,
+        and demand page loading of the file will fail.  */
+#ifdef COFF_PAGE_SIZE
+      sec_flags |= SEC_DEBUGGING;
+#endif
     }
   else
     {
@@ -951,6 +955,11 @@ coff_set_arch_mach_hook (abfd, filehdr)
        case F_I960KA:
          machine = bfd_mach_i960_ka_sa;
          break;
+         /* start-sanitize-i960xl */
+       case F_I960XL:
+         machine = bfd_mach_i960_xl;
+         break;
+         /* end-sanitize-i960xl */
        }
       break;
 #endif
@@ -1087,7 +1096,7 @@ coff_write_relocs (abfd)
 #endif
          if (q->sym_ptr_ptr)
            {
-             if (q->sym_ptr_ptr == bfd_abs_section.symbol_ptr_ptr)
+             if (q->sym_ptr_ptr == bfd_abs_section_ptr->symbol_ptr_ptr)
                /* This is a relocation relative to the absolute symbol.  */
                n.r_symndx = -1;
              else
@@ -1178,6 +1187,11 @@ coff_set_flags (abfd, magicp, flagsp)
          case bfd_mach_i960_ka_sa:
            flags = F_I960KA;
            break;
+           /* start-sanitize-i960xl */
+         case bfd_mach_i960_xl:
+           flags = F_I960XL;
+           break;
+           /* end-sanitize-i960xl */
          default:
            return false;
          }
@@ -1360,10 +1374,13 @@ coff_compute_section_file_positions (abfd)
       }
 
 #endif
-      /* FIXME, in demand paged files, the low order bits of the file
-        offset must match the low order bits of the virtual address.
-        "Low order" is apparently implementation defined.  Add code
-        here to round sofar up to match the virtual address.  */
+
+#ifdef COFF_PAGE_SIZE
+      /* In demand paged files the low order bits of the file offset
+        must match the low order bits of the virtual address.  */
+      if ((abfd->flags & D_PAGED) != 0)
+       sofar += (current->vma - sofar) % COFF_PAGE_SIZE;
+#endif
 
       current->filepos = sofar;
 
@@ -2074,12 +2091,12 @@ coff_slurp_symbol_table (abfd)
                {
                  if ((src->u.syment.n_value) == 0)
                    {
-                     dst->symbol.section = &bfd_und_section;
+                     dst->symbol.section = bfd_und_section_ptr;
                      dst->symbol.value = 0;
                    }
                  else
                    {
-                     dst->symbol.section = &bfd_com_section;
+                     dst->symbol.section = bfd_com_section_ptr;
                      dst->symbol.value = (src->u.syment.n_value);
                    }
                }
@@ -2378,7 +2395,7 @@ coff_slurp_reloc_table (abfd, asect, symbols)
        }
       else
        {
-         cache_ptr->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr;
+         cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
          ptr = 0;
        }