Use new size-independent versions of elf internal data structures.
[deliverable/binutils-gdb.git] / bfd / coffcode.h
index 9791f724c2b22f448830f68cd58dc4b7278c98a1..c554276d00c60885b8c5f8116a36ebd925752f54 100644 (file)
@@ -338,6 +338,12 @@ DEFUN(sec_to_styp_flags, (sec_name, sec_flags),
   {
     styp_flags = STYP_LIB;
 #endif                         /* _LIB */
+#ifdef _LIT
+  }
+  else if (!strcmp (sec_name, _LIT))
+  {
+    styp_flags = STYP_LIT;
+#endif /* _LIT */
 
   }
   /* Try and figure out what it should be */
@@ -413,11 +419,16 @@ DEFUN(styp_to_sec_flags, (abfd, hdr),
   }
   else if (styp_flags & STYP_BSS) 
   {
-    sec_flags |= SEC_ALLOC;
+#ifdef BSS_NOLOAD_IS_SHARED_LIBRARY
+    if (sec_flags & SEC_NEVER_LOAD)
+      sec_flags |= SEC_ALLOC | SEC_SHARED_LIBRARY;
+    else
+#endif
+      sec_flags |= SEC_ALLOC;
   }
   else if (styp_flags & STYP_INFO) 
   {
-    sec_flags |= SEC_NEVER_LOAD;
+    /* Nothing to do.  */
   }
   else
   {
@@ -910,6 +921,13 @@ DEFUN (coff_set_arch_mach_hook, (abfd, filehdr),
     break;
 #endif
 
+#ifdef SHMAGIC
+  case SHMAGIC:
+    arch = bfd_arch_sh;
+    machine = 0;
+    break;
+#endif
+
 #ifdef H8500MAGIC
   case H8500MAGIC:
     arch = bfd_arch_h8500;
@@ -1106,6 +1124,14 @@ DEFUN(coff_set_flags,(abfd, magicp, flagsp),
       return true;
       break;
 #endif
+
+#ifdef SHMAGIC
+  case bfd_arch_sh:
+      *magicp = SHMAGIC;
+      return true;
+      break;
+#endif
+
 #ifdef H8500MAGIC
     case bfd_arch_h8500:
       *magicp = H8500MAGIC;
@@ -1226,6 +1252,14 @@ DEFUN(coff_compute_section_file_positions,(abfd),
       current->_raw_size += sofar - old_sofar ;
 #endif
 
+#ifdef _LIB
+      /* Force .lib sections to start at zero.  The vma is then
+        incremented in coff_set_section_contents.  This is right for
+        SVR3.2.  */
+      if (strcmp (current->name, _LIB) == 0)
+       bfd_set_section_vma (abfd, current, 0);
+#endif
+
       previous = current;
     }
   obj_relocbase(abfd) = sofar;
@@ -1637,7 +1671,7 @@ DEFUN(coff_set_section_contents,(abfd, section, location, offset, count),
        right for SVR3.2.  Shared libraries should probably get more
        generic support.  Ian Taylor <ian@cygnus.com>.  */
     if (strcmp (section->name, _LIB) == 0)
-      ++section->vma;
+      ++section->lma;
 #endif
 
     /* Don't write out bss sections - one way to do this is to 
@@ -2189,9 +2223,19 @@ bfd *abfd;
 #endif
 
 #ifndef coff_reloc16_extra_cases
-#define coff_reloc16_extra_cases \
-  (void (*) PARAMS ((bfd *, bfd_seclet_type *, arelent *, bfd_byte *,\
-                    unsigned int *, unsigned int *))) abort
+#define coff_reloc16_extra_cases dummy_reloc16_extra_cases
+/* This works even if abort is not declared in any header file.  */
+void
+dummy_reloc16_extra_cases (abfd, seclet, reloc, data, src_ptr, dst_ptr)
+     bfd *abfd;
+     struct bfd_seclet *seclet;
+     arelent *reloc;
+     bfd_byte *data;
+     unsigned int *src_ptr;
+     unsigned int *dst_ptr;
+{
+  abort ();
+}
 #endif
 
 static CONST bfd_coff_backend_data bfd_coff_std_swap_table = {
This page took 0.023824 seconds and 4 git commands to generate.