summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd/aoutx.h
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-06 22:57:45 +0000
committerjdp <jdp@FreeBSD.org>1998-09-06 22:57:45 +0000
commit088484c9efa7b42bc7fcc180fd78fed96df31c63 (patch)
tree6c09c852a9bb7a6de448bb31aefcc26282130456 /contrib/binutils/bfd/aoutx.h
parent857a03a573e70a598db37cc5e2751f5a6b09c020 (diff)
parenteffee09f856ecc81feb91290459a2cda49d20287 (diff)
downloadFreeBSD-src-088484c9efa7b42bc7fcc180fd78fed96df31c63.zip
FreeBSD-src-088484c9efa7b42bc7fcc180fd78fed96df31c63.tar.gz
This commit was generated by cvs2svn to compensate for changes in r38889,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/binutils/bfd/aoutx.h')
-rw-r--r--contrib/binutils/bfd/aoutx.h40
1 files changed, 30 insertions, 10 deletions
diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h
index c6a482f..ff1cdd2 100644
--- a/contrib/binutils/bfd/aoutx.h
+++ b/contrib/binutils/bfd/aoutx.h
@@ -1,5 +1,6 @@
/* BFD semi-generic back-end for a.out binaries.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -715,11 +716,11 @@ NAME(aout,machine_type) (arch, machine, unknown)
case bfd_arch_m68k:
switch (machine) {
- case 0: arch_flags = M_68010; break;
- case 68000: arch_flags = M_UNKNOWN; *unknown = false; break;
- case 68010: arch_flags = M_68010; break;
- case 68020: arch_flags = M_68020; break;
- default: arch_flags = M_UNKNOWN; break;
+ case 0: arch_flags = M_68010; break;
+ case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = false; break;
+ case bfd_mach_m68010: arch_flags = M_68010; break;
+ case bfd_mach_m68020: arch_flags = M_68020; break;
+ default: arch_flags = M_UNKNOWN; break;
}
break;
@@ -3880,10 +3881,29 @@ NAME(aout,final_link) (abfd, info, callback)
obj_datasec (abfd)->reloc_count =
exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd);
- /* Write out the string table. */
- if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0)
- goto error_return;
- return emit_stringtab (abfd, aout_info.strtab);
+ /* Write out the string table, unless there are no symbols. */
+ if (abfd->symcount > 0)
+ {
+ if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0
+ || ! emit_stringtab (abfd, aout_info.strtab))
+ goto error_return;
+ }
+ else if (obj_textsec (abfd)->reloc_count == 0
+ && obj_datasec (abfd)->reloc_count == 0)
+ {
+ bfd_byte b;
+
+ b = 0;
+ if (bfd_seek (abfd,
+ (obj_datasec (abfd)->filepos
+ + exec_hdr (abfd)->a_data
+ - 1),
+ SEEK_SET) != 0
+ || bfd_write (&b, 1, 1, abfd) != 1)
+ goto error_return;
+ }
+
+ return true;
error_return:
if (aout_info.contents != NULL)
OpenPOWER on IntegriCloud