Add binutils 2.14 as an alternative for 2.9.1
This commit is contained in:
parent
8fa7eef8cd
commit
007e178912
|
@ -25,3 +25,6 @@
|
|||
[submodule "submodules/fd2pragma"]
|
||||
path = submodules/fd2pragma
|
||||
url = https://github.com/adtools/fd2pragma.git
|
||||
[submodule "submodules/binutils-2.14"]
|
||||
path = submodules/binutils-2.14
|
||||
url = https://github.com/adtools/amigaos-binutils-2.14.git
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
--- binutils-2.14/bfd/Makefile.am 2003-04-21 15:24:18.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/Makefile.am 2013-04-24 18:38:23.000000000 +0200
|
||||
@@ -162,7 +162,10 @@
|
||||
# The .o files needed by all of the 32 bit vectors that are configured into
|
||||
# target_vector in targets.c if configured with --enable-targets=all.
|
||||
BFD32_BACKENDS = \
|
||||
+ amigaos.lo \
|
||||
+ amigaoslink.lo \
|
||||
aout-adobe.lo \
|
||||
+ aout-amiga.lo \
|
||||
aout-arm.lo \
|
||||
aout-cris.lo \
|
||||
aout-ns32k.lo \
|
||||
@@ -326,7 +331,10 @@
|
||||
xtensa-modules.lo
|
||||
|
||||
BFD32_BACKENDS_CFILES = \
|
||||
+ amigaos.c \
|
||||
+ amigaoslink.c \
|
||||
aout-adobe.c \
|
||||
+ aout-amiga.c \
|
||||
aout-arm.c \
|
||||
aout-cris.c \
|
||||
aout-ns32k.c \
|
||||
@@ -587,7 +597,7 @@
|
||||
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
|
||||
elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h \
|
||||
elf64-hppa.h elfcode.h elfcore.h elflink.h \
|
||||
- freebsd.h genlink.h go32stub.h \
|
||||
+ freebsd.h genlink.h go32stub.h libamiga.h \
|
||||
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
|
||||
libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
|
||||
netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
|
||||
@@ -969,9 +979,14 @@
|
||||
cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h
|
||||
cpu-xtensa.lo: cpu-xtensa.c $(INCDIR)/filenames.h
|
||||
cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h
|
||||
+amigaos.lo: amigaos.c libamiga.h
|
||||
+amigaoslink.lo: amigaoslink.c $(INCDIR)/bfdlink.h genlink.h libamiga.h
|
||||
aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
+aout-amiga.lo: aout-amiga.c libaout.h $(INCDIR)/bfdlink.h \
|
||||
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
|
@ -1,48 +0,0 @@
|
|||
--- binutils-2.14/bfd/Makefile.in 2003-05-02 19:06:14.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/Makefile.in 2013-04-24 18:38:25.000000000 +0200
|
||||
@@ -289,7 +337,10 @@
|
||||
# The .o files needed by all of the 32 bit vectors that are configured into
|
||||
# target_vector in targets.c if configured with --enable-targets=all.
|
||||
BFD32_BACKENDS = \
|
||||
+ amigaos.lo \
|
||||
+ amigaoslink.lo \
|
||||
aout-adobe.lo \
|
||||
+ aout-amiga.lo \
|
||||
aout-arm.lo \
|
||||
aout-cris.lo \
|
||||
aout-ns32k.lo \
|
||||
@@ -454,7 +507,10 @@
|
||||
|
||||
|
||||
BFD32_BACKENDS_CFILES = \
|
||||
+ amigaos.c \
|
||||
+ amigaoslink.c \
|
||||
aout-adobe.c \
|
||||
+ aout-amiga.c \
|
||||
aout-arm.c \
|
||||
aout-cris.c \
|
||||
aout-ns32k.c \
|
||||
@@ -721,7 +779,7 @@
|
||||
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
|
||||
elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h \
|
||||
elf64-hppa.h elfcode.h elfcore.h elflink.h \
|
||||
- freebsd.h genlink.h go32stub.h \
|
||||
+ freebsd.h genlink.h go32stub.h libamiga.h \
|
||||
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
|
||||
libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
|
||||
netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
|
||||
@@ -1502,9 +1508,14 @@
|
||||
cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h
|
||||
cpu-xtensa.lo: cpu-xtensa.c $(INCDIR)/filenames.h
|
||||
cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h
|
||||
+amigaos.lo: amigaos.c libamiga.h
|
||||
+amigaoslink.lo: amigaoslink.c $(INCDIR)/bfdlink.h genlink.h libamiga.h
|
||||
aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
+aout-amiga.lo: aout-amiga.c libaout.h $(INCDIR)/bfdlink.h \
|
||||
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,152 +0,0 @@
|
|||
/* BFD back-end for Amiga style m68k a.out binaries.
|
||||
Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Contributed by Stephan Thesing.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define TARGETNAME "a.out-amiga"
|
||||
#define MACHTYPE_OK(m) ((m)==M_UNKNOWN || (m)==M_68010 || (m)==M_68020)
|
||||
#define TARGET_IS_BIG_ENDIAN_P
|
||||
#define TARGET_PAGE_SIZE 0x2000
|
||||
#define N_HEADER_IN_TEXT(x) 0
|
||||
#define N_SHARED_LIB(x) 0
|
||||
#define TEXT_START_ADDR 0
|
||||
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (aout_amiga_,OP)
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "libbfd.h"
|
||||
#include "libaout.h"
|
||||
#include "aout/aout64.h"
|
||||
|
||||
bfd_boolean
|
||||
MY(final_link) PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
||||
bfd_boolean
|
||||
amiga_final_link PARAMS ((bfd *, struct bfd_link_info *));
|
||||
#define MY_bfd_final_link amiga_final_link
|
||||
|
||||
bfd_byte *
|
||||
get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *,
|
||||
struct bfd_link_order *, bfd_byte *, bfd_boolean, asymbol **));
|
||||
#define MY_bfd_get_relocated_section_contents get_relocated_section_contents
|
||||
|
||||
static unsigned long MY(get_mach) PARAMS ((enum machine_type));
|
||||
static bfd_boolean MY(write_object_contents) PARAMS ((bfd *));
|
||||
static bfd_boolean MY(set_sizes) PARAMS ((bfd *));
|
||||
static bfd_boolean MY(link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
|
||||
#define MY_bfd_link_add_symbols aout_amiga_link_add_symbols
|
||||
|
||||
static unsigned long
|
||||
MY(get_mach) (machtype)
|
||||
enum machine_type machtype;
|
||||
{
|
||||
unsigned long machine;
|
||||
switch (machtype)
|
||||
{
|
||||
default:
|
||||
case M_UNKNOWN:
|
||||
/* Some Sun3s make magic numbers without cpu types in them, so
|
||||
we'll default to the 68000. */
|
||||
machine = bfd_mach_m68000;
|
||||
break;
|
||||
|
||||
case M_68010:
|
||||
machine = bfd_mach_m68010;
|
||||
break;
|
||||
|
||||
case M_68020:
|
||||
machine = bfd_mach_m68020;
|
||||
break;
|
||||
}
|
||||
return machine;
|
||||
}
|
||||
#define SET_ARCH_MACH(ABFD, EXEC) \
|
||||
bfd_set_arch_mach (ABFD, bfd_arch_m68k, MY(get_mach) (N_MACHTYPE (EXEC)))
|
||||
|
||||
static bfd_boolean
|
||||
MY(write_object_contents) (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
struct external_exec exec_bytes;
|
||||
struct internal_exec *execp = exec_hdr (abfd);
|
||||
|
||||
/* Magic number, maestro, please! */
|
||||
switch (bfd_get_arch (abfd))
|
||||
{
|
||||
case bfd_arch_m68k:
|
||||
switch (bfd_get_mach (abfd))
|
||||
{
|
||||
case bfd_mach_m68000:
|
||||
N_SET_MACHTYPE (*execp, M_UNKNOWN);
|
||||
break;
|
||||
case bfd_mach_m68010:
|
||||
N_SET_MACHTYPE (*execp, M_68010);
|
||||
break;
|
||||
default:
|
||||
case bfd_mach_m68020:
|
||||
N_SET_MACHTYPE (*execp, M_68020);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
N_SET_MACHTYPE (*execp, M_UNKNOWN);
|
||||
}
|
||||
|
||||
WRITE_HEADERS (abfd, execp);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#define MY_write_object_contents MY(write_object_contents)
|
||||
|
||||
static bfd_boolean
|
||||
MY(set_sizes) (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
adata (abfd).page_size = TARGET_PAGE_SIZE;
|
||||
adata (abfd).segment_size = TARGET_PAGE_SIZE;
|
||||
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
|
||||
return TRUE;
|
||||
}
|
||||
#define MY_set_sizes MY(set_sizes)
|
||||
|
||||
/* Include the usual a.out support. */
|
||||
#include "aout-target.h"
|
||||
|
||||
/* Add symbols from an object file to the global hash table. */
|
||||
static bfd_boolean
|
||||
MY(link_add_symbols) (abfd, info)
|
||||
bfd *abfd;
|
||||
struct bfd_link_info *info;
|
||||
{
|
||||
if (info->hash->creator->flavour == bfd_target_amiga_flavour)
|
||||
return _bfd_generic_link_add_symbols (abfd, info);
|
||||
return NAME(aout,link_add_symbols) (abfd, info);
|
||||
}
|
||||
|
||||
/* Public final_link routine. */
|
||||
bfd_boolean
|
||||
MY(final_link) (abfd, info)
|
||||
bfd *abfd;
|
||||
struct bfd_link_info *info;
|
||||
{
|
||||
return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
--- binutils-2.14/bfd/aoutx.h 2003-03-31 20:13:24.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/aoutx.h 2013-04-24 18:38:23.000000000 +0200
|
||||
@@ -133,7 +133,8 @@
|
||||
PARAMS ((bfd *));
|
||||
static bfd_boolean translate_from_native_sym_flags
|
||||
PARAMS ((bfd *, aout_symbol_type *));
|
||||
-static bfd_boolean translate_to_native_sym_flags
|
||||
+/*Amiga hack - used in amigaos.c, must be global */
|
||||
+/*static*/ bfd_boolean translate_to_native_sym_flags
|
||||
PARAMS ((bfd *, asymbol *, struct external_nlist *));
|
||||
static void adjust_o_magic
|
||||
PARAMS ((bfd *, struct internal_exec *));
|
||||
@@ -1657,7 +1658,7 @@
|
||||
|
||||
/* Set the fields of SYM_POINTER according to CACHE_PTR. */
|
||||
|
||||
-static bfd_boolean
|
||||
+/*static*/ bfd_boolean
|
||||
translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
|
||||
bfd *abfd;
|
||||
asymbol *cache_ptr;
|
||||
@@ -2067,10 +2068,26 @@
|
||||
|
||||
r_length = g->howto->size ; /* Size as a power of two. */
|
||||
r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
|
||||
+#if 1
|
||||
+ /* FIXME! "#if 1" is the wrong way to select this Amiga specific code. */
|
||||
+ switch (bfd_asymbol_flavour(sym))
|
||||
+ {
|
||||
+ case bfd_target_amiga_flavour:
|
||||
+ case bfd_target_aout_flavour:
|
||||
+ r_baserel = (g->howto->type & 8) != 0;
|
||||
+ r_jmptable = (g->howto->type & 16) != 0;
|
||||
+ r_relative = (g->howto->type & 32) != 0;
|
||||
+ break;
|
||||
+ default:
|
||||
+ r_baserel=r_jmptable=r_relative=0;
|
||||
+ break;
|
||||
+ }
|
||||
+#else
|
||||
/* XXX This relies on relocs coming from a.out files. */
|
||||
r_baserel = (g->howto->type & 8) != 0;
|
||||
r_jmptable = (g->howto->type & 16) != 0;
|
||||
r_relative = (g->howto->type & 32) != 0;
|
||||
+#endif
|
||||
|
||||
#if 0
|
||||
/* For a standard reloc, the addend is in the object file. */
|
||||
@@ -2369,8 +2386,12 @@
|
||||
/* Base relative relocs are always against the symbol table,
|
||||
regardless of the setting of r_extern. r_extern just reflects
|
||||
whether the symbol the reloc is against is local or global. */
|
||||
+#if 0
|
||||
+ /* FIXME! "#if 0" is the wrong way to disable this code. See comment
|
||||
+ earlier in file. */
|
||||
if (r_baserel)
|
||||
r_extern = 1;
|
||||
+#endif
|
||||
|
||||
if (r_extern && r_index > symcount)
|
||||
{
|
|
@ -1,49 +0,0 @@
|
|||
--- binutils-2.14/bfd/archive.c 2002-11-30 09:39:34.000000000 +0100
|
||||
+++ binutils-2.14/bfd/archive.c 2013-05-17 23:47:34.000000000 +0200
|
||||
@@ -1420,7 +1420,7 @@
|
||||
strncpy (hdr->ar_fmag, ARFMAG, 2);
|
||||
|
||||
/* Goddamned sprintf doesn't permit MAXIMUM field lengths. */
|
||||
- sprintf ((hdr->ar_date), "%-12ld", (long) status.st_mtime);
|
||||
+ sprintf ((hdr->ar_date), "%-11ld", (long) status.st_mtime);
|
||||
#ifdef HPUX_LARGE_AR_IDS
|
||||
/* HP has a very "special" way to handle UID/GID's with numeric values
|
||||
> 99999. */
|
||||
@@ -1437,8 +1437,8 @@
|
||||
else
|
||||
#endif
|
||||
sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid);
|
||||
- sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode);
|
||||
- sprintf ((hdr->ar_size), "%-10ld", (long) status.st_size);
|
||||
+ sprintf ((hdr->ar_mode), "%-7o", (unsigned int) status.st_mode);
|
||||
+ sprintf ((hdr->ar_size), "%-9ld", (long) status.st_size);
|
||||
/* Correct for a lossage in sprintf whereby it null-terminates. I cannot
|
||||
understand how these C losers could design such a ramshackle bunch of
|
||||
IO operations. */
|
||||
@@ -1754,7 +1754,7 @@
|
||||
memset ((char *) (&hdr), 0, sizeof (struct ar_hdr));
|
||||
strcpy (hdr.ar_name, ename);
|
||||
/* Round size up to even number in archive header. */
|
||||
- sprintf (&(hdr.ar_size[0]), "%-10d",
|
||||
+ sprintf (&(hdr.ar_size[0]), "%-9d",
|
||||
(int) ((elength + 1) & ~(bfd_size_type) 1));
|
||||
strncpy (hdr.ar_fmag, ARFMAG, 2);
|
||||
for (i = 0; i < sizeof (struct ar_hdr); i++)
|
||||
@@ -2010,7 +2010,7 @@
|
||||
sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
|
||||
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
|
||||
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
|
||||
- sprintf (hdr.ar_size, "%-10d", (int) mapsize);
|
||||
+ sprintf (hdr.ar_size, "%-9d", (int) mapsize);
|
||||
strncpy (hdr.ar_fmag, ARFMAG, 2);
|
||||
for (i = 0; i < sizeof (struct ar_hdr); i++)
|
||||
if (((char *) (&hdr))[i] == '\0')
|
||||
@@ -2168,7 +2168,7 @@
|
||||
|
||||
memset ((char *) (&hdr), 0, sizeof (struct ar_hdr));
|
||||
hdr.ar_name[0] = '/';
|
||||
- sprintf (hdr.ar_size, "%-10d", (int) mapsize);
|
||||
+ sprintf (hdr.ar_size, "%-9d", (int) mapsize);
|
||||
sprintf (hdr.ar_date, "%ld", (long) time (NULL));
|
||||
/* This, at least, is what Intel coff sets the values to. */
|
||||
sprintf ((hdr.ar_uid), "%d", 0);
|
|
@ -1,18 +0,0 @@
|
|||
--- binutils-2.14/bfd/bfd-in2.h 2003-05-03 18:06:57.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/bfd-in2.h 2013-04-24 18:38:25.000000000 +0200
|
||||
@@ -3811,6 +3821,7 @@
|
||||
struct bfd_pef_data_struct *pef_data;
|
||||
struct bfd_pef_xlib_data_struct *pef_xlib_data;
|
||||
struct bfd_sym_data_struct *sym_data;
|
||||
+ struct amiga_data_struct *amiga_data;
|
||||
PTR any;
|
||||
}
|
||||
tdata;
|
||||
@@ -4069,6 +4080,7 @@
|
||||
enum bfd_flavour
|
||||
{
|
||||
bfd_target_unknown_flavour,
|
||||
+ bfd_target_amiga_flavour,
|
||||
bfd_target_aout_flavour,
|
||||
bfd_target_coff_flavour,
|
||||
bfd_target_ecoff_flavour,
|
|
@ -1,10 +0,0 @@
|
|||
--- binutils-2.14/bfd/bfd.c 2003-03-01 00:43:35.000000000 +0100
|
||||
+++ binutils-2.14-patched/bfd/bfd.c 2013-04-24 18:38:25.000000000 +0200
|
||||
@@ -188,6 +188,7 @@
|
||||
. struct bfd_pef_data_struct *pef_data;
|
||||
. struct bfd_pef_xlib_data_struct *pef_xlib_data;
|
||||
. struct bfd_sym_data_struct *sym_data;
|
||||
+. struct amiga_data_struct *amiga_data;
|
||||
. PTR any;
|
||||
. }
|
||||
. tdata;
|
|
@ -1,14 +0,0 @@
|
|||
--- binutils-2.14/bfd/config.bfd 2003-06-02 22:35:20.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/config.bfd 2013-04-24 18:38:23.000000000 +0200
|
||||
@@ -605,6 +610,11 @@
|
||||
m68*-motorola-sysv*)
|
||||
targ_defvec=m68ksysvcoff_vec
|
||||
;;
|
||||
+ m68*-*-amigaos*)
|
||||
+ targ_defvec=amiga_vec
|
||||
+ targ_selvecs="aout_amiga_vec amiga_vec"
|
||||
+ targ_underscore=yes
|
||||
+ ;;
|
||||
m68*-hp-bsd*)
|
||||
targ_defvec=hp300bsd_vec
|
||||
targ_underscore=yes
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils-2.14/bfd/configure 2003-06-12 16:25:46.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/configure 2013-04-24 18:38:23.000000000 +0200
|
||||
@@ -6083,7 +11457,9 @@
|
||||
a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
|
||||
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
|
||||
aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
|
||||
+ amiga_vec) tb="$tb amigaos.lo amigaoslink.lo" ;;
|
||||
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
|
||||
+ aout_amiga_vec) tb="$tb aout-amiga.lo aout32.lo";;
|
||||
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
|
||||
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
|
||||
aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils-2.14/bfd/configure.in 2003-06-12 16:25:46.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/configure.in 2013-04-24 18:38:25.000000000 +0200
|
||||
@@ -545,7 +545,9 @@
|
||||
a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
|
||||
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
|
||||
aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
|
||||
+ amiga_vec) tb="$tb amigaos.lo amigaoslink.lo" ;;
|
||||
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
|
||||
+ aout_amiga_vec) tb="$tb aout-amiga.lo aout32.lo";;
|
||||
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
|
||||
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
|
||||
aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
|
|
@ -1,38 +0,0 @@
|
|||
--- binutils-2.14/bfd/doc/Makefile.am 2002-11-18 17:37:54.000000000 +0100
|
||||
+++ binutils-2.14-patched/bfd/doc/Makefile.am 2013-04-24 18:38:20.000000000 +0200
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
-DOCFILES = aoutx.texi archive.texi archures.texi \
|
||||
+DOCFILES = amiga.texi amigalink.texi aoutx.texi archive.texi archures.texi \
|
||||
bfdt.texi cache.texi coffcode.texi \
|
||||
core.texi elf.texi elfcode.texi format.texi \
|
||||
libbfd.texi bfdwin.texi bfdio.texi \
|
||||
@@ -28,6 +28,7 @@
|
||||
$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
|
||||
$(srcdir)/../corefile.c $(srcdir)/../elf.c \
|
||||
$(srcdir)/../elfcode.h $(srcdir)/../format.c \
|
||||
+ $(srcdir)/../amigaos.c $(srcdir)/../amigaoslink.c \
|
||||
$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
|
||||
$(srcdir)/../reloc.c $(srcdir)/../section.c \
|
||||
$(srcdir)/../syms.c $(srcdir)/../targets.c \
|
||||
@@ -208,6 +210,18 @@
|
||||
touch s-linker
|
||||
linker.texi: s-linker
|
||||
|
||||
+s-amiga: $(MKDOC) $(srcdir)/../amigaos.c $(srcdir)/doc.str
|
||||
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaos.c >amiga.tmp
|
||||
+ $(srcdir)/../../move-if-change amiga.tmp amiga.texi
|
||||
+ touch s-amiga
|
||||
+amiga.texi: s-amiga
|
||||
+
|
||||
+s-amigalink: $(MKDOC) $(srcdir)/../amigaoslink.c $(srcdir)/doc.str
|
||||
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaoslink.c >amigalink.tmp
|
||||
+ $(srcdir)/../../move-if-change amigalink.tmp amigalink.texi
|
||||
+ touch s-amigalink
|
||||
+amigalink.texi: s-amigalink
|
||||
+
|
||||
LIBBFD_H_DEP = \
|
||||
$(srcdir)/../libbfd-in.h \
|
||||
$(srcdir)/../init.c \
|
|
@ -1,40 +0,0 @@
|
|||
--- binutils-2.14/bfd/doc/Makefile.in 2002-11-18 17:37:54.000000000 +0100
|
||||
+++ binutils-2.14-patched/bfd/doc/Makefile.in 2013-04-24 18:38:20.000000000 +0200
|
||||
@@ -122,9 +122,9 @@
|
||||
tdefaults = @tdefaults@
|
||||
wordsize = @wordsize@
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
-DOCFILES = aoutx.texi archive.texi archures.texi \
|
||||
+DOCFILES = amiga.texi amigalink.texi aoutx.texi archive.texi archures.texi \
|
||||
bfdt.texi cache.texi coffcode.texi \
|
||||
core.texi elf.texi elfcode.texi format.texi \
|
||||
libbfd.texi bfdwin.texi bfdio.texi \
|
||||
@@ -156,6 +156,7 @@
|
||||
$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
|
||||
$(srcdir)/../corefile.c $(srcdir)/../elf.c \
|
||||
$(srcdir)/../elfcode.h $(srcdir)/../format.c \
|
||||
+ $(srcdir)/../amigaos.c $(srcdir)/../amigaoslink.c \
|
||||
$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
|
||||
$(srcdir)/../reloc.c $(srcdir)/../section.c \
|
||||
$(srcdir)/../syms.c $(srcdir)/../targets.c \
|
||||
@@ -622,6 +623,18 @@
|
||||
touch s-linker
|
||||
linker.texi: s-linker
|
||||
|
||||
+s-amiga: $(MKDOC) $(srcdir)/../amigaos.c $(srcdir)/doc.str
|
||||
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaos.c >amiga.tmp
|
||||
+ $(srcdir)/../../move-if-change amiga.tmp amiga.texi
|
||||
+ touch s-amiga
|
||||
+amiga.texi: s-amiga
|
||||
+
|
||||
+s-amigalink: $(MKDOC) $(srcdir)/../amigaoslink.c $(srcdir)/doc.str
|
||||
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaoslink.c >amigalink.tmp
|
||||
+ $(srcdir)/../../move-if-change amigalink.tmp amigalink.texi
|
||||
+ touch s-amigalink
|
||||
+amigalink.texi: s-amigalink
|
||||
+
|
||||
libbfd.h: $(LIBBFD_H_DEP)
|
||||
echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(LIBBFD_H_DEP); do \
|
|
@ -1,29 +0,0 @@
|
|||
--- binutils-2.14/bfd/doc/bfd.texinfo 2003-02-13 12:26:41.000000000 +0100
|
||||
+++ binutils-2.14-patched/bfd/doc/bfd.texinfo 2013-04-24 18:38:20.000000000 +0200
|
||||
@@ -299,6 +299,7 @@
|
||||
* aout :: a.out backends
|
||||
* coff :: coff backends
|
||||
* elf :: elf backends
|
||||
+* amiga :: amigaos backend
|
||||
* mmo :: mmo backend
|
||||
@ignore
|
||||
* oasys :: oasys backends
|
||||
@@ -315,12 +316,16 @@
|
||||
@node coff, elf, aout, BFD back ends
|
||||
@include coffcode.texi
|
||||
|
||||
-@node elf, mmo, coff, BFD back ends
|
||||
+@node elf, amiga, coff, BFD back ends
|
||||
@include elf.texi
|
||||
@c Leave this out until the file has some actual contents...
|
||||
@c @include elfcode.texi
|
||||
|
||||
-@node mmo, , elf, BFD back ends
|
||||
+@node amiga, mmo, elf, BFD back ends
|
||||
+@include amiga.texi
|
||||
+@include amigalink.texi
|
||||
+
|
||||
+@node mmo, , amiga, BFD back ends
|
||||
@include mmo.texi
|
||||
|
||||
@node GNU Free Documentation License, Index, BFD back ends, Top
|
|
@ -1,187 +0,0 @@
|
|||
/* BFD back-end for Commodore-Amiga AmigaOS binaries. Data structures.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Leonard Norrgard.
|
||||
Extended by Stephan Thesing 11/1994.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Hunk ID numbers. */
|
||||
|
||||
#define HUNK_UNIT 999
|
||||
#define HUNK_NAME 1000
|
||||
#define HUNK_CODE 1001
|
||||
#define HUNK_DATA 1002
|
||||
#define HUNK_BSS 1003
|
||||
#define HUNK_RELOC32 1004
|
||||
#define HUNK_ABSRELOC32 HUNK_RELOC32
|
||||
#define HUNK_RELOC16 1005
|
||||
#define HUNK_RELRELOC16 HUNK_RELOC16
|
||||
#define HUNK_RELOC8 1006
|
||||
#define HUNK_RELRELOC8 HUNK_RELOC8
|
||||
#define HUNK_EXT 1007
|
||||
#define HUNK_SYMBOL 1008
|
||||
#define HUNK_DEBUG 1009
|
||||
#define HUNK_END 1010
|
||||
#define HUNK_HEADER 1011
|
||||
#define HUNK_OVERLAY 1013
|
||||
#define HUNK_BREAK 1014
|
||||
#define HUNK_DREL32 1015
|
||||
#define HUNK_DREL16 1016
|
||||
#define HUNK_DREL8 1017
|
||||
#define HUNK_LIB 1018
|
||||
#define HUNK_INDEX 1019
|
||||
#define HUNK_RELOC32SHORT 1020
|
||||
#define HUNK_RELRELOC32 1021
|
||||
#define HUNK_ABSRELOC16 1022
|
||||
/* EHF extensions */
|
||||
#define HUNK_PPC_CODE 1257
|
||||
#define HUNK_RELRELOC26 1260
|
||||
|
||||
/* The hunk ID part. */
|
||||
|
||||
#define HUNK_VALUE(hunk_id) ((hunk_id) & 0x3fffffff)
|
||||
|
||||
/* Attributes of a hunk. */
|
||||
|
||||
#define HUNK_ATTRIBUTE(hunk_id) ((hunk_id) >> 30)
|
||||
#define HUNK_ATTR_CHIP 0x01 /* hunk content must go into chip ram */
|
||||
#define HUNK_ATTR_FAST 0x02 /* fast */
|
||||
#define HUNK_ATTR_FOLLOWS 0x03 /* mem id follows */
|
||||
|
||||
/* HUNK_EXT subtypes. */
|
||||
|
||||
#define EXT_SYMB 0
|
||||
#define EXT_DEF 1
|
||||
#define EXT_ABS 2
|
||||
#define EXT_RES 3
|
||||
#define EXT_REF32 129
|
||||
#define EXT_ABSREF32 EXT_REF32
|
||||
#define EXT_COMMON 130
|
||||
#define EXT_ABSCOMMON EXT_COMMON
|
||||
#define EXT_REF16 131
|
||||
#define EXT_RELREF16 EXT_REF16
|
||||
#define EXT_REF8 132
|
||||
#define EXT_RELREF8 EXT_REF8
|
||||
#define EXT_DEXT32 133
|
||||
#define EXT_DEXT16 134
|
||||
#define EXT_DEXT8 135
|
||||
#define EXT_RELREF32 136
|
||||
#define EXT_RELCOMMON 137
|
||||
#define EXT_ABSREF16 138
|
||||
#define EXT_ABSREF8 139
|
||||
/* VBCC extensions */
|
||||
#define EXT_DEXT32COMMON 208
|
||||
#define EXT_DEXT16COMMON 209
|
||||
#define EXT_DEXT8COMMON 210
|
||||
/* EHF extensions */
|
||||
#define EXT_RELREF26 229
|
||||
|
||||
/* HOWTO types almost matching aoutx.h/howto_table_std. */
|
||||
|
||||
enum {
|
||||
H_ABS8=0,H_ABS16,H_ABS32,H_ABS32SHORT,H_PC8,H_PC16,H_PC32,H_PC26,H_SD8,H_SD16,H_SD32
|
||||
};
|
||||
|
||||
/* Various structures. */
|
||||
|
||||
typedef struct amiga_reloc {
|
||||
arelent relent;
|
||||
struct amiga_reloc *next;
|
||||
asymbol *symbol;
|
||||
} amiga_reloc_type;
|
||||
|
||||
/* Structure layout *must* match libaout.h/struct aout_symbol. */
|
||||
|
||||
typedef struct amiga_symbol {
|
||||
asymbol symbol;
|
||||
short desc;
|
||||
char other;
|
||||
unsigned char type;
|
||||
/* amiga data */
|
||||
unsigned long index,refnum;
|
||||
} amiga_symbol_type;
|
||||
|
||||
/* We take the address of the first element of an asymbol to ensure that the
|
||||
macro is only ever applied to an asymbol. */
|
||||
#define amiga_symbol(asymbol) ((amiga_symbol_type *)(&(asymbol)->the_bfd))
|
||||
|
||||
typedef struct raw_reloc {
|
||||
unsigned long num,pos;
|
||||
struct raw_reloc *next;
|
||||
} raw_reloc_type;
|
||||
|
||||
typedef struct amiga_per_section {
|
||||
amiga_reloc_type *reloc_tail; /* last reloc, first is in section->relocation */
|
||||
int attribute; /* Memory type required by this section */
|
||||
unsigned long disk_size; /* Section size on disk, _raw_size may be larger than this */
|
||||
amiga_symbol_type *amiga_symbols; /* the symbols for this section */
|
||||
unsigned long hunk_ext_pos; /* offset of hunk_ext in the bfd file */
|
||||
unsigned long hunk_symbol_pos; /* offset of hunk_symbol in the bfd file */
|
||||
raw_reloc_type *relocs;
|
||||
} amiga_per_section_type;
|
||||
|
||||
#define amiga_per_section(x) ((amiga_per_section_type *)((x)->used_by_bfd))
|
||||
|
||||
/* Structure layout *must* match libaout.h/struct aoutdata. */
|
||||
|
||||
struct amiga_data {
|
||||
char *dummy[2];
|
||||
sec_ptr textsec;
|
||||
sec_ptr datasec;
|
||||
sec_ptr bsssec;
|
||||
file_ptr sym_filepos;
|
||||
file_ptr str_filepos;
|
||||
/* rest intentionally omitted */
|
||||
};
|
||||
|
||||
typedef struct amiga_data_struct {
|
||||
struct amiga_data a;
|
||||
unsigned long symtab_size;
|
||||
unsigned long stringtab_size;
|
||||
amiga_symbol_type *symbols;
|
||||
bfd_boolean IsLoadFile; /* If true, this is a load file (for output bfd only) */
|
||||
unsigned int nb_hunks;
|
||||
/* The next two fields are set at final_link time (for the output bfd only) */
|
||||
bfd_boolean baserel;/* true if there is ___init_a4 in the global hash table */
|
||||
bfd_vma a4init; /* cache the value for efficiency */
|
||||
} amiga_data_type;
|
||||
|
||||
#define adata(bfd) ((bfd)->tdata.amiga_data->a)
|
||||
#define AMIGA_DATA(bfd) ((bfd)->tdata.amiga_data)
|
||||
|
||||
#define HUNKB_ADVISORY 29
|
||||
#define HUNKB_CHIP 30
|
||||
#define HUNKB_FAST 31
|
||||
#define HUNKF_ADVISORY (1L << HUNKB_ADVISORY)
|
||||
#define HUNKF_CHIP (1L << HUNKB_CHIP)
|
||||
#define HUNKF_FAST (1L << HUNKB_FAST)
|
||||
|
||||
#ifndef MEMF_ANY
|
||||
#define MEMF_ANY (0L)
|
||||
#define MEMF_PUBLIC (1L << 0)
|
||||
#define MEMF_CHIP (1L << 1)
|
||||
#define MEMF_FAST (1L << 2)
|
||||
#define MEMF_LOCAL (1L << 8)
|
||||
#define MEMF_24BITDMA (1L << 9)
|
||||
#define MEMF_KICK (1L << 10)
|
||||
#define MEMF_CLEAR (1L << 16)
|
||||
#define MEMF_LARGEST (1L << 17)
|
||||
#define MEMF_REVERSE (1L << 18)
|
||||
#define MEMF_TOTAL (1L << 19)
|
||||
#define MEMF_NO_EXPUNGE (1L << 31)
|
||||
#endif /* MEMF_ANY */
|
|
@ -1,63 +0,0 @@
|
|||
--- binutils-2.14/bfd/linker.c 2003-03-31 20:13:25.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/linker.c 2013-04-24 18:38:23.000000000 +0200
|
||||
@@ -431,7 +431,8 @@
|
||||
static bfd_boolean default_data_link_order
|
||||
PARAMS ((bfd *, struct bfd_link_info *, asection *,
|
||||
struct bfd_link_order *));
|
||||
-static bfd_boolean default_indirect_link_order
|
||||
+/*Amiga hack - used in amigaoslink.c so must be global */
|
||||
+/*static*/ bfd_boolean default_indirect_link_order
|
||||
PARAMS ((bfd *, struct bfd_link_info *, asection *,
|
||||
struct bfd_link_order *, bfd_boolean));
|
||||
|
||||
@@ -1246,6 +1247,13 @@
|
||||
h->u.c.size = size;
|
||||
|
||||
power = bfd_log2 (size);
|
||||
+ /* For the amiga, we don't want an alignment bigger than 2**2.
|
||||
+ Doing this here is horrible kludgy, but IMHO the maximal
|
||||
+ power alignment really should be target-dependant so that
|
||||
+ we wouldn't have to do this -- daniel */
|
||||
+ if (info->hash->creator->flavour == bfd_target_amiga_flavour
|
||||
+ && power > 2)
|
||||
+ power = 2;
|
||||
if (power > 4)
|
||||
power = 4;
|
||||
h->u.c.p->alignment_power = power;
|
||||
@@ -1708,6 +1716,13 @@
|
||||
unsigned int power;
|
||||
|
||||
power = bfd_log2 (value);
|
||||
+ /* For the amiga, we don't want an alignment bigger than 2**2.
|
||||
+ Doing this here is horrible kludgy, but IMHO the maximal
|
||||
+ power alignment really should be target-dependant so that
|
||||
+ we wouldn't have to do this -- daniel */
|
||||
+ if (info->hash->creator->flavour == bfd_target_amiga_flavour
|
||||
+ && power > 2)
|
||||
+ power = 2;
|
||||
if (power > 4)
|
||||
power = 4;
|
||||
h->u.c.p->alignment_power = power;
|
||||
@@ -1763,6 +1778,13 @@
|
||||
/* Select a default alignment based on the size. This may
|
||||
be overridden by the caller. */
|
||||
power = bfd_log2 (value);
|
||||
+ /* For the amiga, we don't want an alignment bigger than 2**2.
|
||||
+ Doing this here is horrible kludgy, but IMHO the maximal
|
||||
+ power alignment really should be target-dependant so that
|
||||
+ we wouldn't have to do this -- daniel */
|
||||
+ if (info->hash->creator->flavour == bfd_target_amiga_flavour
|
||||
+ && power > 2)
|
||||
+ power = 2;
|
||||
if (power > 4)
|
||||
power = 4;
|
||||
h->u.c.p->alignment_power = power;
|
||||
@@ -2739,7 +2761,7 @@
|
||||
|
||||
/* Default routine to handle a bfd_indirect_link_order. */
|
||||
|
||||
-static bfd_boolean
|
||||
+/*static*/ bfd_boolean
|
||||
default_indirect_link_order (output_bfd, info, output_section, link_order,
|
||||
generic_linker)
|
||||
bfd *output_bfd;
|
|
@ -1,28 +0,0 @@
|
|||
--- binutils-2.14/bfd/targets.c 2003-04-01 17:50:27.000000000 +0200
|
||||
+++ binutils-2.14-patched/bfd/targets.c 2013-04-24 18:38:23.000000000 +0200
|
||||
@@ -138,6 +138,7 @@
|
||||
.enum bfd_flavour
|
||||
.{
|
||||
. bfd_target_unknown_flavour,
|
||||
+. bfd_target_amiga_flavour,
|
||||
. bfd_target_aout_flavour,
|
||||
. bfd_target_coff_flavour,
|
||||
. bfd_target_ecoff_flavour,
|
||||
@@ -488,6 +489,8 @@
|
||||
extern const bfd_target a29kcoff_big_vec;
|
||||
extern const bfd_target a_out_adobe_vec;
|
||||
extern const bfd_target aix5coff64_vec;
|
||||
+extern const bfd_target amiga_vec;
|
||||
+extern const bfd_target aout_amiga_vec;
|
||||
extern const bfd_target aout0_big_vec;
|
||||
extern const bfd_target aout_arm_big_vec;
|
||||
extern const bfd_target aout_arm_little_vec;
|
||||
@@ -763,6 +769,8 @@
|
||||
#ifdef BFD64
|
||||
&aix5coff64_vec,
|
||||
#endif
|
||||
+ &amiga_vec,
|
||||
+ &aout_amiga_vec,
|
||||
&aout0_big_vec,
|
||||
#if 0
|
||||
/* We have no way of distinguishing these from other a.out variants. */
|
|
@ -1,13 +0,0 @@
|
|||
--- binutils-2.14/binutils/objcopy.c 2003-06-02 22:35:15.000000000 +0200
|
||||
+++ binutils-2.14-patched/binutils/objcopy.c 2013-04-24 18:38:17.000000000 +0200
|
||||
@@ -1843,7 +1848,9 @@
|
||||
if (relcount < 0)
|
||||
RETURN_NONFATAL (bfd_get_filename (ibfd));
|
||||
|
||||
- if (strip_symbols == STRIP_ALL)
|
||||
+ /* Never, ever, strip reloc data on the Amiga! */
|
||||
+ if (strip_symbols == STRIP_ALL &&
|
||||
+ bfd_get_flavour(obfd) != bfd_target_amiga_flavour)
|
||||
{
|
||||
/* Remove relocations which are not in
|
||||
keep_strip_specific_list. */
|
|
@ -1,72 +0,0 @@
|
|||
--- binutils-2.14/gas/Makefile.am 2003-04-24 14:47:31.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/Makefile.am 2013-04-24 18:38:14.000000000 +0200
|
||||
@@ -93,6 +93,7 @@
|
||||
# We deliberately omit SOM, since it does not work as a cross assembler.
|
||||
|
||||
OBJ_FORMATS = \
|
||||
+ amigahunk \
|
||||
aout \
|
||||
bout \
|
||||
coff \
|
||||
@@ -337,6 +338,7 @@
|
||||
# OBJ files in config
|
||||
|
||||
OBJ_FORMAT_CFILES = \
|
||||
+ config/obj-amigahunk.c \
|
||||
config/obj-aout.c \
|
||||
config/obj-bout.c \
|
||||
config/obj-coff.c \
|
||||
@@ -349,6 +351,7 @@
|
||||
config/obj-vms.c
|
||||
|
||||
OBJ_FORMAT_HFILES = \
|
||||
+ config/obj-amigahunk.h \
|
||||
config/obj-aout.h \
|
||||
config/obj-bout.h \
|
||||
config/obj-coff.h \
|
||||
@@ -364,6 +367,7 @@
|
||||
|
||||
TARG_ENV_HFILES = \
|
||||
config/te-386bsd.h \
|
||||
+ config/te-amiga.h \
|
||||
config/te-aux.h \
|
||||
config/te-delta.h \
|
||||
config/te-delt88.h \
|
||||
@@ -566,6 +570,8 @@
|
||||
# We need all these explicit rules for the multi stuff. Because of
|
||||
# these rules, we don't need one for OBJ_FORMAT_O.
|
||||
|
||||
+obj-amigahunk.o : $(srcdir)/config/obj-amigahunk.c
|
||||
+ $(COMPILE) -c $(srcdir)/config/obj-amigahunk.c
|
||||
obj-aout.o : $(srcdir)/config/obj-aout.c
|
||||
$(COMPILE) -c $(srcdir)/config/obj-aout.c
|
||||
obj-bout.o : $(srcdir)/config/obj-bout.c
|
||||
@@ -1215,6 +1221,9 @@
|
||||
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
|
||||
$(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \
|
||||
$(INCDIR)/elf/reloc-macros.h
|
||||
+DEPTC_m68k_amigaoshunk = $(INCDIR)/symcat.h $(srcdir)/config/obj-amigahunk.h \
|
||||
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h \
|
||||
+ $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
|
||||
DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
|
||||
$(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \
|
||||
@@ -1764,6 +1773,9 @@
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \
|
||||
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
|
||||
struc-symbol.h $(INCDIR)/aout/aout64.h
|
||||
+DEPOBJ_m68k_amigaoshunk = $(INCDIR)/symcat.h $(srcdir)/config/obj-amigahunk.h \
|
||||
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h \
|
||||
+ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
|
||||
DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
|
||||
$(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
|
||||
@@ -2202,6 +2214,8 @@
|
||||
DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
|
||||
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h
|
||||
+DEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h \
|
||||
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h
|
||||
DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
|
||||
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
|
||||
DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
|
|
@ -1,75 +0,0 @@
|
|||
--- binutils-2.14/gas/Makefile.in 2003-04-24 14:47:32.000000000 +0200
|
||||
+++ binutils-2.14/gas/Makefile.in 2013-05-18 12:00:58.000000000 +0200
|
||||
@@ -205,6 +205,7 @@
|
||||
# We deliberately omit SOM, since it does not work as a cross assembler.
|
||||
|
||||
OBJ_FORMATS = \
|
||||
+ amigahunk \
|
||||
aout \
|
||||
bout \
|
||||
coff \
|
||||
@@ -456,6 +457,7 @@
|
||||
# OBJ files in config
|
||||
|
||||
OBJ_FORMAT_CFILES = \
|
||||
+ config/obj-amigahunk.c \
|
||||
config/obj-aout.c \
|
||||
config/obj-bout.c \
|
||||
config/obj-coff.c \
|
||||
@@ -469,6 +471,7 @@
|
||||
|
||||
|
||||
OBJ_FORMAT_HFILES = \
|
||||
+ config/obj-amigahunk.h \
|
||||
config/obj-aout.h \
|
||||
config/obj-bout.h \
|
||||
config/obj-coff.h \
|
||||
@@ -485,6 +488,7 @@
|
||||
|
||||
TARG_ENV_HFILES = \
|
||||
config/te-386bsd.h \
|
||||
+ config/te-amiga.h \
|
||||
config/te-aux.h \
|
||||
config/te-delta.h \
|
||||
config/te-delt88.h \
|
||||
@@ -964,6 +968,10 @@
|
||||
$(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \
|
||||
$(INCDIR)/elf/reloc-macros.h
|
||||
|
||||
+DEPTC_m68k_amigaoshunk = $(INCDIR)/symcat.h $(srcdir)/config/obj-amigahunk.h \
|
||||
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h \
|
||||
+ $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
|
||||
+
|
||||
DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
|
||||
$(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \
|
||||
@@ -1631,6 +1639,10 @@
|
||||
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
|
||||
struc-symbol.h $(INCDIR)/aout/aout64.h
|
||||
|
||||
+DEPOBJ_m68k_amigaoshunk = $(INCDIR)/symcat.h $(srcdir)/config/obj-amigahunk.h \
|
||||
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h \
|
||||
+ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
|
||||
+
|
||||
DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
|
||||
$(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
|
||||
@@ -2185,6 +2197,9 @@
|
||||
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h
|
||||
|
||||
+DEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h \
|
||||
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h
|
||||
+
|
||||
DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
|
||||
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
|
||||
|
||||
@@ -2940,6 +2955,8 @@
|
||||
# We need all these explicit rules for the multi stuff. Because of
|
||||
# these rules, we don't need one for OBJ_FORMAT_O.
|
||||
|
||||
+obj-amigahunk.o : $(srcdir)/config/obj-amigahunk.c
|
||||
+ $(COMPILE) -c $(srcdir)/config/obj-amigahunk.c
|
||||
obj-aout.o : $(srcdir)/config/obj-aout.c
|
||||
$(COMPILE) -c $(srcdir)/config/obj-aout.c
|
||||
obj-bout.o : $(srcdir)/config/obj-bout.c
|
|
@ -1,89 +0,0 @@
|
|||
--- binutils-2.14/gas/app.c 2003-05-02 19:06:16.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/app.c 2013-05-22 16:18:19.000000000 +0200
|
||||
@@ -351,6 +345,8 @@
|
||||
char *fromend;
|
||||
int fromlen;
|
||||
register int ch, ch2 = 0;
|
||||
+ /* Character that started the string we're working on. */
|
||||
+ static char quotechar;
|
||||
|
||||
/*State 0: beginning of normal line
|
||||
1: After first whitespace on line (flush more white)
|
||||
@@ -536,11 +538,8 @@
|
||||
for (s = from; s < fromend; s++)
|
||||
{
|
||||
ch = *s;
|
||||
- /* This condition must be changed if the type of any
|
||||
- other character can be LEX_IS_STRINGQUOTE. */
|
||||
if (ch == '\\'
|
||||
- || ch == '"'
|
||||
- || ch == '\''
|
||||
+ || ch == quotechar
|
||||
|| ch == '\n')
|
||||
break;
|
||||
}
|
||||
@@ -558,12 +557,12 @@
|
||||
ch = GET ();
|
||||
if (ch == EOF)
|
||||
{
|
||||
- as_warn (_("end of file in string; inserted '\"'"));
|
||||
+ as_warn (_("end of file in string; '%c' inserted"), quotechar);
|
||||
state = old_state;
|
||||
UNGET ('\n');
|
||||
- PUT ('"');
|
||||
+ PUT (quotechar);
|
||||
}
|
||||
- else if (lex[ch] == LEX_IS_STRINGQUOTE)
|
||||
+ else if (ch == quotechar)
|
||||
{
|
||||
state = old_state;
|
||||
PUT (ch);
|
||||
@@ -603,8 +602,8 @@
|
||||
continue;
|
||||
|
||||
case EOF:
|
||||
- as_warn (_("end of file in string; '\"' inserted"));
|
||||
- PUT ('"');
|
||||
+ as_warn (_("end of file in string; '%c' inserted"), quotechar);
|
||||
+ PUT (quotechar);
|
||||
continue;
|
||||
|
||||
case '"':
|
||||
@@ -638,10 +637,9 @@
|
||||
|
||||
case 7:
|
||||
ch = GET ();
|
||||
+ quotechar = ch;
|
||||
state = 5;
|
||||
old_state = 8;
|
||||
- if (ch == EOF)
|
||||
- goto fromeof;
|
||||
PUT (ch);
|
||||
continue;
|
||||
|
||||
@@ -952,6 +973,7 @@
|
||||
break;
|
||||
|
||||
case LEX_IS_STRINGQUOTE:
|
||||
+ quotechar = ch;
|
||||
if (state == 10)
|
||||
{
|
||||
/* Preserve the whitespace in foo "bar". */
|
||||
@@ -1279,6 +1301,8 @@
|
||||
case 1: *to++ = *from++;
|
||||
}
|
||||
}
|
||||
+ if (to >= toend)
|
||||
+ goto tofull;
|
||||
ch = GET ();
|
||||
}
|
||||
}
|
||||
@@ -1297,7 +1321,7 @@
|
||||
}
|
||||
else if (state == 9)
|
||||
{
|
||||
- if (lex[ch] != LEX_IS_SYMBOL_COMPONENT)
|
||||
+ if (!IS_SYMBOL_COMPONENT (ch))
|
||||
state = 3;
|
||||
}
|
||||
else if (state == 10)
|
|
@ -1,36 +0,0 @@
|
|||
--- binutils-2.14/gas/as.c 2003-04-08 14:47:07.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/as.c 2013-04-24 18:38:14.000000000 +0200
|
||||
@@ -88,6 +88,9 @@
|
||||
#ifdef BFD_ASSEMBLER
|
||||
segT reg_section, expr_section;
|
||||
segT text_section, data_section, bss_section;
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+segT data_chip_section, bss_chip_section;
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
/* The default obstack chunk size. If we set this to zero, the
|
||||
@@ -1044,6 +1047,10 @@
|
||||
text_section = subseg_new (TEXT_SECTION_NAME, 0);
|
||||
data_section = subseg_new (DATA_SECTION_NAME, 0);
|
||||
bss_section = subseg_new (BSS_SECTION_NAME, 0);
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+ data_chip_section = subseg_new (".data_chip", 0);
|
||||
+ bss_chip_section = subseg_new (".bss_chip", 0);
|
||||
+#endif
|
||||
/* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
|
||||
to have relocs, otherwise we don't find out in time. */
|
||||
applicable = bfd_applicable_section_flags (stdoutput);
|
||||
@@ -1054,6 +1061,12 @@
|
||||
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
|
||||
| SEC_DATA));
|
||||
bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC);
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+ bfd_set_section_flags (stdoutput, data_chip_section,
|
||||
+ applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
|
||||
+ bfd_set_section_flags (stdoutput, bss_chip_section, applicable & SEC_ALLOC);
|
||||
+#endif
|
||||
+
|
||||
seg_info (bss_section)->bss = 1;
|
||||
subseg_new (BFD_ABS_SECTION_NAME, 0);
|
||||
subseg_new (BFD_UND_SECTION_NAME, 0);
|
|
@ -1,25 +0,0 @@
|
|||
--- binutils-2.14/gas/as.h 2003-01-24 02:12:30.000000000 +0100
|
||||
+++ binutils-2.14-patched/gas/as.h 2013-04-24 18:38:14.000000000 +0200
|
||||
@@ -397,6 +397,22 @@
|
||||
/* Enough bits for address, but still an integer type.
|
||||
Could be a problem, cross-assembling for 64-bit machines. */
|
||||
typedef addressT relax_addressT;
|
||||
+
|
||||
+struct relax_type
|
||||
+{
|
||||
+ /* Forward reach. Signed number. > 0. */
|
||||
+ long rlx_forward;
|
||||
+ /* Backward reach. Signed number. < 0. */
|
||||
+ long rlx_backward;
|
||||
+
|
||||
+ /* Bytes length of this address. */
|
||||
+ unsigned char rlx_length;
|
||||
+
|
||||
+ /* Next longer relax-state. 0 means there is no 'next' relax-state. */
|
||||
+ relax_substateT rlx_more;
|
||||
+};
|
||||
+
|
||||
+typedef struct relax_type relax_typeS;
|
||||
|
||||
/* main program "as.c" (command arguments etc) */
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils-2.14/gas/config/m68k-parse.h 2001-03-09 00:24:22.000000000 +0100
|
||||
+++ binutils-2.14-patched/gas/config/m68k-parse.h 2013-04-24 18:38:13.000000000 +0200
|
||||
@@ -267,6 +267,9 @@
|
||||
|
||||
/* The expression itself. */
|
||||
expressionS exp;
|
||||
+
|
||||
+ /* base-relative? */
|
||||
+ short baserel;
|
||||
};
|
||||
|
||||
/* The operand modes. */
|
|
@ -1,35 +0,0 @@
|
|||
--- binutils-2.14/gas/config/m68k-parse.y 2001-09-19 07:33:21.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/config/m68k-parse.y 2013-04-24 18:38:13.000000000 +0200
|
||||
@@ -946,6 +946,7 @@
|
||||
}
|
||||
|
||||
yylval.exp.size = SIZE_UNSPEC;
|
||||
+ yylval.exp.baserel = 0;
|
||||
if (s <= str + 2
|
||||
|| (s[-2] != '.' && s[-2] != ':'))
|
||||
tail = 0;
|
||||
@@ -953,18 +954,21 @@
|
||||
{
|
||||
switch (s[-1])
|
||||
{
|
||||
+ case 'B':
|
||||
+ yylval.exp.baserel = 1;
|
||||
case 's':
|
||||
case 'S':
|
||||
case 'b':
|
||||
- case 'B':
|
||||
yylval.exp.size = SIZE_BYTE;
|
||||
break;
|
||||
- case 'w':
|
||||
case 'W':
|
||||
+ yylval.exp.baserel = 1;
|
||||
+ case 'w':
|
||||
yylval.exp.size = SIZE_WORD;
|
||||
break;
|
||||
- case 'l':
|
||||
case 'L':
|
||||
+ yylval.exp.baserel = 1;
|
||||
+ case 'l':
|
||||
yylval.exp.size = SIZE_LONG;
|
||||
break;
|
||||
default:
|
|
@ -1,212 +0,0 @@
|
|||
/* AmigaOS object file format
|
||||
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
GAS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
GAS is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GAS; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#include "as.h"
|
||||
|
||||
enum {
|
||||
N_UNDF=0,
|
||||
/*N_ABS=2,*/
|
||||
/*N_TEXT=4,*/
|
||||
/*N_DATA=6,*/
|
||||
/*N_BSS=8,*/
|
||||
N_INDR=0xa,
|
||||
/*N_COMM=0x12,*/
|
||||
N_SETA=0x14,
|
||||
N_SETT=0x16,
|
||||
N_SETD=0x18,
|
||||
N_SETB=0x1a,
|
||||
/*N_SETV=0x1c,*/
|
||||
N_WARNING=0x1e,
|
||||
/*N_FN=0x1f*/
|
||||
N_EXT=1,
|
||||
N_TYPE=0x1e,
|
||||
/*N_STAB=0xe0,*/
|
||||
};
|
||||
|
||||
static void obj_amiga_line PARAMS ((int));
|
||||
static void obj_amiga_weak PARAMS ((int));
|
||||
|
||||
const pseudo_typeS obj_pseudo_table[] =
|
||||
{
|
||||
{"line", obj_amiga_line, 0}, /* source code line number */
|
||||
{"weak", obj_amiga_weak, 0}, /* mark symbol as weak. */
|
||||
|
||||
/* other stuff */
|
||||
{"ABORT", s_abort, 0},
|
||||
|
||||
{NULL, NULL, 0} /* end sentinel */
|
||||
};
|
||||
|
||||
#ifdef BFD_ASSEMBLER
|
||||
|
||||
void
|
||||
obj_amiga_frob_symbol (sym, punt)
|
||||
symbolS *sym;
|
||||
int *punt ATTRIBUTE_UNUSED;
|
||||
{
|
||||
sec_ptr sec = S_GET_SEGMENT (sym);
|
||||
unsigned int type = amiga_symbol (symbol_get_bfdsym (sym))->type;
|
||||
|
||||
/* Only frob simple symbols this way right now. */
|
||||
if (! (type & ~ (N_TYPE | N_EXT)))
|
||||
{
|
||||
if (type == (N_UNDF | N_EXT)
|
||||
&& sec == &bfd_abs_section)
|
||||
{
|
||||
sec = bfd_und_section_ptr;
|
||||
S_SET_SEGMENT (sym, sec);
|
||||
}
|
||||
|
||||
if ((type & N_TYPE) != N_INDR
|
||||
&& (type & N_TYPE) != N_SETA
|
||||
&& (type & N_TYPE) != N_SETT
|
||||
&& (type & N_TYPE) != N_SETD
|
||||
&& (type & N_TYPE) != N_SETB
|
||||
&& type != N_WARNING
|
||||
&& (sec == &bfd_abs_section
|
||||
|| sec == &bfd_und_section))
|
||||
return;
|
||||
if (symbol_get_bfdsym (sym)->flags & BSF_EXPORT)
|
||||
type |= N_EXT;
|
||||
|
||||
switch (type & N_TYPE)
|
||||
{
|
||||
case N_SETA:
|
||||
case N_SETT:
|
||||
case N_SETD:
|
||||
case N_SETB:
|
||||
/* Set the debugging flag for constructor symbols so that
|
||||
BFD leaves them alone. */
|
||||
symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
|
||||
|
||||
/* You can't put a common symbol in a set. The way a set
|
||||
element works is that the symbol has a definition and a
|
||||
name, and the linker adds the definition to the set of
|
||||
that name. That does not work for a common symbol,
|
||||
because the linker can't tell which common symbol the
|
||||
user means. FIXME: Using as_bad here may be
|
||||
inappropriate, since the user may want to force a
|
||||
particular type without regard to the semantics of sets;
|
||||
on the other hand, we certainly don't want anybody to be
|
||||
mislead into thinking that their code will work. */
|
||||
if (S_IS_COMMON (sym))
|
||||
as_bad (_("Attempt to put a common symbol into set %s"),
|
||||
S_GET_NAME (sym));
|
||||
/* Similarly, you can't put an undefined symbol in a set. */
|
||||
else if (! S_IS_DEFINED (sym))
|
||||
as_bad (_("Attempt to put an undefined symbol into set %s"),
|
||||
S_GET_NAME (sym));
|
||||
|
||||
break;
|
||||
case N_INDR:
|
||||
/* Put indirect symbols in the indirect section. */
|
||||
S_SET_SEGMENT (sym, bfd_ind_section_ptr);
|
||||
symbol_get_bfdsym (sym)->flags |= BSF_INDIRECT;
|
||||
if (type & N_EXT)
|
||||
{
|
||||
symbol_get_bfdsym (sym)->flags |= BSF_EXPORT;
|
||||
symbol_get_bfdsym (sym)->flags &=~ BSF_LOCAL;
|
||||
}
|
||||
break;
|
||||
case N_WARNING:
|
||||
/* Mark warning symbols. */
|
||||
symbol_get_bfdsym (sym)->flags |= BSF_WARNING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
|
||||
}
|
||||
|
||||
amiga_symbol (symbol_get_bfdsym (sym))->type = type;
|
||||
|
||||
/* Double check weak symbols. */
|
||||
if (S_IS_WEAK (sym))
|
||||
{
|
||||
if (S_IS_COMMON (sym))
|
||||
as_bad (_("Symbol `%s' can not be both weak and common"),
|
||||
S_GET_NAME (sym));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
obj_amiga_frob_file_before_fix ()
|
||||
{
|
||||
/* Relocation processing may require knowing the VMAs of the sections.
|
||||
Since writing to a section will cause the BFD back end to compute the
|
||||
VMAs, fake it out here.... */
|
||||
bfd_byte b = 0;
|
||||
bfd_boolean x = TRUE;
|
||||
if (bfd_section_size (stdoutput, text_section) != 0)
|
||||
{
|
||||
x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0,
|
||||
(bfd_size_type) 1);
|
||||
}
|
||||
else if (bfd_section_size (stdoutput, data_section) != 0)
|
||||
{
|
||||
x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
|
||||
(bfd_size_type) 1);
|
||||
}
|
||||
assert (x);
|
||||
}
|
||||
|
||||
#endif /* BFD_ASSEMBLER */
|
||||
|
||||
static void
|
||||
obj_amiga_line (ignore)
|
||||
int ignore ATTRIBUTE_UNUSED;
|
||||
{
|
||||
/* Assume delimiter is part of expression.
|
||||
BSD4.2 as fails with delightful bug, so we
|
||||
are not being incompatible here. */
|
||||
new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
|
||||
demand_empty_rest_of_line ();
|
||||
} /* obj_amiga_line() */
|
||||
|
||||
/* Handle .weak. This is a GNU extension. */
|
||||
|
||||
static void
|
||||
obj_amiga_weak (ignore)
|
||||
int ignore ATTRIBUTE_UNUSED;
|
||||
{
|
||||
char *name;
|
||||
int c;
|
||||
symbolS *symbolP;
|
||||
|
||||
do
|
||||
{
|
||||
name = input_line_pointer;
|
||||
c = get_symbol_end ();
|
||||
symbolP = symbol_find_or_make (name);
|
||||
*input_line_pointer = c;
|
||||
SKIP_WHITESPACE ();
|
||||
S_SET_WEAK (symbolP);
|
||||
if (c == ',')
|
||||
{
|
||||
input_line_pointer++;
|
||||
SKIP_WHITESPACE ();
|
||||
if (*input_line_pointer == '\n')
|
||||
c = '\n';
|
||||
}
|
||||
}
|
||||
while (c == ',');
|
||||
demand_empty_rest_of_line ();
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/* obj-amigahunk.h, AmigaOS object file format for gas, the assembler.
|
||||
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
GAS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
GAS is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GAS; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* Tag to validate an amiga object file format processing */
|
||||
#define OBJ_AMIGAHUNK 1
|
||||
|
||||
#include "targ-cpu.h"
|
||||
|
||||
#ifdef BFD_ASSEMBLER
|
||||
|
||||
#include "bfd/libamiga.h"
|
||||
|
||||
#define OUTPUT_FLAVOR bfd_target_amiga_flavour
|
||||
|
||||
/* SYMBOL TABLE */
|
||||
/* Symbol table macros and constants */
|
||||
|
||||
#define S_SET_OTHER(S,V) (amiga_symbol (symbol_get_bfdsym (S))->other = (V))
|
||||
#define S_SET_TYPE(S,T) (amiga_symbol (symbol_get_bfdsym (S))->type = (T))
|
||||
#define S_SET_DESC(S,D) (amiga_symbol (symbol_get_bfdsym (S))->desc = (D))
|
||||
#define S_GET_TYPE(S) (amiga_symbol (symbol_get_bfdsym (S))->type)
|
||||
|
||||
#define obj_frob_symbol(S,PUNT) obj_amiga_frob_symbol (S, &PUNT)
|
||||
extern void obj_amiga_frob_symbol PARAMS ((symbolS *, int *));
|
||||
|
||||
#define obj_frob_file_before_fix() obj_amiga_frob_file_before_fix ()
|
||||
extern void obj_amiga_frob_file_before_fix PARAMS ((void));
|
||||
|
||||
#define obj_sec_sym_ok_for_reloc(SEC) (1)
|
||||
|
||||
#endif /* BFD_ASSEMBLER */
|
||||
|
||||
#define obj_read_begin_hook() {;}
|
||||
#define obj_symbol_new_hook(s) {;}
|
||||
#define EMIT_SECTION_SYMBOLS (0)
|
||||
|
||||
#define AOUT_STABS
|
|
@ -1,688 +0,0 @@
|
|||
--- binutils-2.14/gas/config/tc-m68k.c 2002-12-12 23:16:16.000000000 +0100
|
||||
+++ binutils-2.14-patched/gas/config/tc-m68k.c 2013-04-24 18:38:13.000000000 +0200
|
||||
@@ -33,6 +33,16 @@
|
||||
#include "elf/m68k.h"
|
||||
#endif
|
||||
|
||||
+/* FIXME: delete this #define as soon as the code that references
|
||||
+ N_TEXT is changed */
|
||||
+#ifdef BFD_ASSEMBLER
|
||||
+#define N_TEXT 4
|
||||
+#endif
|
||||
+
|
||||
+#ifndef OBJ_AMIGAHUNK
|
||||
+#define OBJ_AMIGAHUNK 0
|
||||
+#endif
|
||||
+
|
||||
/* This string holds the chars that always start a comment. If the
|
||||
pre-processor is disabled, these aren't very useful. The macro
|
||||
tc_comment_chars points to this. We use this, rather than the
|
||||
@@ -77,6 +87,7 @@
|
||||
static int flag_short_refs; /* -l option */
|
||||
static int flag_long_jumps; /* -S option */
|
||||
static int flag_keep_pcrel; /* --pcrel option. */
|
||||
+static int flag_small_code; /* -sc option */
|
||||
|
||||
#ifdef REGISTER_PREFIX_OPTIONAL
|
||||
int flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
|
||||
@@ -221,6 +232,7 @@
|
||||
so, which. */
|
||||
enum pic_relocation pic_reloc;
|
||||
#endif
|
||||
+ char baserel;
|
||||
}
|
||||
reloc[5]; /* Five is enough??? */
|
||||
};
|
||||
@@ -247,7 +259,7 @@
|
||||
/* Static functions. */
|
||||
|
||||
static void insop PARAMS ((int, const struct m68k_incant *));
|
||||
-static void add_fix PARAMS ((int, struct m68k_exp *, int, int));
|
||||
+static void add_fix PARAMS ((int, struct m68k_exp *, int, int, int));
|
||||
static void add_frag PARAMS ((symbolS *, offsetT, int));
|
||||
|
||||
/* Like addword, but goes BEFORE general operands */
|
||||
@@ -270,11 +282,12 @@
|
||||
/* The numo+1 kludge is so we can hit the low order byte of the prev word.
|
||||
Blecch. */
|
||||
static void
|
||||
-add_fix (width, exp, pc_rel, pc_fix)
|
||||
+add_fix (width, exp, pc_rel, pc_fix, base_rel)
|
||||
int width;
|
||||
struct m68k_exp *exp;
|
||||
int pc_rel;
|
||||
int pc_fix;
|
||||
+ int base_rel;
|
||||
{
|
||||
the_ins.reloc[the_ins.nrel].n = ((width == 'B' || width == '3')
|
||||
? (the_ins.numo*2-1)
|
||||
@@ -287,7 +300,8 @@
|
||||
#ifdef OBJ_ELF
|
||||
the_ins.reloc[the_ins.nrel].pic_reloc = exp->pic_reloc;
|
||||
#endif
|
||||
- the_ins.reloc[the_ins.nrel++].pcrel = pc_rel;
|
||||
+ the_ins.reloc[the_ins.nrel].pcrel = pc_rel;
|
||||
+ the_ins.reloc[the_ins.nrel++].baserel = base_rel;
|
||||
}
|
||||
|
||||
/* Cause an extra frag to be generated here, inserting up to 10 bytes
|
||||
@@ -463,6 +477,18 @@
|
||||
#define PCINDEX 8 /* PC+displacement+index */
|
||||
#define ABSTOPCREL 9 /* absolute relax down to 16-bit PC-relative */
|
||||
|
||||
+/* ABSREL (nice name;-)) is used in small-code, it might be implemented
|
||||
+ * base-relative (a4), pc-relative, or base-relative with an extra add
|
||||
+ * instruction to add the base-register.
|
||||
+ *
|
||||
+ * IMMREL is the analogous mode for immediate addressing of variables. This
|
||||
+ * one can lead into situations, where a replacement is not possible:
|
||||
+ * addl #foo,a0
|
||||
+ * can't be made pc-relative, if foo is in the text segment. */
|
||||
+
|
||||
+#define ABSREL 10
|
||||
+#define IMMREL 11
|
||||
+
|
||||
/* Note that calls to frag_var need to specify the maximum expansion
|
||||
needed; this is currently 10 bytes for DBCC. */
|
||||
|
||||
@@ -524,6 +550,16 @@
|
||||
{ 32767, -32768, 2, TAB (ABSTOPCREL, LONG) },
|
||||
{ 0, 0, 4, 0 },
|
||||
{ 1, 1, 0, 0 },
|
||||
+
|
||||
+ { 127, -128, 0, 0 },
|
||||
+ { 32767, -32768, 2, TAB (ABSREL, LONG) },
|
||||
+ { 0, 0, 6, 0 },
|
||||
+ { 1, 1, 0, 0 },
|
||||
+
|
||||
+ { 127, -128, 0, 0 },
|
||||
+ { 32767, -32768, 2, TAB (IMMREL, LONG) },
|
||||
+ { 0, 0, 6, 0 },
|
||||
+ { 1, 1, 0, 0 },
|
||||
};
|
||||
|
||||
/* These are the machine dependent pseudo-ops. These are included so
|
||||
@@ -946,6 +982,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+ else if (fixp->tc_fix_data)
|
||||
+ {
|
||||
+ switch (fixp->fx_size)
|
||||
+ {
|
||||
+ case 1: code = BFD_RELOC_8_BASEREL; break;
|
||||
+ case 2: code = BFD_RELOC_16_BASEREL; break;
|
||||
+ case 4: code = BFD_RELOC_32_BASEREL; break;
|
||||
+ default:
|
||||
+ abort ();
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
{
|
||||
#define F(SZ,PCREL) (((SZ) << 1) + (PCREL))
|
||||
@@ -1937,7 +1984,18 @@
|
||||
else
|
||||
nextword = get_num (&opP->disp, 0);
|
||||
if (isvar (&opP->disp))
|
||||
- add_fix (s[1], &opP->disp, 0, 0);
|
||||
+ {
|
||||
+/* This doesn't work when the symbol is N_UNDF! We ignore this for now. */
|
||||
+ if (0 && flag_small_code)
|
||||
+ {
|
||||
+ add_frag (adds (&opP->disp),
|
||||
+ offs (&opP->disp),
|
||||
+ TAB (IMMREL, SZ_UNDEF));
|
||||
+ break;
|
||||
+ }
|
||||
+ else
|
||||
+ add_fix(s[1], &opP->disp, 0, 0, opP->disp.baserel);
|
||||
+ }
|
||||
switch (s[1])
|
||||
{
|
||||
case 'b':
|
||||
@@ -2097,7 +2155,7 @@
|
||||
)
|
||||
{
|
||||
addword (0x0170);
|
||||
- add_fix ('l', &opP->disp, 1, 2);
|
||||
+ add_fix ('l', &opP->disp, 1, 2, opP->disp.baserel);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2110,7 +2168,7 @@
|
||||
else
|
||||
{
|
||||
addword (0x0170);
|
||||
- add_fix ('l', &opP->disp, 0, 0);
|
||||
+ add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2128,10 +2186,10 @@
|
||||
{
|
||||
if (opP->reg == PC)
|
||||
{
|
||||
- add_fix ('w', &opP->disp, 1, 0);
|
||||
+ add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
|
||||
}
|
||||
else
|
||||
- add_fix ('w', &opP->disp, 0, 0);
|
||||
+ add_fix ('w', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
}
|
||||
}
|
||||
addword (nextword);
|
||||
@@ -2240,9 +2298,9 @@
|
||||
fit (possible on m68000) let the
|
||||
fixup processing complain later. */
|
||||
if (opP->reg == PC)
|
||||
- add_fix ('B', &opP->disp, 1, 1);
|
||||
+ add_fix ('B', &opP->disp, 1, 1, 0); /* FIXME? -fnf */
|
||||
else
|
||||
- add_fix ('B', &opP->disp, 0, 0);
|
||||
+ add_fix ('B', &opP->disp, 0, 0, 0); /* FIXME? -fnf */
|
||||
}
|
||||
else if (siz1 != SIZE_BYTE)
|
||||
{
|
||||
@@ -2372,9 +2430,9 @@
|
||||
if (siz1 != SIZE_UNSPEC && isvar (&opP->disp))
|
||||
{
|
||||
if (opP->reg == PC || opP->reg == ZPC)
|
||||
- add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 1, 2);
|
||||
+ add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 1, 2, opP->disp.baserel);
|
||||
else
|
||||
- add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 0, 0);
|
||||
+ add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
}
|
||||
if (siz1 == SIZE_LONG)
|
||||
addword (baseo >> 16);
|
||||
@@ -2382,7 +2440,7 @@
|
||||
addword (baseo);
|
||||
|
||||
if (siz2 != SIZE_UNSPEC && isvar (&opP->odisp))
|
||||
- add_fix (siz2 == SIZE_LONG ? 'l' : 'w', &opP->odisp, 0, 0);
|
||||
+ add_fix (siz2 == SIZE_LONG ? 'l' : 'w', &opP->odisp, 0, 0, opP->disp.baserel);
|
||||
if (siz2 == SIZE_LONG)
|
||||
addword (outro >> 16);
|
||||
if (siz2 != SIZE_UNSPEC)
|
||||
@@ -2422,8 +2480,17 @@
|
||||
}
|
||||
/* Fall through into long */
|
||||
case SIZE_LONG:
|
||||
+/* This doesn't work when the symbol is N_UNDF! We ignore this for now. */
|
||||
+ if (0 && flag_small_code)
|
||||
+ {
|
||||
+ tmpreg=0x3A; /* 7.2 */
|
||||
+ add_frag (adds (&opP->disp),
|
||||
+ offs (&opP->disp),
|
||||
+ TAB (ABSREL, SZ_UNDEF));
|
||||
+ break;
|
||||
+ }
|
||||
if (isvar (&opP->disp))
|
||||
- add_fix ('l', &opP->disp, 0, 0);
|
||||
+ add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
|
||||
tmpreg = 0x39;/* 7.1 mode */
|
||||
addword (nextword >> 16);
|
||||
@@ -2435,7 +2502,7 @@
|
||||
/* Fall through. */
|
||||
case SIZE_WORD: /* Word */
|
||||
if (isvar (&opP->disp))
|
||||
- add_fix ('w', &opP->disp, 0, 0);
|
||||
+ add_fix ('w', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
|
||||
tmpreg = 0x38;/* 7.0 mode */
|
||||
addword (nextword);
|
||||
@@ -2471,7 +2538,7 @@
|
||||
}
|
||||
tmpreg = get_num (&opP->disp, tmpreg);
|
||||
if (isvar (&opP->disp))
|
||||
- add_fix (s[1], &opP->disp, 0, 0);
|
||||
+ add_fix (s[1], &opP->disp, 0, 0, opP->disp.baserel);
|
||||
switch (s[1])
|
||||
{
|
||||
case 'b': /* Danger: These do no check for
|
||||
@@ -2537,10 +2604,10 @@
|
||||
switch (s[1])
|
||||
{
|
||||
case 'B':
|
||||
- add_fix ('B', &opP->disp, 1, -1);
|
||||
+ add_fix ('B', &opP->disp, 1, -1, opP->disp.baserel);
|
||||
break;
|
||||
case 'W':
|
||||
- add_fix ('w', &opP->disp, 1, 0);
|
||||
+ add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
|
||||
addword (0);
|
||||
break;
|
||||
case 'L':
|
||||
@@ -2548,7 +2615,7 @@
|
||||
if (! HAVE_LONG_BRANCH (current_architecture))
|
||||
as_warn (_("Can't use long branches on 68000/68010/5200"));
|
||||
the_ins.opcode[0] |= 0xff;
|
||||
- add_fix ('l', &opP->disp, 1, 0);
|
||||
+ add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
|
||||
addword (0);
|
||||
addword (0);
|
||||
break;
|
||||
@@ -2578,7 +2645,7 @@
|
||||
the_ins.opcode[0] |= 0x0006;
|
||||
addword (0x4EF9);
|
||||
}
|
||||
- add_fix ('l', &opP->disp, 0, 0);
|
||||
+ add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
addword (0);
|
||||
addword (0);
|
||||
break;
|
||||
@@ -2622,12 +2689,12 @@
|
||||
TAB (DBCCABSJ, SZ_UNDEF));
|
||||
break;
|
||||
}
|
||||
- add_fix ('w', &opP->disp, 1, 0);
|
||||
+ add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
|
||||
}
|
||||
addword (0);
|
||||
break;
|
||||
case 'C': /* Fixed size LONG coproc branches */
|
||||
- add_fix ('l', &opP->disp, 1, 0);
|
||||
+ add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
|
||||
addword (0);
|
||||
addword (0);
|
||||
break;
|
||||
@@ -2635,7 +2702,7 @@
|
||||
if (subs (&opP->disp) || (adds (&opP->disp) == 0))
|
||||
{
|
||||
the_ins.opcode[the_ins.numo - 1] |= 0x40;
|
||||
- add_fix ('l', &opP->disp, 1, 0);
|
||||
+ add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
|
||||
addword (0);
|
||||
addword (0);
|
||||
}
|
||||
@@ -2999,7 +3066,7 @@
|
||||
break;
|
||||
case '_': /* used only for move16 absolute 32-bit address */
|
||||
if (isvar (&opP->disp))
|
||||
- add_fix ('l', &opP->disp, 0, 0);
|
||||
+ add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
|
||||
tmpreg = get_num (&opP->disp, 80);
|
||||
addword (tmpreg >> 16);
|
||||
addword (tmpreg & 0xFFFF);
|
||||
@@ -3318,6 +3385,12 @@
|
||||
int number;
|
||||
};
|
||||
|
||||
+#if defined(TE_AMIGA)
|
||||
+ #define FRAME ADDR5
|
||||
+#else
|
||||
+ #define FRAME ADDR6
|
||||
+#endif
|
||||
+
|
||||
static const struct init_entry init_table[] =
|
||||
{
|
||||
{ "d0", DATA0 },
|
||||
@@ -3335,7 +3408,7 @@
|
||||
{ "a4", ADDR4 },
|
||||
{ "a5", ADDR5 },
|
||||
{ "a6", ADDR6 },
|
||||
- { "fp", ADDR6 },
|
||||
+ { "fp", FRAME },
|
||||
{ "a7", ADDR7 },
|
||||
{ "sp", ADDR7 },
|
||||
{ "ssp", ADDR7 },
|
||||
@@ -3657,7 +3730,8 @@
|
||||
&the_ins.reloc[m].exp,
|
||||
the_ins.reloc[m].pcrel,
|
||||
get_reloc_code (n, the_ins.reloc[m].pcrel,
|
||||
- the_ins.reloc[m].pic_reloc));
|
||||
+ the_ins.reloc[m].pic_reloc),
|
||||
+ the_ins.reloc[m].baserel);
|
||||
fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
|
||||
if (the_ins.reloc[m].wid == 'B')
|
||||
fixP->fx_signed = 1;
|
||||
@@ -3719,7 +3793,8 @@
|
||||
&the_ins.reloc[m].exp,
|
||||
the_ins.reloc[m].pcrel,
|
||||
get_reloc_code (wid, the_ins.reloc[m].pcrel,
|
||||
- the_ins.reloc[m].pic_reloc));
|
||||
+ the_ins.reloc[m].pic_reloc),
|
||||
+ the_ins.reloc[m].baserel);
|
||||
fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
|
||||
}
|
||||
(void) frag_var (rs_machine_dependent, 10, 0,
|
||||
@@ -3756,7 +3831,8 @@
|
||||
&the_ins.reloc[m].exp,
|
||||
the_ins.reloc[m].pcrel,
|
||||
get_reloc_code (wid, the_ins.reloc[m].pcrel,
|
||||
- the_ins.reloc[m].pic_reloc));
|
||||
+ the_ins.reloc[m].pic_reloc),
|
||||
+ the_ins.reloc[m].baserel);
|
||||
fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
|
||||
}
|
||||
}
|
||||
@@ -4363,7 +4439,7 @@
|
||||
as_bad_where (fragP->fr_file, fragP->fr_line,
|
||||
_("short branch with zero offset: use :w"));
|
||||
fixP = fix_new (fragP, fragP->fr_fix - 1, 1, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 1, RELAX_RELOC_PC8);
|
||||
+ fragP->fr_offset, 1, RELAX_RELOC_PC8, 0);
|
||||
fixP->fx_pcrel_adjust = -1;
|
||||
break;
|
||||
case TAB (BRANCHBWL, SHORT):
|
||||
@@ -4372,22 +4448,26 @@
|
||||
case TAB (BRANCHBW, SHORT):
|
||||
fragP->fr_opcode[1] = 0x00;
|
||||
fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 1, RELAX_RELOC_PC16);
|
||||
+ 1, RELAX_RELOC_PC16, 0);
|
||||
fragP->fr_fix += 2;
|
||||
break;
|
||||
case TAB (BRANCHBWL, LONG):
|
||||
fragP->fr_opcode[1] = (char) 0xFF;
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 1, RELAX_RELOC_PC32);
|
||||
+ 1, RELAX_RELOC_PC32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
case TAB (BRABSJUNC, LONG):
|
||||
- if (fragP->fr_opcode[0] == 0x61) /* jbsr */
|
||||
+ if (flag_small_code)
|
||||
+ {
|
||||
+ as_bad (_("Long branch in small code model, not supported."));
|
||||
+ }
|
||||
+ else if (fragP->fr_opcode[0] == 0x61) /* jbsr */
|
||||
{
|
||||
fragP->fr_opcode[0] = 0x4E;
|
||||
fragP->fr_opcode[1] = (char) 0xB9; /* JSR with ABSL LONG operand */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 0, RELAX_RELOC_ABS32);
|
||||
+ 0, RELAX_RELOC_ABS32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
}
|
||||
else if (fragP->fr_opcode[0] == 0x60) /* jbra */
|
||||
@@ -4395,7 +4475,7 @@
|
||||
fragP->fr_opcode[0] = 0x4E;
|
||||
fragP->fr_opcode[1] = (char) 0xF9; /* JMP with ABSL LONG operand */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 0, RELAX_RELOC_ABS32);
|
||||
+ 0, RELAX_RELOC_ABS32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
}
|
||||
else
|
||||
@@ -4419,25 +4499,25 @@
|
||||
*buffer_address++ = (char) 0xf9;
|
||||
fragP->fr_fix += 2; /* account for jmp instruction */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 0, RELAX_RELOC_ABS32);
|
||||
+ fragP->fr_offset, 0, RELAX_RELOC_ABS32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
case TAB (FBRANCH, SHORT):
|
||||
know ((fragP->fr_opcode[1] & 0x40) == 0);
|
||||
fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 1, RELAX_RELOC_PC16);
|
||||
+ 1, RELAX_RELOC_PC16, 0);
|
||||
fragP->fr_fix += 2;
|
||||
break;
|
||||
case TAB (FBRANCH, LONG):
|
||||
fragP->fr_opcode[1] |= 0x40; /* Turn on LONG bit */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 1, RELAX_RELOC_PC32);
|
||||
+ 1, RELAX_RELOC_PC32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
case TAB (DBCCLBR, SHORT):
|
||||
case TAB (DBCCABSJ, SHORT):
|
||||
fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 1, RELAX_RELOC_PC16);
|
||||
+ 1, RELAX_RELOC_PC16, 0);
|
||||
fragP->fr_fix += 2;
|
||||
break;
|
||||
case TAB (DBCCLBR, LONG):
|
||||
@@ -4454,7 +4534,7 @@
|
||||
|
||||
fragP->fr_fix += 6; /* account for bra/jmp instructions */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 1,
|
||||
- RELAX_RELOC_PC32);
|
||||
+ RELAX_RELOC_PC32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
case TAB (DBCCABSJ, LONG):
|
||||
@@ -4471,14 +4551,14 @@
|
||||
|
||||
fragP->fr_fix += 6; /* account for bra/jmp instructions */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 0,
|
||||
- RELAX_RELOC_ABS32);
|
||||
+ RELAX_RELOC_ABS32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
case TAB (PCREL1632, SHORT):
|
||||
fragP->fr_opcode[1] &= ~0x3F;
|
||||
fragP->fr_opcode[1] |= 0x3A; /* 072 - mode 7.2 */
|
||||
fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 1, RELAX_RELOC_PC16);
|
||||
+ fragP->fr_offset, 1, RELAX_RELOC_PC16, 0);
|
||||
fragP->fr_fix += 2;
|
||||
break;
|
||||
case TAB (PCREL1632, LONG):
|
||||
@@ -4488,7 +4568,7 @@
|
||||
*buffer_address++ = 0x70;
|
||||
fragP->fr_fix += 2;
|
||||
fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 1, RELAX_RELOC_PC32);
|
||||
+ fragP->fr_offset, 1, RELAX_RELOC_PC32, 0);
|
||||
fixP->fx_pcrel_adjust = 2;
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
@@ -4496,7 +4576,7 @@
|
||||
assert (fragP->fr_fix >= 2);
|
||||
buffer_address[-2] &= ~1;
|
||||
fixP = fix_new (fragP, fragP->fr_fix - 1, 1, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 1, RELAX_RELOC_PC8);
|
||||
+ fragP->fr_offset, 1, RELAX_RELOC_PC8, 0);
|
||||
fixP->fx_pcrel_adjust = 1;
|
||||
break;
|
||||
case TAB (PCINDEX, SHORT):
|
||||
@@ -4504,7 +4584,7 @@
|
||||
buffer_address[-2] |= 0x1;
|
||||
buffer_address[-1] = 0x20;
|
||||
fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 1, RELAX_RELOC_PC16);
|
||||
+ fragP->fr_offset, 1, RELAX_RELOC_PC16, 0);
|
||||
fixP->fx_pcrel_adjust = 2;
|
||||
fragP->fr_fix += 2;
|
||||
break;
|
||||
@@ -4513,13 +4593,13 @@
|
||||
buffer_address[-2] |= 0x1;
|
||||
buffer_address[-1] = 0x30;
|
||||
fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
|
||||
- fragP->fr_offset, 1, RELAX_RELOC_PC32);
|
||||
+ fragP->fr_offset, 1, RELAX_RELOC_PC32, 0);
|
||||
fixP->fx_pcrel_adjust = 2;
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
case TAB (ABSTOPCREL, SHORT):
|
||||
fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 1, RELAX_RELOC_PC16);
|
||||
+ 1, RELAX_RELOC_PC16, 0);
|
||||
fragP->fr_fix += 2;
|
||||
break;
|
||||
case TAB (ABSTOPCREL, LONG):
|
||||
@@ -4530,9 +4610,81 @@
|
||||
fragP->fr_opcode[1] &= ~0x3F;
|
||||
fragP->fr_opcode[1] |= 0x39; /* Mode 7.1 */
|
||||
fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
|
||||
- 0, RELAX_RELOC_ABS32);
|
||||
+ 0, RELAX_RELOC_ABS32, 0);
|
||||
fragP->fr_fix += 4;
|
||||
break;
|
||||
+ case TAB (ABSREL, BYTE):
|
||||
+ as_bad (_("ABSREL_BYTE: how the ** does this look??"));
|
||||
+ break;
|
||||
+ case TAB (ABSREL, SHORT):
|
||||
+ fragP->fr_opcode[1] &= ~0x3f;
|
||||
+ fragP->fr_fix += 2;
|
||||
+ if (S_GET_TYPE (fragP->fr_symbol) == N_TEXT)
|
||||
+ {
|
||||
+ /* so this is really a pc-relative address */
|
||||
+ fragP->fr_opcode[1] |= 0x3a;
|
||||
+ fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, 1, NO_RELOC, 0);
|
||||
+ break;
|
||||
+ }
|
||||
+ /* in that case we have to generate base-relative code
|
||||
+ * (note: if we're in N_UNDF, this could as well be pc-relative, but the linker
|
||||
+ * will have to do the final patch in that case) */
|
||||
+ fragP->fr_opcode[1] |= 0x2c; /* (a4) */
|
||||
+ fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 1);
|
||||
+ break;
|
||||
+ case TAB (ABSREL, LONG):
|
||||
+ as_bad (_("ABSREL_LONG: sorry, not supported."));
|
||||
+ break;
|
||||
+ case TAB (IMMREL, BYTE):
|
||||
+ as_bad (_("IMMREL_BYTE: how the ** does this look??"));
|
||||
+ break;
|
||||
+ case TAB (IMMREL, SHORT):
|
||||
+ if (S_GET_TYPE (fragP->fr_symbol) == N_TEXT)
|
||||
+ {
|
||||
+ /* we can only fix operations on data registers, not on <ea> */
|
||||
+ if ((fragP->fr_opcode[1] & 0x38) != 0)
|
||||
+ {
|
||||
+ /* use the normal reloc32, sigh... */
|
||||
+ fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
|
||||
+ fragP->fr_fix += 4;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* so this is really a pc-relative address
|
||||
+ * What we have to do now is a VERY UGLY AND BIG KLUDGE. Basically do the
|
||||
+ * following thing:
|
||||
+ * turn
|
||||
+ * addl #foo,d0 (foo is N_TEXT)
|
||||
+ * into
|
||||
+ * pea foo(pc)
|
||||
+ * addl (sp)+,d0
|
||||
+ */
|
||||
+ *buffer_address++ = fragP->fr_opcode[0]; /* save the original command */
|
||||
+ *buffer_address++ = fragP->fr_opcode[1];
|
||||
+ fragP->fr_opcode[0] = 0x48; /* PEA */
|
||||
+ fragP->fr_opcode[1] = 0x7a;
|
||||
+ fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, 1, NO_RELOC, 0);
|
||||
+
|
||||
+ *buffer_address++ = 0x9f; /* sp@+ */
|
||||
+ fragP->fr_fix += 4; /* two byte fix, two byte code extension */
|
||||
+ break;
|
||||
+ }
|
||||
+ /* in that case we have to generate base-relative code
|
||||
+ * (note: if we're in N_UNDF, this could as well be pc-relative, but the linker
|
||||
+ * will have to do the final patch in that case) */
|
||||
+
|
||||
+ /* analogous (more or less;-)) to above, the following conversion is done
|
||||
+ * turn
|
||||
+ * addl #bar,d0 (bar is N_DATA)
|
||||
+ * into
|
||||
+ * addl #<bar>,d0 where <bar> is a baserel-reloc
|
||||
+ * addl a4,d0
|
||||
+ */
|
||||
+
|
||||
+ fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 1);
|
||||
+ *buffer_address++ = 0xd0;
|
||||
+ *buffer_address++ = 0x8c;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4579,7 +4731,7 @@
|
||||
{
|
||||
fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), BYTE);
|
||||
}
|
||||
- else if (flag_short_refs)
|
||||
+ else if (flag_short_refs || (0 && flag_small_code))
|
||||
{
|
||||
/* Symbol is undefined and we want short ref. */
|
||||
fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
|
||||
@@ -4651,6 +4803,21 @@
|
||||
break;
|
||||
}
|
||||
|
||||
+ case TAB (ABSREL, SZ_UNDEF):
|
||||
+ {
|
||||
+ if ((S_GET_SEGMENT (fragP->fr_symbol) == segment
|
||||
+ && relaxable_symbol (fragP->fr_symbol))
|
||||
+ || flag_short_refs || (0 && flag_small_code))
|
||||
+ {
|
||||
+ fragP->fr_subtype = TAB (ABSREL, SHORT);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ fragP->fr_subtype = TAB (ABSREL, LONG);
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -4714,7 +4881,7 @@
|
||||
the_bytes[5] = (ri->r_symbolnum >> 8) & 0x0ff;
|
||||
the_bytes[6] = ri->r_symbolnum & 0x0ff;
|
||||
the_bytes[7] = (((ri->r_pcrel << 7) & 0x80) | ((ri->r_length << 5) & 0x60) |
|
||||
- ((ri->r_extern << 4) & 0x10));
|
||||
+ ((ri->r_extern << 4) & 0x10) | ((ri->r_baserel << 3) & 0x08));
|
||||
}
|
||||
|
||||
#endif /* comment */
|
||||
@@ -4748,7 +4915,7 @@
|
||||
where[5] = (r_symbolnum >> 8) & 0x0ff;
|
||||
where[6] = r_symbolnum & 0x0ff;
|
||||
where[7] = (((fixP->fx_pcrel << 7) & 0x80) | ((nbytes_r_length[fixP->fx_size] << 5) & 0x60) |
|
||||
- (((!S_IS_DEFINED (fixP->fx_addsy)) << 4) & 0x10));
|
||||
+ (((!S_IS_DEFINED (fixP->fx_addsy)) << 4) & 0x10) | ((fixP->tc_fix_data << 3) & 0x08));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4788,7 +4955,7 @@
|
||||
md_number_to_chars (ptr, (valueT) 0x4EF9, 2);
|
||||
md_number_to_chars (ptr + 2, (valueT) offset, 4);
|
||||
fix_new (frag, (ptr + 2) - frag->fr_literal, 4, to_symbol, (offsetT) 0,
|
||||
- 0, NO_RELOC);
|
||||
+ 0, NO_RELOC, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6732,7 +6899,7 @@
|
||||
#ifdef OBJ_ELF
|
||||
const char *md_shortopts = "lSA:m:kQ:V";
|
||||
#else
|
||||
-const char *md_shortopts = "lSA:m:k";
|
||||
+const char *md_shortopts = "lSA:m:s:k";
|
||||
#endif
|
||||
|
||||
struct option md_longopts[] = {
|
||||
@@ -6779,6 +6946,13 @@
|
||||
flag_keep_pcrel = 1;
|
||||
break;
|
||||
|
||||
+ case 's':
|
||||
+ if (!strcmp(arg, "c") || !strcmp(arg, "mallcode"))
|
||||
+ flag_small_code = 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+ break;
|
||||
+
|
||||
case 'A':
|
||||
if (*arg == 'm')
|
||||
arg++;
|
||||
@@ -6960,6 +7134,7 @@
|
||||
[default yes for 68020 and up]\n\
|
||||
-pic, -k generate position independent code\n\
|
||||
-S turn jbsr into jsr\n\
|
||||
+-smallcode, -sc small code model\n\
|
||||
--pcrel never turn PC-relative branches into absolute jumps\n\
|
||||
--register-prefix-optional\n\
|
||||
recognize register names without prefix character\n\
|
||||
@@ -7108,6 +7283,8 @@
|
||||
adjust = ((fixP->fx_pcrel_adjust & 0xff) ^ 0x80) - 0x80;
|
||||
if (adjust == 64)
|
||||
adjust = -1;
|
||||
+ if (OBJ_AMIGAHUNK)
|
||||
+ return -adjust;
|
||||
return fixP->fx_where + fixP->fx_frag->fr_address - adjust;
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
--- binutils-2.14/gas/config/tc-m68k.h 2003-01-23 13:51:05.000000000 +0100
|
||||
+++ binutils-2.14-patched/gas/config/tc-m68k.h 2013-04-24 18:38:13.000000000 +0200
|
||||
@@ -35,6 +35,9 @@
|
||||
#ifdef TE_NetBSD
|
||||
#define TARGET_FORMAT "a.out-m68k-netbsd"
|
||||
#endif
|
||||
+#ifdef TE_AMIGA
|
||||
+#define TARGET_FORMAT "a.out-amiga"
|
||||
+#endif
|
||||
#ifdef TE_LINUX
|
||||
#define TARGET_FORMAT "a.out-m68k-linux"
|
||||
#endif
|
||||
@@ -43,6 +46,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+#define TARGET_FORMAT "amiga"
|
||||
+#endif
|
||||
+
|
||||
#ifdef OBJ_ELF
|
||||
#define TARGET_FORMAT "elf32-m68k"
|
||||
#endif
|
||||
@@ -81,6 +88,9 @@
|
||||
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */
|
||||
#endif /* TE_SUN3 */
|
||||
+#ifdef TE_AMIGA
|
||||
+#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (OMAGIC); /* Magic byte for file header */
|
||||
+#endif
|
||||
|
||||
#ifndef AOUT_MACHTYPE
|
||||
#define AOUT_MACHTYPE m68k_aout_machtype
|
||||
@@ -209,6 +219,9 @@
|
||||
extern struct relax_type md_relax_table[];
|
||||
#define TC_GENERIC_RELAX_TABLE md_relax_table
|
||||
|
||||
+#define TC_FIX_TYPE char
|
||||
+#define TC_INIT_FIX_DATA(p)
|
||||
+
|
||||
/* We can't do a byte jump to the next instruction, so in that case
|
||||
force word mode by faking AIM. */
|
||||
#define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* te-amiga.h -- Amiga target environment declarations.
|
||||
*/
|
||||
|
||||
#define TE_AMIGA 1
|
||||
|
||||
#define LOCAL_LABELS_DOLLAR 1
|
||||
#define LOCAL_LABELS_FB 1
|
||||
|
||||
#ifdef OBJ_HEADER
|
||||
#include OBJ_HEADER
|
||||
#else
|
||||
#include "obj-format.h"
|
||||
#endif
|
||||
|
||||
#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) \
|
||||
do { \
|
||||
if ((SIZE) >= 4) \
|
||||
(P2VAR) = 2; \
|
||||
else if ((SIZE) >= 2) \
|
||||
(P2VAR) = 1; \
|
||||
else \
|
||||
(P2VAR) = 0; \
|
||||
} while (0)
|
|
@ -1,20 +0,0 @@
|
|||
--- binutils-2.14/gas/configure 2003-06-02 22:35:23.000000000 +0200
|
||||
+++ binutils-2.14/gas/configure 2013-05-18 12:03:00.000000000 +0200
|
||||
@@ -2536,6 +2536,8 @@
|
||||
m68hc11-*-* | m6811-*-*) fmt=elf ;;
|
||||
m68hc12-*-* | m6812-*-*) fmt=elf ;;
|
||||
|
||||
+ m68*-*-amigaoshunk) fmt=amigahunk em=amiga bfd_gas=yes ;;
|
||||
+ m68*-*-amigaos*) fmt=aout em=amiga ;;
|
||||
m68k-*-vxworks*) fmt=aout em=sun3 ;;
|
||||
m68k-ericsson-ose) fmt=aout em=sun3 ;;
|
||||
m68k-*-sunos*) fmt=aout em=sun3 ;;
|
||||
@@ -3199,7 +3201,7 @@
|
||||
|
||||
case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
|
||||
yes-*-coff) need_bfd=yes ;;
|
||||
- no-*-coff) need_bfd=yes
|
||||
+ no-*-coff | yes-m68k-amigahunk | no-m68k-amigahunk) need_bfd=yes
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define MANY_SEGMENTS 1
|
||||
EOF
|
|
@ -1,20 +0,0 @@
|
|||
--- binutils-2.14/gas/configure.in 2003-06-02 22:35:23.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/configure.in 2013-04-24 18:37:53.000000000 +0200
|
||||
@@ -326,6 +328,8 @@
|
||||
m68hc11-*-* | m6811-*-*) fmt=elf ;;
|
||||
m68hc12-*-* | m6812-*-*) fmt=elf ;;
|
||||
|
||||
+ m68k-*-amigaoshunk) fmt=amigahunk em=amiga bfd_gas=yes ;;
|
||||
+ m68k-*-amigaos*) fmt=aout em=amiga ;;
|
||||
m68k-*-vxworks*) fmt=aout em=sun3 ;;
|
||||
m68k-ericsson-ose) fmt=aout em=sun3 ;;
|
||||
m68k-*-sunos*) fmt=aout em=sun3 ;;
|
||||
@@ -895,7 +901,7 @@
|
||||
|
||||
case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
|
||||
yes-*-coff) need_bfd=yes ;;
|
||||
- no-*-coff) need_bfd=yes
|
||||
+ no-*-coff | yes-m68k-amigahunk | no-m68k-amigahunk) need_bfd=yes
|
||||
AC_DEFINE(MANY_SEGMENTS, 1, [old COFF support?]) ;;
|
||||
esac
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
--- binutils-2.14/gas/read.c 2003-06-02 22:35:23.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/read.c 2013-04-24 18:37:53.000000000 +0200
|
||||
@@ -48,6 +48,10 @@
|
||||
#define TC_START_LABEL(x,y) (x == ':')
|
||||
#endif
|
||||
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+extern segT data_chip_section, bss_chip_section;
|
||||
+#endif
|
||||
+
|
||||
/* Set by the object-format or the target. */
|
||||
#ifndef TC_IMPLICIT_LCOMM_ALIGNMENT
|
||||
#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) \
|
||||
@@ -274,6 +278,9 @@
|
||||
{"common", s_mri_common, 0},
|
||||
{"common.s", s_mri_common, 1},
|
||||
{"data", s_data, 0},
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+ {"datachip", s_data_chip, 0},
|
||||
+#endif
|
||||
{"dc", cons, 2},
|
||||
{"dc.b", cons, 1},
|
||||
{"dc.d", float_cons, 'd'},
|
||||
@@ -1552,6 +1559,17 @@
|
||||
demand_empty_rest_of_line ();
|
||||
}
|
||||
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+void
|
||||
+s_data_chip (ignore)
|
||||
+ int ignore ATTRIBUTE_UNUSED;
|
||||
+{
|
||||
+ int temp = get_absolute_expression ();
|
||||
+ subseg_set (data_chip_section, (subsegT) temp);
|
||||
+ demand_empty_rest_of_line ();
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* Handle the .appfile pseudo-op. This is automatically generated by
|
||||
do_scrub_chars when a preprocessor # line comment is seen with a
|
||||
file name. This default definition may be overridden by the object
|
||||
@@ -3717,7 +3735,7 @@
|
||||
|
||||
#ifdef BFD_ASSEMBLER
|
||||
#ifdef TC_CONS_FIX_NEW
|
||||
- TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
|
||||
+ TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp, 0);
|
||||
#else
|
||||
{
|
||||
bfd_reloc_code_real_type r;
|
||||
@@ -3742,12 +3760,12 @@
|
||||
break;
|
||||
}
|
||||
fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp,
|
||||
- 0, r);
|
||||
+ 0, r, 0);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#ifdef TC_CONS_FIX_NEW
|
||||
- TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
|
||||
+ TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp, 0);
|
||||
#else
|
||||
/* Figure out which reloc number to use. Use TC_CONS_RELOC if
|
||||
it is defined, otherwise use NO_RELOC if it is defined,
|
||||
@@ -3760,7 +3778,7 @@
|
||||
#endif
|
||||
#endif
|
||||
fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp, 0,
|
||||
- TC_CONS_RELOC);
|
||||
+ TC_CONS_RELOC, 0);
|
||||
#endif /* TC_CONS_FIX_NEW */
|
||||
#endif /* BFD_ASSEMBLER */
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils-2.14/gas/read.h 2003-01-11 07:24:12.000000000 +0100
|
||||
+++ binutils-2.14-patched/gas/read.h 2013-04-24 18:37:53.000000000 +0200
|
||||
@@ -144,6 +144,9 @@
|
||||
extern void s_bad_endr PARAMS ((int));
|
||||
extern void s_comm PARAMS ((int));
|
||||
extern void s_data PARAMS ((int));
|
||||
+#ifdef OBJ_AMIGAHUNK
|
||||
+extern void s_data_chip PARAMS ((int));
|
||||
+#endif
|
||||
extern void s_desc PARAMS ((int));
|
||||
extern void s_else PARAMS ((int arg));
|
||||
extern void s_elseif PARAMS ((int arg));
|
|
@ -1,28 +0,0 @@
|
|||
--- binutils-2.14/gas/tc.h 2001-11-15 22:28:53.000000000 +0100
|
||||
+++ binutils-2.14-patched/gas/tc.h 2013-04-24 18:38:14.000000000 +0200
|
||||
@@ -24,25 +24,6 @@
|
||||
|
||||
extern const pseudo_typeS md_pseudo_table[];
|
||||
|
||||
-/* JF moved this here from as.h under the theory that nobody except MACHINE.c
|
||||
- and write.c care about it anyway. */
|
||||
-
|
||||
-struct relax_type
|
||||
-{
|
||||
- /* Forward reach. Signed number. > 0. */
|
||||
- long rlx_forward;
|
||||
- /* Backward reach. Signed number. < 0. */
|
||||
- long rlx_backward;
|
||||
-
|
||||
- /* Bytes length of this address. */
|
||||
- unsigned char rlx_length;
|
||||
-
|
||||
- /* Next longer relax-state. 0 means there is no 'next' relax-state. */
|
||||
- relax_substateT rlx_more;
|
||||
-};
|
||||
-
|
||||
-typedef struct relax_type relax_typeS;
|
||||
-
|
||||
extern const int md_reloc_size; /* Size of a relocation record */
|
||||
|
||||
char *md_atof PARAMS ((int what_statement_type, char *literalP, int *sizeP));
|
|
@ -1,133 +0,0 @@
|
|||
--- binutils-2.14/gas/write.c 2003-04-07 05:54:00.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/write.c 2013-04-24 18:38:14.000000000 +0200
|
||||
@@ -160,7 +160,7 @@
|
||||
static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
|
||||
symbolS *add, symbolS *sub,
|
||||
offsetT offset, int pcrel,
|
||||
- RELOC_ENUM r_type));
|
||||
+ RELOC_ENUM r_type, int baserel));
|
||||
#if defined (BFD_ASSEMBLER) || (!defined (BFD) && !defined (OBJ_VMS))
|
||||
static long fixup_segment PARAMS ((fixS *, segT));
|
||||
#endif
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
static fixS *
|
||||
fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
|
||||
- r_type)
|
||||
+ r_type, baserel)
|
||||
fragS *frag; /* Which frag? */
|
||||
int where; /* Where in that frag? */
|
||||
int size; /* 1, 2, or 4 usually. */
|
||||
@@ -199,6 +199,7 @@
|
||||
offsetT offset; /* X_add_number. */
|
||||
int pcrel; /* TRUE if PC-relative relocation. */
|
||||
RELOC_ENUM r_type ATTRIBUTE_UNUSED; /* Relocation type. */
|
||||
+ int baserel ATTRIBUTE_UNUSED; /* TRUE if base-relative data */
|
||||
{
|
||||
fixS *fixP;
|
||||
|
||||
@@ -239,6 +240,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef TC_FIX_TYPE
|
||||
+ fixP->tc_fix_data = baserel;
|
||||
TC_INIT_FIX_DATA (fixP);
|
||||
#endif
|
||||
|
||||
@@ -283,7 +285,7 @@
|
||||
/* Create a fixup relative to a symbol (plus a constant). */
|
||||
|
||||
fixS *
|
||||
-fix_new (frag, where, size, add_symbol, offset, pcrel, r_type)
|
||||
+fix_new (frag, where, size, add_symbol, offset, pcrel, r_type, baserel)
|
||||
fragS *frag; /* Which frag? */
|
||||
int where; /* Where in that frag? */
|
||||
int size; /* 1, 2, or 4 usually. */
|
||||
@@ -291,9 +293,10 @@
|
||||
offsetT offset; /* X_add_number. */
|
||||
int pcrel; /* TRUE if PC-relative relocation. */
|
||||
RELOC_ENUM r_type; /* Relocation type. */
|
||||
+ int baserel; /* TRUE if base-relative data */
|
||||
{
|
||||
return fix_new_internal (frag, where, size, add_symbol,
|
||||
- (symbolS *) NULL, offset, pcrel, r_type);
|
||||
+ (symbolS *) NULL, offset, pcrel, r_type, baserel);
|
||||
}
|
||||
|
||||
/* Create a fixup for an expression. Currently we only support fixups
|
||||
@@ -301,13 +304,14 @@
|
||||
file formats support anyhow. */
|
||||
|
||||
fixS *
|
||||
-fix_new_exp (frag, where, size, exp, pcrel, r_type)
|
||||
+fix_new_exp (frag, where, size, exp, pcrel, r_type, baserel)
|
||||
fragS *frag; /* Which frag? */
|
||||
int where; /* Where in that frag? */
|
||||
int size; /* 1, 2, or 4 usually. */
|
||||
expressionS *exp; /* Expression. */
|
||||
int pcrel; /* TRUE if PC-relative relocation. */
|
||||
RELOC_ENUM r_type; /* Relocation type. */
|
||||
+ int baserel; /* TRUE if base-relative data */
|
||||
{
|
||||
symbolS *add = NULL;
|
||||
symbolS *sub = NULL;
|
||||
@@ -333,7 +337,7 @@
|
||||
exp->X_add_symbol = stmp;
|
||||
exp->X_add_number = 0;
|
||||
|
||||
- return fix_new_exp (frag, where, size, exp, pcrel, r_type);
|
||||
+ return fix_new_exp (frag, where, size, exp, pcrel, r_type, baserel);
|
||||
}
|
||||
|
||||
case O_symbol_rva:
|
||||
@@ -371,7 +375,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
- return fix_new_internal (frag, where, size, add, sub, off, pcrel, r_type);
|
||||
+ return fix_new_internal (frag, where, size, add, sub, off, pcrel, r_type, baserel);
|
||||
}
|
||||
|
||||
/* Generic function to determine whether a fixup requires a relocation. */
|
||||
@@ -1666,17 +1670,17 @@
|
||||
#ifdef TC_CONS_FIX_NEW
|
||||
TC_CONS_FIX_NEW (lie->frag,
|
||||
lie->word_goes_here - lie->frag->fr_literal,
|
||||
- 2, &exp);
|
||||
+ 2, &exp, 0);
|
||||
#else
|
||||
fix_new_exp (lie->frag,
|
||||
lie->word_goes_here - lie->frag->fr_literal,
|
||||
- 2, &exp, 0, BFD_RELOC_16);
|
||||
+ 2, &exp, 0, BFD_RELOC_16, 0);
|
||||
#endif
|
||||
#else
|
||||
#if defined(TC_SPARC) || defined(TC_A29K) || defined(NEED_FX_R_TYPE)
|
||||
fix_new_exp (lie->frag,
|
||||
lie->word_goes_here - lie->frag->fr_literal,
|
||||
- 2, &exp, 0, NO_RELOC);
|
||||
+ 2, &exp, 0, NO_RELOC, 0);
|
||||
#else
|
||||
#ifdef TC_NS32K
|
||||
fix_new_ns32k_exp (lie->frag,
|
||||
@@ -1685,7 +1689,7 @@
|
||||
#else
|
||||
fix_new_exp (lie->frag,
|
||||
lie->word_goes_here - lie->frag->fr_literal,
|
||||
- 2, &exp, 0, 0);
|
||||
+ 2, &exp, 0, 0, 0);
|
||||
#endif /* TC_NS32K */
|
||||
#endif /* TC_SPARC|TC_A29K|NEED_FX_R_TYPE */
|
||||
#endif /* BFD_ASSEMBLER */
|
||||
@@ -2740,6 +2744,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if !defined(BFD_ASSEMBLER) && !defined(MANY_SEGMENTS)
|
||||
+ if (fixP->tc_fix_data && add_number != fixP->fx_offset)
|
||||
+ add_number -= text_last_frag->fr_address;
|
||||
+#endif
|
||||
+
|
||||
if (!fixP->fx_done)
|
||||
md_apply_fix3 (fixP, &add_number, this_segment);
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
--- binutils-2.14/gas/write.h 2002-09-20 01:51:35.000000000 +0200
|
||||
+++ binutils-2.14-patched/gas/write.h 2013-04-24 18:38:14.000000000 +0200
|
||||
@@ -198,17 +198,18 @@
|
||||
#ifdef BFD_ASSEMBLER
|
||||
extern fixS *fix_new
|
||||
PARAMS ((fragS * frag, int where, int size, symbolS * add_symbol,
|
||||
- offsetT offset, int pcrel, bfd_reloc_code_real_type r_type));
|
||||
+ offsetT offset, int pcrel, bfd_reloc_code_real_type r_type,
|
||||
+ int baserel));
|
||||
extern fixS *fix_new_exp
|
||||
PARAMS ((fragS * frag, int where, int size, expressionS *exp, int pcrel,
|
||||
- bfd_reloc_code_real_type r_type));
|
||||
+ bfd_reloc_code_real_type r_type, int baserel));
|
||||
#else
|
||||
extern fixS *fix_new
|
||||
PARAMS ((fragS * frag, int where, int size, symbolS * add_symbol,
|
||||
- offsetT offset, int pcrel, int r_type));
|
||||
+ offsetT offset, int pcrel, int r_type, int baserel));
|
||||
extern fixS *fix_new_exp
|
||||
PARAMS ((fragS * frag, int where, int size, expressionS *exp, int pcrel,
|
||||
- int r_type));
|
||||
+ int r_type, int baserel));
|
||||
#endif
|
||||
|
||||
extern void write_print_statistics PARAMS ((FILE *));
|
|
@ -1,24 +0,0 @@
|
|||
--- binutils-2.14/ld/Makefile.am 2003-04-24 14:36:07.000000000 +0200
|
||||
+++ binutils-2.14-patched/ld/Makefile.am 2013-04-24 18:37:52.000000000 +0200
|
||||
@@ -111,6 +111,8 @@
|
||||
ea29k.o \
|
||||
eaixppc.o \
|
||||
eaixrs6.o \
|
||||
+ eamiga.o \
|
||||
+ eamiga_bss.o \
|
||||
ealpha.o \
|
||||
earcelf.o \
|
||||
earm_epoc_pe.o \
|
||||
@@ -432,6 +440,12 @@
|
||||
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
|
||||
@TDIRS@
|
||||
|
||||
+eamiga.c: $(srcdir)/emulparams/amiga.sh\
|
||||
+ $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS}
|
||||
+ ${GENSCRIPTS} amiga "$(tdir_amiga)"
|
||||
+eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
|
||||
+ $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
|
||||
+ ${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
|
||||
ea29k.c: $(srcdir)/emulparams/a29k.sh \
|
||||
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} a29k "$(tdir_a29k)"
|
|
@ -1,24 +0,0 @@
|
|||
--- binutils-2.14/ld/Makefile.in 2003-04-24 14:36:07.000000000 +0200
|
||||
+++ binutils-2.14-patched/ld/Makefile.in 2013-04-24 18:37:45.000000000 +0200
|
||||
@@ -225,6 +272,8 @@
|
||||
ea29k.o \
|
||||
eaixppc.o \
|
||||
eaixrs6.o \
|
||||
+ eamiga.o \
|
||||
+ eamiga_bss.o \
|
||||
ealpha.o \
|
||||
earcelf.o \
|
||||
earm_epoc_pe.o \
|
||||
@@ -1158,6 +1183,12 @@
|
||||
cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
|
||||
@TDIRS@
|
||||
|
||||
+eamiga.c: $(srcdir)/emulparams/amiga.sh\
|
||||
+ $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS}
|
||||
+ ${GENSCRIPTS} amiga "$(tdir_amiga)"
|
||||
+eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
|
||||
+ $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
|
||||
+ ${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
|
||||
ea29k.c: $(srcdir)/emulparams/a29k.sh \
|
||||
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} a29k "$(tdir_a29k)"
|
|
@ -1,10 +0,0 @@
|
|||
--- binutils-2.14/ld/configure.tgt 2003-06-12 16:25:52.000000000 +0200
|
||||
+++ binutils-2.14-patched/ld/configure.tgt 2013-04-24 18:37:52.000000000 +0200
|
||||
@@ -340,6 +341,7 @@
|
||||
m68k-sony-*) targ_emul=news ;;
|
||||
m68k-hp-bsd*) targ_emul=hp300bsd ;;
|
||||
m68*-motorola-sysv*) targ_emul=delta68 ;;
|
||||
+m68*-*-amigaos*) targ_emul=amiga ; targ_extra_emuls=amiga_bss;;
|
||||
m68*-*-aout) targ_emul=m68kaout ;;
|
||||
m68*-*-coff) targ_emul=m68kcoff ;;
|
||||
m68*-*-elf) targ_emul=m68kelf ;;
|
|
@ -1,6 +0,0 @@
|
|||
SCRIPT_NAME=amiga
|
||||
OUTPUT_FORMAT="amiga"
|
||||
TEXT_START_ADDR=0x0
|
||||
SEGMENT_SIZE=0x0
|
||||
TEMPLATE_NAME=amiga
|
||||
ARCH=m68k
|
|
@ -1,6 +0,0 @@
|
|||
SCRIPT_NAME=amiga_bss
|
||||
OUTPUT_FORMAT="amiga"
|
||||
TEXT_START_ADDR=0x0
|
||||
SEGMENT_SIZE=0x0
|
||||
TEMPLATE_NAME=amiga
|
||||
ARCH=m68k
|
|
@ -1,288 +0,0 @@
|
|||
# This shell script emits a C file. -*- C -*-
|
||||
# It does some substitutions.
|
||||
cat >e${EMULATION_NAME}.c <<EOF
|
||||
/* This file is is generated by a shell script. DO NOT EDIT! */
|
||||
|
||||
/* emulate the original gld for the given ${EMULATION_NAME}
|
||||
Copyright (C) 1991, 1993 Free Software Foundation, Inc.
|
||||
Written by Steve Chamberlain steve@cygnus.com
|
||||
|
||||
This file is part of GLD, the Gnu Linker.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define TARGET_IS_${EMULATION_NAME}
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "bfdlink.h"
|
||||
#include "getopt.h"
|
||||
|
||||
#include "ld.h"
|
||||
#include "ldmain.h"
|
||||
#include "ldmisc.h"
|
||||
#include "ldexp.h"
|
||||
#include "ldlang.h"
|
||||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
#include "ldctor.h"
|
||||
|
||||
#include "libamiga.h"
|
||||
|
||||
/* shared functions */
|
||||
void amiga_add_options PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
bfd_boolean amiga_handle_option PARAMS ((int));
|
||||
void amiga_after_parse PARAMS ((void));
|
||||
void amiga_after_open PARAMS ((void));
|
||||
void amiga_after_allocation PARAMS ((void));
|
||||
|
||||
/* amigaoslink.c variables */
|
||||
|
||||
/* 1 means, write out debug hunk, when producing a load file */
|
||||
extern int write_debug_hunk;
|
||||
|
||||
/* This is the attribute to use for the next file */
|
||||
extern int amiga_attribute;
|
||||
|
||||
/* generate a combined data+bss hunk */
|
||||
extern int amiga_base_relative;
|
||||
|
||||
/* generate a resident executable */
|
||||
extern int amiga_resident;
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
|
||||
#if defined(TARGET_IS_amiga)
|
||||
|
||||
/* Handle amiga specific options */
|
||||
|
||||
enum {
|
||||
OPTION_IGNORE = 300,
|
||||
OPTION_AMIGA_CHIP,
|
||||
OPTION_AMIGA_FAST,
|
||||
OPTION_AMIGA_ATTRIBUTE,
|
||||
OPTION_AMIGA_DEBUG,
|
||||
OPTION_AMIGA_DATABSS_TOGETHER,
|
||||
OPTION_AMIGA_DATADATA_RELOC,
|
||||
OPTION_FLAVOR
|
||||
};
|
||||
|
||||
void
|
||||
amiga_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns ATTRIBUTE_UNUSED;
|
||||
char **shortopts ATTRIBUTE_UNUSED;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
{
|
||||
static const struct option xtra_long[] = {
|
||||
{"flavor", required_argument, NULL, OPTION_FLAVOR},
|
||||
{"amiga-datadata-reloc", no_argument, NULL, OPTION_AMIGA_DATADATA_RELOC},
|
||||
{"amiga-databss-together", no_argument, NULL, OPTION_AMIGA_DATABSS_TOGETHER},
|
||||
{"amiga-debug-hunk", no_argument, NULL, OPTION_AMIGA_DEBUG},
|
||||
{"attribute", required_argument, NULL, OPTION_AMIGA_ATTRIBUTE},
|
||||
{"fast", no_argument, NULL, OPTION_AMIGA_FAST},
|
||||
{"chip", no_argument, NULL, OPTION_AMIGA_CHIP},
|
||||
{NULL, no_argument, NULL, 0}
|
||||
};
|
||||
|
||||
*longopts = (struct option *)
|
||||
xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
|
||||
memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
|
||||
}
|
||||
|
||||
bfd_boolean
|
||||
amiga_handle_option (optc)
|
||||
int optc;
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
case 0:
|
||||
/* Long option which just sets a flag. */
|
||||
break;
|
||||
|
||||
case OPTION_AMIGA_CHIP:
|
||||
amiga_attribute = MEMF_CHIP;
|
||||
break;
|
||||
|
||||
case OPTION_AMIGA_FAST:
|
||||
amiga_attribute = MEMF_FAST;
|
||||
break;
|
||||
|
||||
case OPTION_AMIGA_ATTRIBUTE:
|
||||
{
|
||||
char *end;
|
||||
amiga_attribute = strtoul (optarg, &end, 0);
|
||||
if (*end)
|
||||
einfo ("%P%F: invalid number \`%s\'\n", optarg);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPTION_AMIGA_DEBUG:
|
||||
write_debug_hunk = 1; /* Write out debug hunk */
|
||||
break;
|
||||
|
||||
case OPTION_AMIGA_DATABSS_TOGETHER:
|
||||
amiga_base_relative = 1; /* Combine data and bss */
|
||||
break;
|
||||
|
||||
case OPTION_AMIGA_DATADATA_RELOC:
|
||||
amiga_resident = 1; /* Write out datadata_reloc array */
|
||||
break;
|
||||
|
||||
case OPTION_FLAVOR:
|
||||
ldfile_add_flavor (optarg);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
amiga_after_parse ()
|
||||
{
|
||||
ldfile_sort_flavors();
|
||||
}
|
||||
|
||||
void
|
||||
amiga_after_open ()
|
||||
{
|
||||
ldctor_build_sets ();
|
||||
}
|
||||
|
||||
static void
|
||||
amiga_assign_attribute (inp)
|
||||
lang_input_statement_type *inp;
|
||||
{
|
||||
asection *s;
|
||||
|
||||
if (bfd_get_flavour(inp->the_bfd)==bfd_target_amiga_flavour)
|
||||
{
|
||||
for (s=inp->the_bfd->sections;s!=NULL;s=s->next)
|
||||
amiga_per_section(s)->attribute=inp->amiga_attribute;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
amiga_after_allocation ()
|
||||
{
|
||||
if (0) /* Does not work at the moment */
|
||||
lang_for_each_input_file (amiga_assign_attribute);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
{
|
||||
write_debug_hunk = 0;
|
||||
|
||||
#if defined(TARGET_IS_amiga_bss)
|
||||
amiga_base_relative = 1;
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_output_architecture = bfd_arch_${ARCH};
|
||||
#endif /* not TARGET_ */
|
||||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
then
|
||||
# Scripts compiled in.
|
||||
|
||||
# sed commands to quote an ld script as a C string.
|
||||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocateable == TRUE && config.build_constructors == TRUE)
|
||||
return
|
||||
EOF
|
||||
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
|
||||
echo ' ; else if (link_info.relocateable == TRUE) return' >> e${EMULATION_NAME}.c
|
||||
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
|
||||
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
|
||||
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
|
||||
echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
|
||||
sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
|
||||
echo ' ; else return' >> e${EMULATION_NAME}.c
|
||||
sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
|
||||
echo '; }' >> e${EMULATION_NAME}.c
|
||||
|
||||
else
|
||||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocateable == TRUE && config.build_constructors == TRUE)
|
||||
return "ldscripts/${EMULATION_NAME}.xu";
|
||||
else if (link_info.relocateable == TRUE)
|
||||
return "ldscripts/${EMULATION_NAME}.xr";
|
||||
else if (!config.text_read_only)
|
||||
return "ldscripts/${EMULATION_NAME}.xbn";
|
||||
else if (!config.magic_demand_paged)
|
||||
return "ldscripts/${EMULATION_NAME}.xn";
|
||||
else
|
||||
return "ldscripts/${EMULATION_NAME}.x";
|
||||
}
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse, /* before_parse */
|
||||
syslib_default, /* syslib */
|
||||
hll_default, /* hll */
|
||||
amiga_after_parse, /* after_parse */
|
||||
amiga_after_open, /* after_open */
|
||||
amiga_after_allocation, /* after_allocation */
|
||||
set_output_arch_default, /* set_output_arch */
|
||||
ldemul_default_target, /* choose_target */
|
||||
before_allocation_default, /* before_allocation */
|
||||
gld${EMULATION_NAME}_get_script, /* get_script */
|
||||
"${EMULATION_NAME}", /* emulation_name */
|
||||
"${OUTPUT_FORMAT}", /* target_name */
|
||||
NULL, /* finish */
|
||||
NULL, /* create_output_section_statements */
|
||||
NULL, /* open_dynamic_library */
|
||||
NULL, /* place_orphan */
|
||||
NULL, /* set_symbols */
|
||||
NULL, /* parse_args */
|
||||
amiga_add_options, /* add_options */
|
||||
amiga_handle_option, /* handle_option */
|
||||
NULL, /* unrecognized file */
|
||||
NULL, /* list_options */
|
||||
NULL, /* recognized_file */
|
||||
NULL, /* find potential_libraries */
|
||||
NULL /* new_vers_pattern */
|
||||
};
|
||||
EOF
|
|
@ -1,41 +0,0 @@
|
|||
--- binutils-2.14/ld/ldctor.c 2002-11-30 09:39:45.000000000 +0100
|
||||
+++ binutils-2.14-patched/ld/ldctor.c 2013-04-24 18:37:51.000000000 +0200
|
||||
@@ -266,8 +266,12 @@
|
||||
/* If the symbol is defined, we may have been invoked from
|
||||
collect, and the sets may already have been built, so we do
|
||||
not do anything. */
|
||||
- if (p->h->type == bfd_link_hash_defined
|
||||
- || p->h->type == bfd_link_hash_defweak)
|
||||
+ /* dgv -- libnix v1.1 uses absolute sets that are also explicitly
|
||||
+ defined in the library so that the sets need to be build even
|
||||
+ if the symbol is defined */
|
||||
+ if ((bfd_get_flavour (output_bfd) != bfd_target_amiga_flavour) &&
|
||||
+ (p->h->type == bfd_link_hash_defined
|
||||
+ || p->h->type == bfd_link_hash_defweak))
|
||||
continue;
|
||||
|
||||
/* For each set we build:
|
||||
@@ -361,15 +365,21 @@
|
||||
|
||||
if (e->name != NULL)
|
||||
minfo ("%T\n", e->name);
|
||||
- else
|
||||
+ else if (e->section->owner)
|
||||
minfo ("%G\n", e->section->owner, e->section, e->value);
|
||||
+ else
|
||||
+ minfo ("%s\n", "** ABS **");
|
||||
}
|
||||
|
||||
/* Need SEC_KEEP for --gc-sections. */
|
||||
if (! bfd_is_abs_section (e->section))
|
||||
e->section->flags |= SEC_KEEP;
|
||||
|
||||
- if (link_info.relocateable)
|
||||
+ /* dgv -- on the amiga, we want the constructors to be relocateable
|
||||
+ objects. However, this should be arranged somewhere else (FIXME) */
|
||||
+ if (link_info.relocateable ||
|
||||
+ (bfd_get_flavour (output_bfd) == bfd_target_amiga_flavour &&
|
||||
+ e->section != bfd_abs_section_ptr))
|
||||
lang_add_reloc (p->reloc, howto, e->section, e->name,
|
||||
exp_intop (e->value));
|
||||
else
|
|
@ -1,109 +0,0 @@
|
|||
--- binutils-2.14/ld/ldfile.c 2003-04-18 17:33:49.000000000 +0200
|
||||
+++ binutils-2.14-patched/ld/ldfile.c 2013-04-24 18:37:50.000000000 +0200
|
||||
@@ -74,6 +74,40 @@
|
||||
static bfd_boolean is_sysrooted_pathname
|
||||
PARAMS ((const char *, bfd_boolean));
|
||||
|
||||
+/* Flavour support. */
|
||||
+
|
||||
+static int flavors_cmp PARAMS ((const void *f1, const void *f2));
|
||||
+
|
||||
+static int n_flavors, flavors_len;
|
||||
+static char **flavors;
|
||||
+
|
||||
+static int
|
||||
+flavors_cmp (f1, f2)
|
||||
+ const void *f1, *f2;
|
||||
+{
|
||||
+ return strcmp (*(char **)f1, *(char **)f2);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+ldfile_sort_flavors ()
|
||||
+{
|
||||
+ if (n_flavors > 1)
|
||||
+ qsort ((void *) flavors, n_flavors, sizeof (char **), flavors_cmp);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+ldfile_add_flavor (name)
|
||||
+ const char *name;
|
||||
+{
|
||||
+ n_flavors++;
|
||||
+ if (flavors)
|
||||
+ flavors = (char **) xrealloc ((PTR)flavors, n_flavors * sizeof (char *));
|
||||
+ else
|
||||
+ flavors = (char **) xmalloc (sizeof (char *));
|
||||
+ flavors [n_flavors-1] = (char *) name;
|
||||
+ flavors_len += strlen (name);
|
||||
+}
|
||||
+
|
||||
/* Test whether a pathname, after canonicalization, is the same or a
|
||||
sub-directory of the sysroot directory. */
|
||||
|
||||
@@ -304,6 +338,7 @@
|
||||
const char *lib;
|
||||
const char *suffix;
|
||||
{
|
||||
+ char *flavor_dir = (char *) alloca (flavors_len + n_flavors + 1);
|
||||
search_dirs_type *search;
|
||||
|
||||
/* If this is not an archive, try to open it in the current
|
||||
@@ -337,6 +372,7 @@
|
||||
search = search->next)
|
||||
{
|
||||
char *string;
|
||||
+ int i, count;
|
||||
|
||||
if (entry->dynamic && ! link_info.relocateable)
|
||||
{
|
||||
@@ -347,6 +383,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
string = (char *) xmalloc (strlen (search->name)
|
||||
+ strlen (slash)
|
||||
+ strlen (lib)
|
||||
@@ -369,6 +406,41 @@
|
||||
}
|
||||
|
||||
free (string);
|
||||
+#else
|
||||
+ for (count=n_flavors; count>=0; count--) {
|
||||
+
|
||||
+ *flavor_dir = '\0';
|
||||
+ for (i=0; i<count; i++) {
|
||||
+ strcat (flavor_dir, flavors[i]);
|
||||
+ strcat (flavor_dir, slash);
|
||||
+ }
|
||||
+ string = (char *) xmalloc (strlen (search->name)
|
||||
+ + strlen (slash)
|
||||
+ + strlen (flavor_dir)
|
||||
+ + strlen (lib)
|
||||
+ + strlen (entry->filename)
|
||||
+ + strlen (arch)
|
||||
+ + strlen (suffix)
|
||||
+ + 1);
|
||||
+
|
||||
+ if (entry->is_archive)
|
||||
+ sprintf (string, "%s%s%s%s%s%s%s", search->name, slash, flavor_dir,
|
||||
+ lib, entry->filename, arch, suffix);
|
||||
+ else if (entry->filename[0] == '/' || entry->filename[0] == '.')
|
||||
+ strcpy (string, entry->filename);
|
||||
+ else
|
||||
+ sprintf (string, "%s%s%s%s", search->name, slash, flavor_dir,
|
||||
+ entry->filename);
|
||||
+
|
||||
+ if (ldfile_try_open_bfd (string, entry))
|
||||
+ {
|
||||
+ entry->filename = string;
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ free (string);
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
return FALSE;
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils-2.14/ld/ldfile.h 2003-03-03 21:00:35.000000000 +0100
|
||||
+++ binutils-2.14-patched/ld/ldfile.h 2013-04-24 18:37:50.000000000 +0200
|
||||
@@ -61,4 +61,9 @@
|
||||
PARAMS ((const char *arch, struct lang_input_statement_struct *,
|
||||
const char *lib, const char *suffix));
|
||||
|
||||
+extern void ldfile_sort_flavors
|
||||
+ PARAMS ((void));
|
||||
+extern void ldfile_add_flavor
|
||||
+ PARAMS ((const char *));
|
||||
+
|
||||
#endif
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils-2.14/ld/ldlang.h 2003-03-03 21:00:35.000000000 +0100
|
||||
+++ binutils-2.14-patched/ld/ldlang.h 2013-04-24 18:37:50.000000000 +0200
|
||||
@@ -255,6 +255,8 @@
|
||||
#endif
|
||||
const char *target;
|
||||
bfd_boolean real;
|
||||
+ /* Added for AMIGA support of section attributes */
|
||||
+ int amiga_attribute;
|
||||
} lang_input_statement_type;
|
||||
|
||||
typedef struct {
|
|
@ -1,49 +0,0 @@
|
|||
cat <<EOF
|
||||
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
|
||||
OUTPUT_ARCH(${ARCH})
|
||||
|
||||
${RELOCATING+${LIB_SEARCH_DIRS}}
|
||||
${STACKZERO+${RELOCATING+${STACKZERO}}}
|
||||
${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
${RELOCATING+PROVIDE(___machtype = 0x0);}
|
||||
${RELOCATING+. = ${TEXT_START_ADDR};}
|
||||
.text :
|
||||
{
|
||||
${RELOCATING+__stext = .;}
|
||||
*(.text)
|
||||
${RELOCATING+___datadata_relocs = .;}
|
||||
${RELOCATING+__etext = .;}
|
||||
${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
|
||||
}
|
||||
${RELOCATING+___text_size = SIZEOF(.text);}
|
||||
${RELOCATING+. = ${DATA_ALIGNMENT};}
|
||||
.data :
|
||||
{
|
||||
${RELOCATING+__sdata = .;}
|
||||
${CONSTRUCTING+CONSTRUCTORS}
|
||||
*(.data)
|
||||
${RELOCATING+___a4_init = 0x7ffe;}
|
||||
${RELOCATING+__edata = .;}
|
||||
}
|
||||
${RELOCATING+___data_size = SIZEOF(.data);}
|
||||
.bss :
|
||||
{
|
||||
${RELOCATING+__bss_start = .;}
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
${RELOCATING+__end = .;}
|
||||
}
|
||||
${RELOCATING+___bss_size = SIZEOF(.bss);}
|
||||
.data_chip :
|
||||
{
|
||||
*(.data_chip)
|
||||
}
|
||||
.bss_chip :
|
||||
{
|
||||
*(.bss_chip)
|
||||
}
|
||||
}
|
||||
EOF
|
|
@ -1,41 +0,0 @@
|
|||
cat <<EOF
|
||||
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
|
||||
OUTPUT_ARCH(${ARCH})
|
||||
|
||||
${RELOCATING+${LIB_SEARCH_DIRS}}
|
||||
${STACKZERO+${RELOCATING+${STACKZERO}}}
|
||||
${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
${RELOCATING+PROVIDE(___machtype = 0x0);}
|
||||
${RELOCATING+. = ${TEXT_START_ADDR};}
|
||||
.text :
|
||||
{
|
||||
${RELOCATING+__stext = .;}
|
||||
*(.text)
|
||||
${RELOCATING+___datadata_relocs = .;}
|
||||
${RELOCATING+__etext = .;}
|
||||
${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
|
||||
}
|
||||
${RELOCATING+___text_size = SIZEOF(.text);}
|
||||
${RELOCATING+. = ${DATA_ALIGNMENT};}
|
||||
.data :
|
||||
{
|
||||
${RELOCATING+__sdata = .;}
|
||||
${CONSTRUCTING+CONSTRUCTORS}
|
||||
*(.data)
|
||||
${RELOCATING+___a4_init = 0x7ffe;}
|
||||
${RELOCATING+__edata = .;}
|
||||
}
|
||||
.bss :
|
||||
{
|
||||
${RELOCATING+__bss_start = .;}
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
${RELOCATING+__end = .;}
|
||||
}
|
||||
${RELOCATING+___data_size = SIZEOF(.data) + SIZEOF(.bss);}
|
||||
${RELOCATING+___bss_size = 0x0;}
|
||||
}
|
||||
EOF
|
|
@ -1,20 +0,0 @@
|
|||
--- binutils-2.14/opcodes/configure 2013-05-18 12:54:01.000000000 +0200
|
||||
+++ binutils-2.14-patched/opcodes/configure 2013-05-18 12:51:35.000000000 +0200
|
||||
@@ -1771,7 +1771,7 @@
|
||||
if { (eval echo configure:1772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
for file in conftest.*; do
|
||||
case $file in
|
||||
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
|
||||
+ *.c | *.o | *.obj | *.ilk | *.pdb | *.dSYM) ;;
|
||||
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
|
||||
esac
|
||||
done
|
||||
@@ -2407,7 +2407,7 @@
|
||||
if { (eval echo configure:2408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
for file in conftest.*; do
|
||||
case $file in
|
||||
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
|
||||
+ *.c | *.o | *.obj | *.ilk | *.pdb | *.dSYM) ;;
|
||||
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
|
||||
esac
|
||||
done
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils-2.14/opcodes/m68k-dis.c 2002-06-08 09:29:27.000000000 +0200
|
||||
+++ binutils-2.14-patched/opcodes/m68k-dis.c 2013-04-24 18:38:26.000000000 +0200
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
static char *const reg_names[] = {
|
||||
"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
|
||||
- "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",
|
||||
+ "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp",
|
||||
"%ps", "%pc"
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2a89d7fe20a0d8621c9dd1fb7038ae5ea812e699
|
|
@ -695,7 +695,7 @@ if __name__ == "__main__":
|
|||
default='build', help='perform action')
|
||||
parser.add_argument('args', metavar='ARGS', type=str, nargs='*',
|
||||
help='action arguments')
|
||||
parser.add_argument('--binutils', choices=['2.9.1'], default='2.9.1',
|
||||
parser.add_argument('--binutils', choices=['2.9.1', '2.14'], default='2.9.1',
|
||||
help='desired binutils version')
|
||||
parser.add_argument('--gcc', choices=['2.95.3'], default='2.95.3',
|
||||
help='desired gcc version')
|
||||
|
|
Loading…
Reference in New Issue