aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-05-10 18:29:19 +0000
committerIan Lance Taylor <ian@airs.com>1994-05-10 18:29:19 +0000
commitc16313f06cf9273b61a425a1cd3b9e5d04058a1b (patch)
tree9641300155bc095b6669e07c8da7bc5e4b704fad /bfd/coffcode.h
parent39a20ec6777401cc752d7766e0660cddacedc758 (diff)
downloadgdb-c16313f06cf9273b61a425a1cd3b9e5d04058a1b.zip
gdb-c16313f06cf9273b61a425a1cd3b9e5d04058a1b.tar.gz
gdb-c16313f06cf9273b61a425a1cd3b9e5d04058a1b.tar.bz2
* section.c (SEC_COFF_SHARED_LIBRARY): Renamed from
SEC_SHARED_LIBRARY for clarity. Changed all uses. * bfd-in2.h: Rebuilt. * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is set, set STYP_NOLOAD. * coffgen.c (coff_section_from_bfd_index): Don't get an assertion failure because of a bad shared library.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index af015bb..4dbda14 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -391,7 +391,7 @@ sec_to_styp_flags (sec_name, sec_flags)
}
#ifdef STYP_NOLOAD
- if (sec_flags & SEC_NEVER_LOAD)
+ if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0)
styp_flags |= STYP_NOLOAD;
#endif
@@ -425,14 +425,14 @@ styp_to_sec_flags (abfd, hdr)
if (styp_flags & STYP_TEXT)
{
if (sec_flags & SEC_NEVER_LOAD)
- sec_flags |= SEC_CODE | SEC_SHARED_LIBRARY;
+ sec_flags |= SEC_CODE | SEC_COFF_SHARED_LIBRARY;
else
sec_flags |= SEC_CODE | SEC_LOAD | SEC_ALLOC;
}
else if (styp_flags & STYP_DATA)
{
if (sec_flags & SEC_NEVER_LOAD)
- sec_flags |= SEC_DATA | SEC_SHARED_LIBRARY;
+ sec_flags |= SEC_DATA | SEC_COFF_SHARED_LIBRARY;
else
sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC;
}
@@ -440,7 +440,7 @@ styp_to_sec_flags (abfd, hdr)
{
#ifdef BSS_NOLOAD_IS_SHARED_LIBRARY
if (sec_flags & SEC_NEVER_LOAD)
- sec_flags |= SEC_ALLOC | SEC_SHARED_LIBRARY;
+ sec_flags |= SEC_ALLOC | SEC_COFF_SHARED_LIBRARY;
else
#endif
sec_flags |= SEC_ALLOC;
@@ -755,6 +755,14 @@ coff_new_section_hook (abfd, section)
coffsymbol (section->symbol)->native =
(combined_entry_type *) bfd_zalloc (abfd,
sizeof (combined_entry_type) * 10);
+
+#ifdef COFF_SPARC
+ /* This is to allow double-word operations on addresses in data or bss. */
+ if (strcmp (section->name, ".data") == 0
+ || strcmp (section->name, ".bss") == 0)
+ section->alignment_power = 3;
+#endif /* COFF_SPARC */
+
return true;
}
@@ -982,8 +990,8 @@ coff_set_arch_mach_hook (abfd, filehdr)
break;
#endif
-#ifdef SHMAGIC
- case SHMAGIC:
+#ifdef SH_ARCH_MAGIC
+ case SH_ARCH_MAGIC:
arch = bfd_arch_sh;
machine = 0;
break;
@@ -998,6 +1006,9 @@ coff_set_arch_mach_hook (abfd, filehdr)
#ifdef SPARCMAGIC
case SPARCMAGIC:
+#ifdef LYNXCOFFMAGIC
+ case LYNXCOFFMAGIC:
+#endif
arch = bfd_arch_sparc;
machine = 0;
break;
@@ -1220,9 +1231,9 @@ coff_set_flags (abfd, magicp, flagsp)
break;
#endif
-#ifdef SHMAGIC
+#ifdef SH_ARCH_MAGIC
case bfd_arch_sh:
- *magicp = SHMAGIC;
+ *magicp = SH_ARCH_MAGIC;
return true;
break;
#endif
@@ -1287,11 +1298,14 @@ coff_set_arch_mach (abfd, arch, machine)
{
unsigned dummy1;
unsigned short dummy2;
- bfd_default_set_arch_mach (abfd, arch, machine);
+
+ if (! bfd_default_set_arch_mach (abfd, arch, machine))
+ return false;
if (arch != bfd_arch_unknown &&
coff_set_flags (abfd, &dummy1, &dummy2) != true)
return false; /* We can't represent this type */
+
return true; /* We're easy ... */
}