summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-08-08 16:50:27 +0000
committerIan Lance Taylor <ian@airs.com>1999-08-08 16:50:27 +0000
commitcc25477892688831a5ef7ededb626a20fe373cb5 (patch)
tree5839b67d06e9c6deaf1efa051e5ff4c0cdf71c39 /bfd
parentf38ec28d363a78b58bddd491ca65bf5adc4425a6 (diff)
downloadgdb-cc25477892688831a5ef7ededb626a20fe373cb5.tar.gz
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog11
-rw-r--r--bfd/bfd-in2.h4
-rw-r--r--bfd/coffcode.h10
-rw-r--r--bfd/peicode.h2
-rw-r--r--bfd/section.c4
5 files changed, 31 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3890324469b..4de1900471c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 6dc576b4cff..13997496540 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -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. */
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index cc7b1489e7f..301e5f79c0c 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -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;
}
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 3adb2d88773..3737a57f2b5 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -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);
diff --git a/bfd/section.c b/bfd/section.c
index 4f3edacb2ed..654ce231b88 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -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. *}