aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-05-13 19:56:07 +0000
committerSteve Chamberlain <steve@cygnus>1991-05-13 19:56:07 +0000
commitfb030779ae33290ed6d85c416f32c313b22deb81 (patch)
treead3443ee507a8ee4a4dba0eb8119a5a54d438f4b
parentdf9d12efd3850b4324323176fae2e8dfb57ba551 (diff)
downloadgdb-fb030779ae33290ed6d85c416f32c313b22deb81.zip
gdb-fb030779ae33290ed6d85c416f32c313b22deb81.tar.gz
gdb-fb030779ae33290ed6d85c416f32c313b22deb81.tar.bz2
*** empty log message ***
-rw-r--r--bfd/ChangeLog2
-rwxr-xr-xbfd/coff-code.h24
-rwxr-xr-xinclude/coff-i960.h19
3 files changed, 20 insertions, 25 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1191d39..4997079 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -7,7 +7,7 @@ Mon May 13 10:03:29 1991 Steve Chamberlain (steve at cygint.cygnus.com)
(swap_filehdr) delete. Changed all the usage of bfd_h_put_x.
(swap_aouthdr_in, swap_aouthdr_out) add. (swap_aouthdr) delete.
(coff_real_object_p) cleaned up, added MIPS. (coff_object_p)
- cleaned up. (coff_write_object_contents) cleaned up.
+ cleaned up. (coff_write_object_contents) cleaned up.
* ecoff.c: Totally different. Now supports ecoff fully.
diff --git a/bfd/coff-code.h b/bfd/coff-code.h
index 12cb080..4d125ab 100755
--- a/bfd/coff-code.h
+++ b/bfd/coff-code.h
@@ -453,6 +453,7 @@ DEFUN(make_a_section_from_file,(abfd, hdr),
return_section->lineno_count = hdr->s_nlnno;
return_section->userdata = NULL;
return_section->next = (asection *) NULL;
+ return_section->flags = 0;
if ((hdr->s_flags & STYP_TEXT) || (hdr->s_flags & STYP_DATA))
return_section->flags = (SEC_LOAD | SEC_ALLOC);
else if (hdr->s_flags & STYP_BSS)
@@ -523,18 +524,14 @@ DEFUN(coff_real_object_p,(abfd, nscns, internal_f, internal_a),
abfd->obj_machine = 0;
switch (internal_f->f_magic) {
#ifdef MIPS
-#ifdef MIPSEBMAGIC
- case SMIPSEBMAGIC:
- case SMIPSELMAGIC:
- case MIPSEBUMAGIC:
- case MIPSELUMAGIC:
- case MIPSEBMAGIC:
- case MIPSELMAGIC:
+case MIPS_MAGIC_1:
+case MIPS_MAGIC_2:
+case MIPS_MAGIC_3:
abfd->obj_arch = bfd_arch_mips;
abfd->obj_machine = 0;
break;
#endif
-#endif
+
#ifdef MC68MAGIC
case MC68MAGIC:
case M68MAGIC:
@@ -1318,7 +1315,12 @@ unsigned *magicp,
}
break;
#endif
-
+#ifdef MIPS
+ case bfd_arch_mips:
+ *magicp = MIPS_MAGIC_2;
+ return true;
+ break;
+#endif
#ifdef MC68MAGIC
case bfd_arch_m68k:
*magicp = MC68MAGIC;
@@ -1609,11 +1611,9 @@ bfd *abfd)
{ int magic = 0;
int flags = 0;
coff_set_flags(abfd, &magic, &flags);
- internal_f.f_flags |= flags;
internal_f.f_magic = magic;
internal_f.f_flags = flags;
-
/* ...and the "opt"hdr... */
#ifdef I960
@@ -1653,7 +1653,7 @@ bfd *abfd)
{
FILHDR buff;
swap_filehdr_out(abfd, &internal_f, &buff);
- bfd_write((PTR) &internal_f, 1, FILHSZ, abfd);
+ bfd_write((PTR) &buff, 1, FILHSZ, abfd);
}
if (abfd->flags & EXEC_P) {
AOUTHDR buff;
diff --git a/include/coff-i960.h b/include/coff-i960.h
index bf33d5a..795227a 100755
--- a/include/coff-i960.h
+++ b/include/coff-i960.h
@@ -59,21 +59,16 @@ struct internal_filehdr
/* Mips magics */
-#define MIPSEBMAGIC 0x160
-#define MIPSELMAGIC 0x161
-#define SMIPSEBMAGIC 0x6001
-#define SMIPSELMAGIC 0x162 /*0x6201*/
-#define MIPSEBUMAGIC 0x0180
-#define MIPSELUMAGIC 0x0182
+#define MIPS_MAGIC_1 0x0180
+#define MIPS_MAGIC_2 0x0162
+#define MIPS_MAGIC_3 0x0160
-#define ECOFFBADMAG(x) (((x).f_magic!=MIPSEBMAGIC) &&\
- ((x).f_magic!=MIPSELMAGIC) &&\
- ((x).f_magic!=SMIPSEBMAGIC) &&\
- ((x).f_magic!=SMIPSELMAGIC) &&\
- ((x).f_magic!=MIPSEBUMAGIC) &&\
- ((x).f_magic!=MIPSELUMAGIC))
+#define ECOFFBADMAG(x) (((x).f_magic!=MIPS_MAGIC_1) && \
+ ((x).f_magic!=MIPS_MAGIC_2) &&\
+ ((x).f_magic!=MIPS_MAGIC_3))
+
/** i80960 Magic Numbers
*/