aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-01-31 19:06:17 +0000
committerIan Lance Taylor <ian@airs.com>1996-01-31 19:06:17 +0000
commit66b935dacec7ebe6c5ba596d494ae6f6e357314e (patch)
treee5526a93bd9b7caab68b24f7bb2ea46e63f20a44 /gas/config
parentd586f394b59ac2469da1e6d8cc2f130559371027 (diff)
downloadgdb-66b935dacec7ebe6c5ba596d494ae6f6e357314e.zip
gdb-66b935dacec7ebe6c5ba596d494ae6f6e357314e.tar.gz
gdb-66b935dacec7ebe6c5ba596d494ae6f6e357314e.tar.bz2
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.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/.Sanitize1
-rw-r--r--gas/config/obj-coff.c35
-rw-r--r--gas/config/te-aux.h17
3 files changed, 50 insertions, 3 deletions
diff --git a/gas/config/.Sanitize b/gas/config/.Sanitize
index f7038cb..e25270d 100644
--- a/gas/config/.Sanitize
+++ b/gas/config/.Sanitize
@@ -126,6 +126,7 @@ tc-w65.h
tc-z8k.c
tc-z8k.h
te-386bsd.h
+te-aux.h
te-delta.h
te-delt88.h
te-dpx2.h
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index cb36264..04b8ad9 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -1,5 +1,5 @@
/* 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.
@@ -1594,6 +1594,25 @@ count_entries_in_chain (idx)
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)
@@ -1653,6 +1672,10 @@ 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)
{
@@ -1697,6 +1720,12 @@ do_relocs_for (abfd, h, file_cursor)
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);
@@ -3053,7 +3082,7 @@ write_object_file ()
/* 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);
@@ -3882,7 +3911,7 @@ fixup_segment (segP, this_segment_type)
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
diff --git a/gas/config/te-aux.h b/gas/config/te-aux.h
new file mode 100644
index 0000000..b2d7759
--- /dev/null
+++ b/gas/config/te-aux.h
@@ -0,0 +1,17 @@
+#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