1999-08-08 Mumit Khan <khan@xraylith.wisc.edu>
authorIan Lance Taylor <ian@airs.com>
Sun, 8 Aug 1999 16:50:27 +0000 (16:50 +0000)
committerIan Lance Taylor <ian@airs.com>
Sun, 8 Aug 1999 16:50:27 +0000 (16:50 +0000)
* section.c (SEC_SHARED): Define.
* coffcode.h (sec_to_styp_flags): Handle SEC_SHARED.
(styp_to_sec_flags): Likewise.
* peicode.h (coff_swap_scnhdr_out): Likewise.
* bfd-in2.h: Rebuild.

1999-08-08  Ian Lance Taylor  <ian@zembu.com>

* coffcode.h (coff_classify_symbol): Comment out part of
1999-08-05 change which breaks cygwin DLLs.

bfd/ChangeLog
bfd/bfd-in2.h
bfd/coffcode.h
bfd/peicode.h
bfd/section.c

index 3890324469b46e969ca9f5d20d2e8da7510d5c48..4de1900471cdab93ad2542e08d49afd2a6d3c17f 100644 (file)
@@ -1,5 +1,16 @@
+1999-08-08  Mumit Khan  <khan@xraylith.wisc.edu>
+
+       * section.c (SEC_SHARED): Define.
+       * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED.
+       (styp_to_sec_flags): Likewise.
+       * peicode.h (coff_swap_scnhdr_out): Likewise.
+       * bfd-in2.h: Rebuild.
+
 1999-08-08  Ian Lance Taylor  <ian@zembu.com>
 
+       * coffcode.h (coff_classify_symbol): Comment out part of
+       1999-08-05 change which breaks cygwin DLLs.
+
        * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*.
        * aclocal.m4, configure: Rebuild.
 
index 6dc576b4cffdbb42511c73fb2d2df937e8779967..139974965405051cebdd7e23eb448078c03bf154 100644 (file)
@@ -1008,6 +1008,10 @@ typedef struct sec
           "near" the GP.  */
 #define SEC_SHORT 0x2000000
 
+        /* This section contains data which may be shared with other
+          executables or shared objects.  */
+#define SEC_SHARED 0x4000000
+
         /*  End of section flags.  */
 
         /* Some internal packed boolean fields.  */
index cc7b1489e7ffedbc194ffee1dff7218d02f6e7f7..301e5f79c0ce6de4274c14b4d1efbc8ca274822e 100644 (file)
@@ -445,6 +445,8 @@ sec_to_styp_flags (sec_name, sec_flags)
 #ifdef COFF_WITH_PE
   if (sec_flags & SEC_LINK_ONCE)
     styp_flags |= IMAGE_SCN_LNK_COMDAT;
+  if (sec_flags & SEC_SHARED)
+    styp_flags |= IMAGE_SCN_MEM_SHARED;
 #endif
 
   return (styp_flags);
@@ -579,6 +581,9 @@ styp_to_sec_flags (abfd, hdr, name)
   if (styp_flags & IMAGE_SCN_LNK_REMOVE)
     sec_flags |= SEC_EXCLUDE;
 
+  if (styp_flags & IMAGE_SCN_MEM_SHARED)
+    sec_flags |= SEC_SHARED;
+
   if (styp_flags & IMAGE_SCN_LNK_COMDAT)
     {
       sec_flags |= SEC_LINK_ONCE;
@@ -3911,6 +3916,10 @@ coff_classify_symbol (abfd, syment)
          return COFF_SYMBOL_LOCAL;
        }
 
+#if 0
+      /* This is correct for Microsoft generated objects, but it
+         breaks gas generated objects.  */
+
       if (syment->n_value == 0)
        {
          asection *sec;
@@ -3923,6 +3932,7 @@ coff_classify_symbol (abfd, syment)
                  == 0))
            return COFF_SYMBOL_PE_SECTION;
        }
+#endif
 
       return COFF_SYMBOL_LOCAL;
     }
index 3adb2d88773dbd94981206a5d254262729771efe..3737a57f2b52dddd63c84ebdce6ab5f4536004c3 100644 (file)
@@ -1239,6 +1239,8 @@ coff_swap_scnhdr_out (abfd, in, out)
        flags |= IMAGE_SCN_MEM_READ;
        if (! (flags & SEC_READONLY))
          flags |= IMAGE_SCN_MEM_WRITE;
+       if (flags & SEC_SHARED)
+         flags |= IMAGE_SCN_MEM_SHARED;
       }
 
     bfd_h_put_32(abfd, flags, (bfd_byte *) scnhdr_ext->s_flags);
index 4f3edacb2ed69c5d52a0491d2edbf7b020f0654f..654ce231b88788ab76785cbbd98dab5e27ec67d9 100644 (file)
@@ -311,6 +311,10 @@ CODE_FRAGMENT
 .         "near" the GP.  *}
 .#define SEC_SHORT 0x2000000
 .
+.      {* This section contains data which may be shared with other
+.         executables or shared objects.  *}
+.#define SEC_SHARED 0x4000000
+.
 .      {*  End of section flags.  *}
 .
 .      {* Some internal packed boolean fields.  *}