* configure.in (m68*-apple-aux*): New target.
* config/te-aux.h: New file.
* config/obj-coff.c (compare_external_relocs): New static function
if TE_AUX.
(do_relocs_for): Sort relocs if TE_AUX.
(fixup_segment): If TE_AUX, store common symbol value in segment.
* config/tc-m68k.h (TARGET_FORMAT): Define if TE_AUX.
+Wed Jan 31 14:03:17 1996 Richard Henderson <rth@tamu.edu>
+
+ * configure.in (m68*-apple-aux*): New target.
+ * config/te-aux.h: New file.
+ * config/obj-coff.c (compare_external_relocs): New static function
+ if TE_AUX.
+ (do_relocs_for): Sort relocs if TE_AUX.
+ (fixup_segment): If TE_AUX, store common symbol value in segment.
+ * config/tc-m68k.h (TARGET_FORMAT): Define if TE_AUX.
+
Wed Jan 31 12:24:58 1996 Ian Lance Taylor <ian@cygnus.com>
* config/tc-mips.c (s_mips_globl): Set BSF_OBJECT if it is not
tc-z8k.c
tc-z8k.h
te-386bsd.h
+te-aux.h
te-delta.h
te-delt88.h
te-dpx2.h
/* coff object file format
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
Free Software Foundation, Inc.
This file is part of GAS.
return nrelocs;
}
+#ifdef TE_AUX
+
+static int compare_external_relocs PARAMS ((const PTR, const PTR));
+
+/* AUX's ld expects relocations to be sorted */
+static int
+compare_external_relocs (x, y)
+ const PTR x;
+ const PTR y;
+{
+ struct external_reloc *a = (struct external_reloc *) x;
+ struct external_reloc *b = (struct external_reloc *) y;
+ bfd_vma aadr = bfd_getb32 (a->r_vaddr);
+ bfd_vma badr = bfd_getb32 (b->r_vaddr);
+ return (aadr < badr ? -1 : badr < aadr ? 1 : 0);
+}
+
+#endif
+
/* output all the relocations for a section */
void
do_relocs_for (abfd, h, file_cursor)
intr.r_offset = 0;
#endif
+ while (S_GET_SEGMENT (symbol_ptr) == undefined_section
+ && symbol_ptr->sy_value.X_op == O_symbol)
+ symbol_ptr = symbol_ptr->sy_value.X_add_symbol;
+
/* Turn the segment of the symbol into an offset. */
if (symbol_ptr)
{
fix_ptr = fix_ptr->fx_next;
}
+#ifdef TE_AUX
+ /* Sort the reloc table */
+ qsort ((PTR) external_reloc_vec, nrelocs,
+ sizeof (struct external_reloc), compare_external_relocs);
+#endif
+
/* Write out the reloc table */
bfd_write ((PTR) external_reloc_vec, 1, external_reloc_size,
abfd);
/* I think the section alignment is only used on the i960; the
i960 needs it, and it should do no harm on other targets. */
- segment_info[i].scnhdr.s_align = section_alignment[i];
+ segment_info[i].scnhdr.s_align = 1 << section_alignment[i];
if (i == SEG_E0)
H_SET_TEXT_SIZE (&headers, size);
continue;
} /* COBR */
#endif /* TC_I960 */
-#if (defined (TC_I386) || defined (TE_LYNX)) && !defined(TE_PE)
+#if (defined (TC_I386) || defined (TE_LYNX) || defined (TE_AUX)) && !defined(TE_PE)
/* 386 COFF uses a peculiar format in which the
value of a common symbol is stored in the .text
segment (I've checked this on SVR3.2 and SCO
--- /dev/null
+#define TE_AUX
+
+/* From obj-coff.h:
+ This internal_lineno crap is to stop namespace pollution from the
+ bfd internal coff headerfile. */
+#define internal_lineno bfd_internal_lineno
+#include "coff/aux.h" /* override bits in coff/internal.h */
+#undef internal_lineno
+
+#define COFF_NOLOAD_PROBLEM
+#define KEEP_RELOC_INFO
+
+#include "obj-format.h"
+
+#ifndef LOCAL_LABELS_FB
+#define LOCAL_LABELS_FB 1
+#endif
em=lynx ;;
i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
fmt=elf ;;
+ i386-*-sco*elf*) fmt=elf targ=sco5 ;;
i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
fmt=coff targ=i386coff ;;
i386-*-vsta) fmt=aout ;;
m68k-*-lynxos*) fmt=coff targ=m68kcoff
em=lynx ;;
m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
+ m68*-apple-aux*) fmt=coff targ=m68kcoff em=aux ;;
m88k-motorola-sysv3*) fmt=coff targ=m88kcoff em=delt88 ;;
m88k-*-coff*) fmt=coff targ=m88kcoff ;;
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1443 "configure"
+#line 1445 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1457 "configure"
+#line 1459 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1490 "configure"
+#line 1492 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_cv_c_cross=yes
else
cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1544 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1566 "configure"
+#line 1568 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1598 "configure"
+#line 1600 "configure"
#include "confdefs.h"
#ifdef __GNUC__
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1657 "configure"
+#line 1659 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1686 "configure"
+#line 1688 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1740 "configure"
+#line 1742 "configure"
#include "confdefs.h"
find_stack_direction ()
{
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1783 "configure"
+#line 1785 "configure"
#include "confdefs.h"
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1823 "configure"
+#line 1825 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1876 "configure"
+#line 1878 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1929 "configure"
+#line 1931 "configure"
#include "confdefs.h"
#include <assert.h>
#include <stdio.h>
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1986 "configure"
+#line 1988 "configure"
#include "confdefs.h"
$gas_test_headers
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2022 "configure"
+#line 2024 "configure"
#include "confdefs.h"
$gas_test_headers
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2061 "configure"
+#line 2063 "configure"
#include "confdefs.h"
#ifdef HAVE_ERRNO_H
em=lynx ;;
i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
fmt=elf ;;
+ i386-*-sco*elf*) fmt=elf targ=sco5 ;;
i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
fmt=coff targ=i386coff ;;
i386-*-vsta) fmt=aout ;;
m68k-*-lynxos*) fmt=coff targ=m68kcoff
em=lynx ;;
m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
+ m68*-apple-aux*) fmt=coff targ=m68kcoff em=aux ;;
m88k-motorola-sysv3*) fmt=coff targ=m88kcoff em=delt88 ;;
m88k-*-coff*) fmt=coff targ=m88kcoff ;;