* Many files: Changes to avoid gcc warnings: Remove unused local
[deliverable/binutils-gdb.git] / bfd / coffcode.h
index 383719c00c96265adb02f086b1de4175af6d31fd..f48425ef3be6a082cdb2d4cbaab08e767b1464d9 100644 (file)
@@ -588,6 +588,12 @@ styp_to_sec_flags (abfd, hdr, name)
          can't call slurp_symtab, because the linker doesn't want the
          swapped symbols.  */
 
+      /* COMDAT sections are special.  The first symbol is the section
+        symbol, which tells what kind of COMDAT section it is.  The
+        *second* symbol is the "comdat symbol" - the one with the
+        unique name.  GNU uses the section symbol for the unique
+        name; MS uses ".text" for every comdat section.  Sigh.  - DJ */
+
       if (_bfd_coff_get_external_symbols (abfd))
        {
          bfd_byte *esym, *esymend;
@@ -629,10 +635,23 @@ styp_to_sec_flags (abfd, hdr, name)
                                            isym.n_type, isym.n_sclass,
                                            0, isym.n_numaux, (PTR) &aux);
 
+                     /* FIXME: Microsoft uses NODUPLICATES and
+                        ASSOCIATIVE, but gnu uses ANY and SAME_SIZE.
+                        Unfortunately, gnu doesn't do the comdat
+                        symbols right.  So, until we can fix it to do
+                        the right thing, we are temporarily disabling
+                        comdats for the MS types (they're used in
+                        DLLs and C++, but we don't support *their*
+                        C++ libraries anyway - DJ */
+
                      switch (aux.x_scn.x_comdat)
                        {
                        case IMAGE_COMDAT_SELECT_NODUPLICATES:
+#if 0
                          sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
+#else
+                         sec_flags &= ~SEC_LINK_ONCE;
+#endif
                          break;
 
                        default:
@@ -649,8 +668,12 @@ styp_to_sec_flags (abfd, hdr, name)
                          break;
 
                        case IMAGE_COMDAT_SELECT_ASSOCIATIVE:
+#if 0
                          /* FIXME: This is not currently implemented.  */
                          sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+#else
+                         sec_flags &= ~SEC_LINK_ONCE;
+#endif
                          break;
                        }
 
@@ -1205,6 +1228,9 @@ coff_set_alignment_hook (abfd, section, scnhdr)
     }
 #endif
 
+#ifdef COFF_WITH_PE
+  section->lma = hdr->s_vaddr;
+#endif
 }
 #undef ALIGN_SET
 #undef ELIFALIGN_SET
@@ -1396,11 +1422,14 @@ coff_set_arch_mach_hook (abfd, filehdr)
       arch = bfd_arch_arm;
       switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
        {
-       case F_ARM_2:  machine = bfd_mach_arm_2;  break;
-       case F_ARM_3:  machine = bfd_mach_arm_3;  break;
-       default:
-       case F_ARM_4:  machine = bfd_mach_arm_4;  break;
-       case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+        case F_ARM_2:  machine = bfd_mach_arm_2;  break;
+        case F_ARM_2a: machine = bfd_mach_arm_2a; break;
+        case F_ARM_3:  machine = bfd_mach_arm_3;  break;
+        default:
+        case F_ARM_3M: machine = bfd_mach_arm_3M; break;
+        case F_ARM_4:  machine = bfd_mach_arm_4;  break;
+        case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+        case F_ARM_5:  machine = bfd_mach_arm_5;  break;
        }
       break;
 #endif
@@ -2027,7 +2056,7 @@ coff_set_flags (abfd, magicp, flagsp)
            * flagsp |= F_APCS_FLOAT;
          
          if (PIC_FLAG (abfd))
-           * flagsp |= F_PIC_INT;
+           * flagsp |= F_PIC;
        }
       if (INTERWORK_SET (abfd) && INTERWORK_FLAG (abfd))
        * flagsp |= F_INTERWORK;
@@ -2039,6 +2068,8 @@ coff_set_flags (abfd, magicp, flagsp)
        case bfd_mach_arm_3M: * flagsp |= F_ARM_3M; break;
        case bfd_mach_arm_4:  * flagsp |= F_ARM_4;  break;
        case bfd_mach_arm_4T: * flagsp |= F_ARM_4T; break;
+       case bfd_mach_arm_5:  * flagsp |= F_ARM_5;  break;
+       case bfd_mach_arm_5T: * flagsp |= F_ARM_5;  break; /* XXX - we do not have an F_ARM_5T */
        }
       return true;
 #endif
@@ -3581,6 +3612,11 @@ coff_slurp_symbol_table (abfd)
 #ifdef COFF_WITH_PE
              if (src->u.syment.n_sclass == C_NT_WEAK)
                dst->symbol.flags = BSF_WEAK;
+             if (src->u.syment.n_sclass == C_SECTION
+                 && src->u.syment.n_scnum > 0)
+               {
+                 dst->symbol.flags = BSF_LOCAL;
+               }
 #endif
 
              if (src->u.syment.n_sclass == C_WEAKEXT)
This page took 0.025031 seconds and 4 git commands to generate.