Remove sparc-aout and sparc-coff support

bfd/
	* Makefile.am: Remove sparc-aout and sparc-coff support.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* targets.c: Likewise.
	* aout-sparcle.c: Delete.
	* aoutf1.h: Delete.
	* cf-sparclynx.c: Delete.
	* coff-sparc.c: Delete.
	* demo64.c: Delete.
	* sparclinux.c: Delete.
	* sparclynx.c: Delete.
	* sparcnetbsd.c: Delete.
	* sunos.c: Delete.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
binutils/
	* testsuite/lib/binutils-common.exp: Remove sparc-aout and
	sparc-coff support.
gas/
	* Makefile.am: Remove sparc-aout and sparc-coff support.
	* config/obj-coff.h: Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-sparc.h: Likewise.
	* configure.tgt: Likewise.
	* config/te-sparcaout.h: Delete.
	* testsuite/gas/sun4/addend.d: Delete.
	* testsuite/gas/sun4/addend.exp: Delete.
	* testsuite/gas/sun4/addend.s: Delete.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
ld/
	* Makefile.am: Remove sparc-aout and sparc-coff support.
	* configure.tgt: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* emulparams/coff_sparc.sh: Delete.
	* emulparams/sparcaout.sh: Delete.
	* emulparams/sparclinux.sh: Delete.
	* emulparams/sparcnbsd.sh: Delete.
	* emulparams/sun4.sh: Delete.
	* scripttempl/sparccoff.sc: Delete.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
This commit is contained in:
Alan Modra 2018-04-16 15:33:26 +09:30
parent dc12032bca
commit c9098af41e
46 changed files with 105 additions and 5663 deletions

View File

@ -1,3 +1,22 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove sparc-aout and sparc-coff support.
* config.bfd: Likewise.
* configure.ac: Likewise.
* targets.c: Likewise.
* aout-sparcle.c: Delete.
* aoutf1.h: Delete.
* cf-sparclynx.c: Delete.
* coff-sparc.c: Delete.
* demo64.c: Delete.
* sparclinux.c: Delete.
* sparclynx.c: Delete.
* sparcnetbsd.c: Delete.
* sunos.c: Delete.
* Makefile.in: Regenerate.
* configure: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove m68k-aout and m68k-coff support.

View File

@ -260,19 +260,16 @@ BFD32_BACKENDS = \
aout-arm.lo \
aout-cris.lo \
aout-ns32k.lo \
aout-sparcle.lo \
aout-tic30.lo \
aout32.lo \
armnetbsd.lo \
cf-i386lynx.lo \
cf-sparclynx.lo \
coff-arm.lo \
coff-go32.lo \
coff-i386.lo \
coff-mips.lo \
coff-rs6000.lo \
coff-sh.lo \
coff-sparc.lo \
coff-stgo32.lo \
coff-tic30.lo \
coff-tic4x.lo \
@ -400,10 +397,6 @@ BFD32_BACKENDS = \
reloc16.lo \
riscix.lo \
som.lo \
sparclinux.lo \
sparclynx.lo \
sparcnetbsd.lo \
sunos.lo \
vax1knetbsd.lo \
vaxnetbsd.lo \
vms-lib.lo \
@ -418,19 +411,16 @@ BFD32_BACKENDS_CFILES = \
aout-arm.c \
aout-cris.c \
aout-ns32k.c \
aout-sparcle.c \
aout-tic30.c \
aout32.c \
armnetbsd.c \
cf-i386lynx.c \
cf-sparclynx.c \
coff-arm.c \
coff-go32.c \
coff-i386.c \
coff-mips.c \
coff-rs6000.c \
coff-sh.c \
coff-sparc.c \
coff-stgo32.c \
coff-tic30.c \
coff-tic4x.c \
@ -557,10 +547,6 @@ BFD32_BACKENDS_CFILES = \
reloc16.c \
riscix.c \
som.c \
sparclinux.c \
sparclynx.c \
sparcnetbsd.c \
sunos.c \
vax1knetbsd.c \
vaxnetbsd.c \
vms-lib.c \
@ -585,7 +571,6 @@ BFD64_BACKENDS = \
coff-alpha.lo \
coff-x86_64.lo \
coff64-rs6000.lo \
demo64.lo \
elf32-ia64.lo \
elf32-mips.lo \
elf32-score.lo \
@ -626,7 +611,6 @@ BFD64_BACKENDS_CFILES = \
coff-alpha.c \
coff-x86_64.c \
coff64-rs6000.c \
demo64.c \
elf32-mips.c \
elf32-score.c \
elf32-score7.c \
@ -717,7 +701,7 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
## This is a list of all .h files which are in the source tree.
SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
aout-target.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
elf-bfd.h elf-hppa.h elf-linux-core.h elf32-hppa.h \
elf64-hppa.h elfcode.h elfcore.h \
freebsd.h genlink.h go32stub.h \

View File

@ -594,19 +594,16 @@ BFD32_BACKENDS = \
aout-arm.lo \
aout-cris.lo \
aout-ns32k.lo \
aout-sparcle.lo \
aout-tic30.lo \
aout32.lo \
armnetbsd.lo \
cf-i386lynx.lo \
cf-sparclynx.lo \
coff-arm.lo \
coff-go32.lo \
coff-i386.lo \
coff-mips.lo \
coff-rs6000.lo \
coff-sh.lo \
coff-sparc.lo \
coff-stgo32.lo \
coff-tic30.lo \
coff-tic4x.lo \
@ -734,10 +731,6 @@ BFD32_BACKENDS = \
reloc16.lo \
riscix.lo \
som.lo \
sparclinux.lo \
sparclynx.lo \
sparcnetbsd.lo \
sunos.lo \
vax1knetbsd.lo \
vaxnetbsd.lo \
vms-lib.lo \
@ -752,19 +745,16 @@ BFD32_BACKENDS_CFILES = \
aout-arm.c \
aout-cris.c \
aout-ns32k.c \
aout-sparcle.c \
aout-tic30.c \
aout32.c \
armnetbsd.c \
cf-i386lynx.c \
cf-sparclynx.c \
coff-arm.c \
coff-go32.c \
coff-i386.c \
coff-mips.c \
coff-rs6000.c \
coff-sh.c \
coff-sparc.c \
coff-stgo32.c \
coff-tic30.c \
coff-tic4x.c \
@ -891,10 +881,6 @@ BFD32_BACKENDS_CFILES = \
reloc16.c \
riscix.c \
som.c \
sparclinux.c \
sparclynx.c \
sparcnetbsd.c \
sunos.c \
vax1knetbsd.c \
vaxnetbsd.c \
vms-lib.c \
@ -920,7 +906,6 @@ BFD64_BACKENDS = \
coff-alpha.lo \
coff-x86_64.lo \
coff64-rs6000.lo \
demo64.lo \
elf32-ia64.lo \
elf32-mips.lo \
elf32-score.lo \
@ -961,7 +946,6 @@ BFD64_BACKENDS_CFILES = \
coff-alpha.c \
coff-x86_64.c \
coff64-rs6000.c \
demo64.c \
elf32-mips.c \
elf32-score.c \
elf32-score7.c \
@ -1052,7 +1036,7 @@ BUILD_CFILES = \
CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
aout-target.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
elf-bfd.h elf-hppa.h elf-linux-core.h elf32-hppa.h \
elf64-hppa.h elfcode.h elfcore.h \
freebsd.h genlink.h go32stub.h \
@ -1227,7 +1211,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-arm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-cris.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-ns32k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-sparcle.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout-tic30.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aout64.Plo@am__quote@
@ -1241,7 +1224,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cf-i386lynx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cf-sparclynx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cisco-core.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-alpha.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-arm.Plo@am__quote@
@ -1251,7 +1233,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-mips.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-rs6000.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sparc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-stgo32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic30.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic4x.Plo@am__quote@
@ -1346,7 +1327,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xtensa.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-z80.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-z8k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecoff.Plo@am__quote@
@ -1517,13 +1497,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/section.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/som.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparclinux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparclynx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparcnetbsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stab-syms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stabs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sunos.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/targets.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tekhex.Plo@am__quote@

View File

@ -1,37 +0,0 @@
/* BFD backend for sparc little-endian aout binaries.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Written by Cygnus Support.
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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#define TARGETNAME "a.out-sparc-little"
/* 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 (sparc_aout_le_,OP)
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libaout.h"
#define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_SPARCLET)
/* Include the usual a.out support. */
#define TARGET_IS_LITTLE_ENDIAN_P
#include "aoutf1.h"

View File

@ -1,747 +0,0 @@
/* A.out "format 1" file handling code for BFD.
Copyright (C) 1990-2018 Free Software Foundation, Inc.
Written by Cygnus Support.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "aout/sun4.h"
#include "libaout.h" /* BFD a.out internal data structures. */
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
/* This is needed to reject a NewsOS file, e.g. in
gdb/testsuite/gdb.t10/crossload.exp. <kingdon@cygnus.com>
I needed to add M_UNKNOWN to recognize a 68000 object, so this will
probably no longer reject a NewsOS object. <ian@cygnus.com>. */
#ifndef MACHTYPE_OK
#define MACHTYPE_OK(mtype) \
((mtype) == M_SPARC && bfd_lookup_arch (bfd_arch_sparc, 0) != NULL)
#endif
/* The file @code{aoutf1.h} contains the code for BFD's
a.out back end. Control over the generated back end is given by these
two preprocessor names:
@table @code
@item ARCH_SIZE
This value should be either 32 or 64, depending upon the size of an
int in the target format. It changes the sizes of the structs which
perform the memory/disk mapping of structures.
The 64 bit backend may only be used if the host compiler supports 64
ints (eg long long with gcc), by defining the name @code{BFD_HOST_64_BIT} in @code{bfd.h}.
With this name defined, @emph{all} bfd operations are performed with 64bit
arithmetic, not just those to a 64bit target.
@item TARGETNAME
The name put into the target vector.
@item
@end table. */
#if ARCH_SIZE == 64
#define sunos_set_arch_mach sunos_64_set_arch_mach
#define sunos_write_object_contents aout_64_sunos4_write_object_contents
#else
#define sunos_set_arch_mach sunos_32_set_arch_mach
#define sunos_write_object_contents aout_32_sunos4_write_object_contents
#endif
/* Merge backend data into the output file.
This is necessary on sparclet-aout where we want the resultant machine
number to be M_SPARCLET if any input file is M_SPARCLET. */
#define MY_bfd_merge_private_bfd_data sunos_merge_private_bfd_data
static bfd_boolean
sunos_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
if (bfd_get_flavour (ibfd) != bfd_target_aout_flavour
|| bfd_get_flavour (obfd) != bfd_target_aout_flavour)
return TRUE;
if (bfd_get_arch (obfd) == bfd_arch_sparc)
{
if (bfd_get_mach (obfd) < bfd_get_mach (ibfd))
bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd));
}
return TRUE;
}
/* This is either sunos_32_set_arch_mach or sunos_64_set_arch_mach,
depending upon ARCH_SIZE. */
static void
sunos_set_arch_mach (bfd *abfd, enum machine_type machtype)
{
/* Determine the architecture and machine type of the object file. */
enum bfd_architecture arch;
unsigned long machine;
switch (machtype)
{
case M_SPARC:
arch = bfd_arch_sparc;
machine = 0;
break;
case M_SPARCLET:
arch = bfd_arch_sparc;
machine = bfd_mach_sparc_sparclet;
break;
case M_SPARCLITE_LE:
arch = bfd_arch_sparc;
machine = bfd_mach_sparc_sparclite_le;
break;
case M_386:
case M_386_DYNIX:
arch = bfd_arch_i386;
machine = 0;
break;
default:
arch = bfd_arch_obscure;
machine = 0;
break;
}
bfd_set_arch_mach (abfd, arch, machine);
}
#define SET_ARCH_MACH(ABFD, EXECP) \
NAME(sunos,set_arch_mach) (ABFD, N_MACHTYPE (EXECP)); \
choose_reloc_size(ABFD);
/* Determine the size of a relocation entry, based on the architecture. */
static void
choose_reloc_size (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
case bfd_arch_sparc:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
}
/* Write an object file in SunOS format. Section contents have
already been written. We write the file header, symbols, and
relocation. The real name of this function is either
aout_64_sunos4_write_object_contents or
aout_32_sunos4_write_object_contents, depending upon ARCH_SIZE. */
static bfd_boolean
sunos_write_object_contents (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_sparc:
switch (bfd_get_mach (abfd))
{
case bfd_mach_sparc_sparclet:
N_SET_MACHTYPE (execp, M_SPARCLET);
break;
case bfd_mach_sparc_sparclite_le:
N_SET_MACHTYPE (execp, M_SPARCLITE_LE);
break;
default:
N_SET_MACHTYPE (execp, M_SPARC);
break;
}
break;
case bfd_arch_i386:
N_SET_MACHTYPE (execp, M_386);
break;
default:
N_SET_MACHTYPE (execp, M_UNKNOWN);
}
choose_reloc_size (abfd);
N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
N_SET_DYNAMIC (execp, (long)(bfd_get_file_flags (abfd) & DYNAMIC));
WRITE_HEADERS (abfd, execp);
return TRUE;
}
/* Core files. */
#define CORE_MAGIC 0x080456
#define CORE_NAMELEN 16
/* The core structure is taken from the Sun documentation.
Unfortunately, they don't document the FPA structure, or at least I
can't find it easily. Fortunately the core header contains its own
length. So this shouldn't cause problems, except for c_ucode, which
so far we don't use but is easy to find with a little arithmetic. */
/* But the reg structure can be gotten from the SPARC processor handbook.
This really should be in a GNU include file though so that gdb can use
the same info. */
struct regs
{
int r_psr;
int r_pc;
int r_npc;
int r_y;
int r_g1;
int r_g2;
int r_g3;
int r_g4;
int r_g5;
int r_g6;
int r_g7;
int r_o0;
int r_o1;
int r_o2;
int r_o3;
int r_o4;
int r_o5;
int r_o6;
int r_o7;
};
/* Taken from Sun documentation: */
/* FIXME: It's worse than we expect. This struct contains TWO substructs
neither of whose size we know, WITH STUFF IN BETWEEN THEM! We can't
even portably access the stuff in between! */
struct external_sparc_core
{
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SPARC_CORE_LEN 432
struct regs c_regs; /* General purpose registers -- MACHDEP SIZE. */
struct external_exec c_aouthdr; /* A.out header. */
int c_signo; /* Killing signal, if any. */
int c_tsize; /* Text size (bytes). */
int c_dsize; /* Data size (bytes). */
int c_ssize; /* Stack size (bytes). */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name. */
double fp_stuff[1]; /* External FPU state (size unknown by us). */
/* The type "double" is critical here, for alignment.
SunOS declares a struct here, but the struct's
alignment is double since it contains doubles. */
int c_ucode; /* Exception no. from u_code. */
/* This member is not accessible by name since
we don't portably know the size of fp_stuff. */
};
/* Core files generated by the BCP (the part of Solaris which allows
it to run SunOS4 a.out files). */
struct external_solaris_bcp_core
{
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SOLARIS_BCP_CORE_LEN 456
struct regs c_regs; /* General purpose registers -- MACHDEP SIZE. */
int c_exdata_vp; /* Exdata structure. */
int c_exdata_tsize;
int c_exdata_dsize;
int c_exdata_bsize;
int c_exdata_lsize;
int c_exdata_nshlibs;
short c_exdata_mach;
short c_exdata_mag;
int c_exdata_toffset;
int c_exdata_doffset;
int c_exdata_loffset;
int c_exdata_txtorg;
int c_exdata_datorg;
int c_exdata_entloc;
int c_signo; /* Killing signal, if any. */
int c_tsize; /* Text size (bytes). */
int c_dsize; /* Data size (bytes). */
int c_ssize; /* Stack size (bytes). */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name. */
double fp_stuff[1]; /* External FPU state (size unknown by us). */
/* The type "double" is critical here, for alignment.
SunOS declares a struct here, but the struct's
alignment is double since it contains doubles. */
int c_ucode; /* Exception no. from u_code. */
/* This member is not accessible by name since
we don't portably know the size of fp_stuff. */
};
struct external_sun3_core
{
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SUN3_CORE_LEN 826 /* As of SunOS 4.1.1. */
int c_regs[18]; /* General purpose registers -- MACHDEP SIZE. */
struct external_exec c_aouthdr; /* A.out header. */
int c_signo; /* Killing signal, if any. */
int c_tsize; /* Text size (bytes). */
int c_dsize; /* Data size (bytes). */
int c_ssize; /* Stack size (bytes). */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name. */
double fp_stuff[1]; /* External FPU state (size unknown by us). */
/* The type "double" is critical here, for alignment.
SunOS declares a struct here, but the struct's
alignment is double since it contains doubles. */
int c_ucode; /* Exception no. from u_code. */
/* This member is not accessible by name since
we don't portably know the size of fp_stuff. */
};
struct internal_sunos_core
{
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
long c_regs_pos; /* File offset of General purpose registers. */
int c_regs_size; /* Size of General purpose registers. */
struct internal_exec c_aouthdr; /* A.out header. */
int c_signo; /* Killing signal, if any. */
int c_tsize; /* Text size (bytes). */
int c_dsize; /* Data size (bytes). */
bfd_vma c_data_addr; /* Data start (address). */
int c_ssize; /* Stack size (bytes). */
bfd_vma c_stacktop; /* Stack top (address). */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name. */
long fp_stuff_pos; /* File offset of external FPU state (regs). */
int fp_stuff_size; /* Size of it. */
int c_ucode; /* Exception no. from u_code. */
};
/* Byte-swap in the Sun-3 core structure. */
static void
swapcore_sun3 (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
{
struct external_sun3_core *extcore = (struct external_sun3_core *) ext;
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
intcore->c_regs_pos = offsetof (struct external_sun3_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
#if ARCH_SIZE == 64
aout_64_swap_exec_header_in
#else
aout_32_swap_exec_header_in
#endif
(abfd, &extcore->c_aouthdr, &intcore->c_aouthdr);
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
intcore->c_data_addr = N_DATADDR (&intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = offsetof (struct external_sun3_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
offsetof (struct external_sun3_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end. */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
- sizeof (extcore->c_ucode)
+ (unsigned char *) extcore));
intcore->c_stacktop = 0x0E000000; /* By experimentation. */
}
/* Byte-swap in the Sparc core structure. */
static void
swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
{
struct external_sparc_core *extcore = (struct external_sparc_core *) ext;
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
intcore->c_regs_pos = offsetof (struct external_sparc_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
#if ARCH_SIZE == 64
aout_64_swap_exec_header_in
#else
aout_32_swap_exec_header_in
#endif
(abfd, &extcore->c_aouthdr, &intcore->c_aouthdr);
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
intcore->c_data_addr = N_DATADDR (&intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = offsetof (struct external_sparc_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
offsetof (struct external_sparc_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end. */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
- sizeof (extcore->c_ucode)
+ (unsigned char *) extcore));
/* Supposedly the user stack grows downward from the bottom of kernel memory.
Presuming that this remains true, this definition will work. */
/* Now sun has provided us with another challenge. The value is different
for sparc2 and sparc10 (both running SunOS 4.1.3). We pick one or
the other based on the current value of the stack pointer. This
loses (a) if the stack pointer has been clobbered, or (b) if the stack
is larger than 128 megabytes.
It's times like these you're glad they're switching to ELF.
Note that using include files or nlist on /vmunix would be wrong,
because we want the value for this core file, no matter what kind of
machine we were compiled on or are running on. */
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
bfd_vma sp = H_GET_32 (abfd, &extcore->c_regs.r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else
intcore->c_stacktop = SPARC_USRSTACK_SPARC2;
}
}
/* Byte-swap in the Solaris BCP core structure. */
static void
swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
{
struct external_solaris_bcp_core *extcore =
(struct external_solaris_bcp_core *) ext;
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
intcore->c_regs_pos = offsetof (struct external_solaris_bcp_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
/* The Solaris BCP exdata structure does not contain an a_syms field,
so we are unable to synthesize an internal exec header.
Luckily we are able to figure out the start address of the data section,
which is the only thing needed from the internal exec header,
from the exdata structure.
As of Solaris 2.3, BCP core files for statically linked executables
are buggy. The exdata structure is not properly filled in, and
the data section is written from address zero instead of the data
start address. */
memset ((void *) &intcore->c_aouthdr, 0, sizeof (struct internal_exec));
intcore->c_data_addr = H_GET_32 (abfd, &extcore->c_exdata_datorg);
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos =
offsetof (struct external_solaris_bcp_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
offsetof (struct external_solaris_bcp_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
- sizeof (extcore->c_ucode)
+ (unsigned char *) extcore));
/* Supposedly the user stack grows downward from the bottom of kernel memory.
Presuming that this remains true, this definition will work. */
/* Now sun has provided us with another challenge. The value is different
for sparc2 and sparc10 (both running SunOS 4.1.3). We pick one or
the other based on the current value of the stack pointer. This
loses (a) if the stack pointer has been clobbered, or (b) if the stack
is larger than 128 megabytes.
It's times like these you're glad they're switching to ELF.
Note that using include files or nlist on /vmunix would be wrong,
because we want the value for this core file, no matter what kind of
machine we were compiled on or are running on. */
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
bfd_vma sp = H_GET_32 (abfd, &extcore->c_regs.r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else
intcore->c_stacktop = SPARC_USRSTACK_SPARC2;
}
}
/* Need this cast because ptr is really void *. */
#define core_hdr(bfd) ((bfd)->tdata.sun_core_data)
#define core_datasec(bfd) (core_hdr (bfd)->data_section)
#define core_stacksec(bfd) (core_hdr (bfd)->stack_section)
#define core_regsec(bfd) (core_hdr (bfd)->reg_section)
#define core_reg2sec(bfd) (core_hdr (bfd)->reg2_section)
/* These are stored in the bfd's tdata. */
struct sun_core_struct
{
struct internal_sunos_core *hdr; /* Core file header. */
asection *data_section;
asection *stack_section;
asection *reg_section;
asection *reg2_section;
};
static const bfd_target *
sunos4_core_file_p (bfd *abfd)
{
unsigned char longbuf[4]; /* Raw bytes of various header fields. */
bfd_size_type core_size, amt;
unsigned long core_mag;
struct internal_sunos_core *core;
char *extcore;
struct mergem
{
struct sun_core_struct suncoredata;
struct internal_sunos_core internal_sunos_core;
char external_core[1];
} *mergem;
flagword flags;
if (bfd_bread ((void *) longbuf, (bfd_size_type) sizeof (longbuf), abfd)
!= sizeof (longbuf))
return NULL;
core_mag = H_GET_32 (abfd, longbuf);
if (core_mag != CORE_MAGIC)
return NULL;
/* SunOS core headers can vary in length; second word is size; */
if (bfd_bread ((void *) longbuf, (bfd_size_type) sizeof (longbuf), abfd)
!= sizeof (longbuf))
return NULL;
core_size = H_GET_32 (abfd, longbuf);
/* Sanity check. */
if (core_size > 20000)
return NULL;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return NULL;
amt = core_size + sizeof (struct mergem);
mergem = bfd_zalloc (abfd, amt);
if (mergem == NULL)
return NULL;
extcore = mergem->external_core;
if ((bfd_bread ((void *) extcore, core_size, abfd)) != core_size)
{
loser:
bfd_release (abfd, (char *) mergem);
abfd->tdata.any = NULL;
bfd_section_list_clear (abfd);
return NULL;
}
/* Validate that it's a core file we know how to handle, due to sun
botching the positioning of registers and other fields in a machine
dependent way. */
core = &mergem->internal_sunos_core;
switch (core_size)
{
case SPARC_CORE_LEN:
swapcore_sparc (abfd, extcore, core);
break;
case SUN3_CORE_LEN:
swapcore_sun3 (abfd, extcore, core);
break;
case SOLARIS_BCP_CORE_LEN:
swapcore_solaris_bcp (abfd, extcore, core);
break;
default:
bfd_set_error (bfd_error_system_call); /* FIXME. */
goto loser;
}
abfd->tdata.sun_core_data = &mergem->suncoredata;
abfd->tdata.sun_core_data->hdr = core;
/* Create the sections. */
flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack",
flags);
if (core_stacksec (abfd) == NULL)
/* bfd_release frees everything allocated after it's arg. */
goto loser;
flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data",
flags);
if (core_datasec (abfd) == NULL)
goto loser;
flags = SEC_HAS_CONTENTS;
core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg",
flags);
if (core_regsec (abfd) == NULL)
goto loser;
flags = SEC_HAS_CONTENTS;
core_reg2sec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg2",
flags);
if (core_reg2sec (abfd) == NULL)
goto loser;
core_stacksec (abfd)->size = core->c_ssize;
core_datasec (abfd)->size = core->c_dsize;
core_regsec (abfd)->size = core->c_regs_size;
core_reg2sec (abfd)->size = core->fp_stuff_size;
core_stacksec (abfd)->vma = (core->c_stacktop - core->c_ssize);
core_datasec (abfd)->vma = core->c_data_addr;
core_regsec (abfd)->vma = 0;
core_reg2sec (abfd)->vma = 0;
core_stacksec (abfd)->filepos = core->c_len + core->c_dsize;
core_datasec (abfd)->filepos = core->c_len;
/* We'll access the regs afresh in the core file, like any section: */
core_regsec (abfd)->filepos = (file_ptr) core->c_regs_pos;
core_reg2sec (abfd)->filepos = (file_ptr) core->fp_stuff_pos;
/* Align to word at least. */
core_stacksec (abfd)->alignment_power = 2;
core_datasec (abfd)->alignment_power = 2;
core_regsec (abfd)->alignment_power = 2;
core_reg2sec (abfd)->alignment_power = 2;
return abfd->xvec;
}
static char *
sunos4_core_file_failing_command (bfd *abfd)
{
return core_hdr (abfd)->hdr->c_cmdname;
}
static int
sunos4_core_file_failing_signal (bfd *abfd)
{
return core_hdr (abfd)->hdr->c_signo;
}
static bfd_boolean
sunos4_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
{
if (core_bfd->xvec != exec_bfd->xvec)
{
bfd_set_error (bfd_error_system_call);
return FALSE;
}
/* Solaris core files do not include an aouthdr. */
if ((core_hdr (core_bfd)->hdr)->c_len == SOLARIS_BCP_CORE_LEN)
return TRUE;
return memcmp ((char *) &((core_hdr (core_bfd)->hdr)->c_aouthdr),
(char *) exec_hdr (exec_bfd),
sizeof (struct internal_exec)) == 0;
}
#define MY_set_sizes sunos4_set_sizes
static bfd_boolean
sunos4_set_sizes (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
default:
return FALSE;
case bfd_arch_sparc:
adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x2000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return TRUE;
}
}
/* We default to setting the toolversion field to 1, as is required by
SunOS. */
#ifndef MY_exec_hdr_flags
#define MY_exec_hdr_flags 1
#endif
#ifndef MY_entry_is_text_address
#define MY_entry_is_text_address 0
#endif
#ifndef MY_add_dynamic_symbols
#define MY_add_dynamic_symbols 0
#endif
#ifndef MY_add_one_symbol
#define MY_add_one_symbol 0
#endif
#ifndef MY_link_dynamic_object
#define MY_link_dynamic_object 0
#endif
#ifndef MY_write_dynamic_symbol
#define MY_write_dynamic_symbol 0
#endif
#ifndef MY_check_dynamic_reloc
#define MY_check_dynamic_reloc 0
#endif
#ifndef MY_finish_dynamic_link
#define MY_finish_dynamic_link 0
#endif
static const struct aout_backend_data sunos4_aout_backend =
{
0, /* Zmagic files are not contiguous. */
1, /* Text includes header. */
MY_entry_is_text_address,
MY_exec_hdr_flags,
0, /* Default text vma. */
sunos4_set_sizes,
0, /* Header is counted in zmagic text. */
MY_add_dynamic_symbols,
MY_add_one_symbol,
MY_link_dynamic_object,
MY_write_dynamic_symbol,
MY_check_dynamic_reloc,
MY_finish_dynamic_link
};
#define MY_core_file_failing_command sunos4_core_file_failing_command
#define MY_core_file_failing_signal sunos4_core_file_failing_signal
#define MY_core_file_matches_executable_p sunos4_core_file_matches_executable_p
#define MY_bfd_debug_info_start _bfd_void_bfd
#define MY_bfd_debug_info_end _bfd_void_bfd
#define MY_bfd_debug_info_accumulate _bfd_void_bfd_asection
#define MY_core_file_p sunos4_core_file_p
#define MY_write_object_contents NAME(aout, sunos4_write_object_contents)
#define MY_backend_data & sunos4_aout_backend
#ifndef TARGET_IS_LITTLE_ENDIAN_P
#define TARGET_IS_BIG_ENDIAN_P
#endif
#include "aout-target.h"

View File

@ -1,29 +0,0 @@
/* BFD back-end for Sparc COFF LynxOS files.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Cygnus Support.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#define TARGET_SYM sparc_coff_lynx_vec
#define TARGET_NAME "coff-sparc-lynx"
#define LYNXOS
#define COFF_LONG_FILENAMES
#include "coff-sparc.c"

View File

@ -1,208 +0,0 @@
/* BFD back-end for Sparc COFF files.
Copyright (C) 1990-2018 Free Software Foundation, Inc.
Written by Cygnus Support.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/sparc.h"
#include "coff/internal.h"
#include "libcoff.h"
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
#define BADMAG(x) ((x).f_magic != SPARCMAGIC && (x).f_magic != LYNXCOFFMAGIC)
/* The page size is a guess based on ELF. */
#define COFF_PAGE_SIZE 0x10000
enum reloc_type
{
R_SPARC_NONE = 0,
R_SPARC_8, R_SPARC_16, R_SPARC_32,
R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
R_SPARC_WDISP30, R_SPARC_WDISP22,
R_SPARC_HI22, R_SPARC_22,
R_SPARC_13, R_SPARC_LO10,
R_SPARC_GOT10, R_SPARC_GOT13, R_SPARC_GOT22,
R_SPARC_PC10, R_SPARC_PC22,
R_SPARC_WPLT30,
R_SPARC_COPY,
R_SPARC_GLOB_DAT, R_SPARC_JMP_SLOT,
R_SPARC_RELATIVE,
R_SPARC_UA32,
R_SPARC_max
};
/* This is stolen pretty directly from elf.c. */
static bfd_reloc_status_type
bfd_coff_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry,
asymbol *symbol,
void * data ATTRIBUTE_UNUSED,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0)
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
return bfd_reloc_continue;
}
static reloc_howto_type coff_sparc_howto_table[] =
{
HOWTO(R_SPARC_NONE, 0,3, 0,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", FALSE,0,0x000000ff,TRUE),
HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16", FALSE,0,0x0000ffff,TRUE),
HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32", FALSE,0,0xffffffff,TRUE),
HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE),
HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE),
HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP32", FALSE,0,0x00ffffff,TRUE),
HOWTO(R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE),
HOWTO(R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_HI22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_13", FALSE,0,0x00001fff,TRUE),
HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_LO10", FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE),
HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_PC10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC10", FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_PC22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_WPLT30, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_WPLT30", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_COPY", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_GLOB_DAT,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_JMP_SLOT,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_RELATIVE,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_UA32, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", FALSE,0,0x00000000,TRUE),
};
struct coff_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char coff_reloc_val;
};
static const struct coff_reloc_map sparc_reloc_map[] =
{
{ BFD_RELOC_NONE, R_SPARC_NONE, },
{ BFD_RELOC_16, R_SPARC_16, },
{ BFD_RELOC_8, R_SPARC_8 },
{ BFD_RELOC_8_PCREL, R_SPARC_DISP8 },
{ BFD_RELOC_CTOR, R_SPARC_32 }, /* @@ Assumes 32 bits. */
{ BFD_RELOC_32, R_SPARC_32 },
{ BFD_RELOC_32_PCREL, R_SPARC_DISP32 },
{ BFD_RELOC_HI22, R_SPARC_HI22 },
{ BFD_RELOC_LO10, R_SPARC_LO10, },
{ BFD_RELOC_32_PCREL_S2, R_SPARC_WDISP30 },
{ BFD_RELOC_SPARC22, R_SPARC_22 },
{ BFD_RELOC_SPARC13, R_SPARC_13 },
{ BFD_RELOC_SPARC_GOT10, R_SPARC_GOT10 },
{ BFD_RELOC_SPARC_GOT13, R_SPARC_GOT13 },
{ BFD_RELOC_SPARC_GOT22, R_SPARC_GOT22 },
{ BFD_RELOC_SPARC_PC10, R_SPARC_PC10 },
{ BFD_RELOC_SPARC_PC22, R_SPARC_PC22 },
{ BFD_RELOC_SPARC_WPLT30, R_SPARC_WPLT30 },
{ BFD_RELOC_SPARC_COPY, R_SPARC_COPY },
{ BFD_RELOC_SPARC_GLOB_DAT, R_SPARC_GLOB_DAT },
{ BFD_RELOC_SPARC_JMP_SLOT, R_SPARC_JMP_SLOT },
{ BFD_RELOC_SPARC_RELATIVE, R_SPARC_RELATIVE },
{ BFD_RELOC_SPARC_WDISP22, R_SPARC_WDISP22 },
/* { BFD_RELOC_SPARC_UA32, R_SPARC_UA32 }, not used?? */
};
static reloc_howto_type *
coff_sparc_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
unsigned int i;
for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct coff_reloc_map); i++)
{
if (sparc_reloc_map[i].bfd_reloc_val == code)
return &coff_sparc_howto_table[(int) sparc_reloc_map[i].coff_reloc_val];
}
return 0;
}
#define coff_bfd_reloc_type_lookup coff_sparc_reloc_type_lookup
static reloc_howto_type *
coff_sparc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < (sizeof (coff_sparc_howto_table)
/ sizeof (coff_sparc_howto_table[0]));
i++)
if (coff_sparc_howto_table[i].name != NULL
&& strcasecmp (coff_sparc_howto_table[i].name, r_name) == 0)
return &coff_sparc_howto_table[i];
return NULL;
}
#define coff_bfd_reloc_name_lookup coff_sparc_reloc_name_lookup
static void
rtype2howto (arelent *cache_ptr, struct internal_reloc *dst)
{
BFD_ASSERT (dst->r_type < (unsigned int) R_SPARC_max);
cache_ptr->howto = &coff_sparc_howto_table[dst->r_type];
}
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
#define SWAP_IN_RELOC_OFFSET H_GET_32
#define SWAP_OUT_RELOC_OFFSET H_PUT_32
#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
cache_ptr->addend = reloc.r_offset;
/* Clear the r_spare field in relocs. */
#define SWAP_OUT_RELOC_EXTRA(abfd,src,dst) \
do { \
dst->r_spare[0] = 0; \
dst->r_spare[1] = 0; \
} while (0)
#define __A_MAGIC_SET__
/* Enable Sparc-specific hacks in coffcode.h. */
#define COFF_SPARC
#define bfd_pe_print_pdata NULL
#include "coffcode.h"
#ifndef TARGET_SYM
#define TARGET_SYM sparc_coff_vec
#endif
#ifndef TARGET_NAME
#define TARGET_NAME "coff-sparc"
#endif
CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE)

View File

@ -84,14 +84,6 @@ case $targ in
mips*-*-lnews* | \
mips*-*-sysv* | mips*-*-riscos* | \
powerpc-*-lynxos* | powerpc-*-windiss* | \
sparclet-*-aout* | \
sparc86x-*-aout* | \
sparc*-*-chorus* | \
sparc-*-linux*aout* | \
sparc-*-netbsdaout* | \
sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1] | \
sparc64-*-aout* | \
sparc*-*-coff* | \
null)
if test "x$enable_obsolete" != xyes; then
echo "*** Configuration $targ is obsolete." >&2
@ -144,7 +136,11 @@ case $targ in
maxq-*-coff | \
mips*el-*-rtems* | \
sh*-*-symbianelf* | sh5*-*-* | sh64*-*-* | \
sparc*-*-*aout* | \
sparc*-*-chorus* | \
sparc*-*-coff* | \
sparc-*-lynxos* | \
sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1] | \
tahoe-*-* | \
vax-*-bsd* | vax-*-ultrix* | vax-*-vms* | \
w65-*-* | \
@ -329,15 +325,6 @@ case "${targ}" in
targ_selvecs=alpha_vms_lib_txt_vec
want64=true
;;
sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
targ_defvec=sparc_elf64_fbsd_vec
targ_selvecs="sparc_elf64_vec sparc_elf32_vec sparc_aout_sunos_be_vec"
;;
sparc64-*-netbsd* | sparc64-*-openbsd*)
targ_defvec=sparc_elf64_vec
targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
want64=true
;;
#endif /* BFD64 */
am33_2.0-*-linux*)
@ -1407,96 +1394,35 @@ case "${targ}" in
targ_underscore=yes
;;
sparclet-*-aout*)
targ_defvec=sparc_aout_sunos_be_vec
targ_selvecs=sparc_aout_le_vec
targ_underscore=yes
;;
sparc86x-*-aout*)
targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
;;
sparclite-*-elf* | sparc86x-*-elf*)
targ_defvec=sparc_elf32_vec
;;
sparc*-*-chorus*)
targ_defvec=sparc_elf32_vec
;;
sparc-*-linux*aout*)
targ_defvec=sparc_aout_linux_vec
targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
targ_underscore=yes
;;
sparc-*-linux-* | sparcv*-*-linux-*)
targ_defvec=sparc_elf32_vec
targ_selvecs="sparc_aout_linux_vec sparc_elf64_vec sparc_aout_sunos_be_vec"
;;
sparc-*-netbsdelf*)
targ_defvec=sparc_elf32_vec
targ_selvecs=sparc_aout_nbsd_vec
;;
sparc-*-netbsdaout* | sparc-*-netbsd*)
targ_defvec=sparc_aout_nbsd_vec
targ_selvecs=sparc_elf32_vec
targ_underscore=yes
;;
sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1])
targ_defvec=sparc_aout_nbsd_vec
targ_underscore=yes
;;
sparc-*-openbsd*)
targ_defvec=sparc_elf32_vec
targ_selvecs=sparc_aout_nbsd_vec
;;
sparc-*-elf*)
targ_defvec=sparc_elf32_vec
targ_selvecs=sparc_aout_sunos_be_vec
;;
sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
targ_defvec=sparc_elf32_sol2_vec
targ_selvecs=sparc_aout_sunos_be_vec
;;
#ifdef BFD64
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
targ_defvec=sparc_elf32_sol2_vec
targ_selvecs="sparc_elf64_sol2_vec sparc_aout_sunos_be_vec"
targ_selvecs="sparc_elf64_sol2_vec"
want64=true
;;
sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
targ_defvec=sparc_elf64_fbsd_vec
targ_selvecs="sparc_elf64_vec sparc_elf32_vec"
;;
sparc64*-*-*)
targ_defvec=sparc_elf64_vec
targ_selvecs="sparc_elf32_vec"
want64=true
;;
#endif
sparc-*-sysv4*)
sparc-*-linux-* | sparcv*-*-linux-*)
targ_defvec=sparc_elf32_vec
targ_selvecs="sparc_elf64_vec"
;;
sparc-*-vxworks*)
targ_defvec=sparc_elf32_vxworks_vec
targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
;;
#ifdef BFD64
sparc64-*-aout*)
targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
want64=true
;;
sparc64*-*-linux-*)
targ_defvec=sparc_elf64_vec
targ_selvecs="sparc_elf32_vec sparc_aout_linux_vec sparc_aout_sunos_be_vec"
want64=true
;;
sparc64-*-elf* | sparc64-*-rtems* )
targ_defvec=sparc_elf64_vec
targ_selvecs=sparc_elf32_vec
want64=true
;;
#endif /* BFD64 */
sparc*-*-coff*)
targ_defvec=sparc_coff_vec
;;
sparc-*-rtems*)
targ_defvec=sparc_elf32_vec
targ_selvecs="sparc_aout_sunos_be_vec sparc_coff_vec"
targ_selvecs="sparc_elf32_vec"
;;
sparc*-*-*)
targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
targ_defvec=sparc_elf32_vec
;;
spu-*-elf)

7
bfd/configure vendored
View File

@ -14552,13 +14552,6 @@ do
sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;;
sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo $coff" ;;
sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo $coff" ;;
sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;;
sparc_coff_vec) tb="$tb coff-sparc.lo $coffgen" ;;
sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo $coffgen" ;;
sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;

View File

@ -629,13 +629,6 @@ do
sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;;
sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo $coff" ;;
sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo $coff" ;;
sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;;
sparc_coff_vec) tb="$tb coff-sparc.lo $coffgen" ;;
sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo $coffgen" ;;
sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;

View File

@ -1,30 +0,0 @@
/* BFD backend for demonstration 64-bit a.out binaries.
Copyright (C) 1990-2018 Free Software Foundation, Inc.
Written by Cygnus Support.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#define ARCH_SIZE 64
/* 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 (aout64_,OP)
#define TARGETNAME "demo64"
#include "aoutf1.h"

View File

@ -3,12 +3,10 @@ aix5ppc-core.c
aout-arm.c
aout-cris.c
aout-ns32k.c
aout-sparcle.c
aout-target.h
aout-tic30.c
aout32.c
aout64.c
aoutf1.h
aoutx.h
archive.c
archive64.c
@ -20,7 +18,6 @@ bfdwin.c
binary.c
cache.c
cf-i386lynx.c
cf-sparclynx.c
cisco-core.c
coff-alpha.c
coff-arm.c
@ -30,7 +27,6 @@ coff-i386.c
coff-mips.c
coff-rs6000.c
coff-sh.c
coff-sparc.c
coff-stgo32.c
coff-tic30.c
coff-tic4x.c
@ -127,7 +123,6 @@ cpu-xstormy16.c
cpu-xtensa.c
cpu-z80.c
cpu-z8k.c
demo64.c
dwarf1.c
dwarf2.c
ecoff.c
@ -315,13 +310,9 @@ section.c
simple.c
som.c
som.h
sparclinux.c
sparclynx.c
sparcnetbsd.c
srec.c
stab-syms.c
stabs.c
sunos.c
syms.c
targets.c
tekhex.c

View File

@ -1,730 +0,0 @@
/* BFD back-end for linux flavored sparc a.out binaries.
Copyright (C) 1992-2018 Free Software Foundation, Inc.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#define TARGET_PAGE_SIZE 4096
#define ZMAGIC_DISK_BLOCK_SIZE 1024
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define TEXT_START_ADDR 0x0
#define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_UNKNOWN)
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
#include "libaout.h" /* BFD a.out internal data structures */
#define DEFAULT_ARCH bfd_arch_sparc
/* 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 (sparc_aout_linux_,OP)
#define TARGETNAME "a.out-sparc-linux"
extern const bfd_target MY(vec);
/* We always generate QMAGIC files in preference to ZMAGIC files. It
would be possible to make this a linker option, if that ever
becomes important. */
static void MY_final_link_callback
(bfd *, file_ptr *, file_ptr *, file_ptr *);
static bfd_boolean
sparclinux_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
obj_aout_subformat (abfd) = q_magic_format;
return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
}
#define MY_bfd_final_link sparclinux_bfd_final_link
/* Set the machine type correctly. */
static bfd_boolean
sparclinux_write_object_contents (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
N_SET_MACHTYPE (execp, M_SPARC);
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
WRITE_HEADERS (abfd, execp);
return TRUE;
}
#define MY_write_object_contents sparclinux_write_object_contents
/* Code to link against Linux a.out shared libraries. */
/* See if a symbol name is a reference to the global offset table. */
#ifndef GOT_REF_PREFIX
#define GOT_REF_PREFIX "__GOT_"
#endif
#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX))
/* See if a symbol name is a reference to the procedure linkage table. */
#ifndef PLT_REF_PREFIX
#define PLT_REF_PREFIX "__PLT_"
#endif
#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX))
/* This string is used to generate specialized error messages. */
#ifndef NEEDS_SHRLIB
#define NEEDS_SHRLIB "__NEEDS_SHRLIB_"
#endif
/* This special symbol is a set vector that contains a list of
pointers to fixup tables. It will be present in any dynamically
linked file. The linker generated fixup table should also be added
to the list, and it should always appear in the second slot (the
first one is a dummy with a magic number that is defined in
crt0.o). */
#ifndef SHARABLE_CONFLICTS
#define SHARABLE_CONFLICTS "__SHARABLE_CONFLICTS__"
#endif
/* We keep a list of fixups. The terminology is a bit strange, but
each fixup contains two 32 bit numbers. A regular fixup contains
an address and a pointer, and at runtime we should store the
address at the location pointed to by the pointer. A builtin fixup
contains two pointers, and we should read the address using one
pointer and store it at the location pointed to by the other
pointer. Builtin fixups come into play when we have duplicate
__GOT__ symbols for the same variable. The builtin fixup will copy
the GOT pointer from one over into the other. */
struct fixup
{
struct fixup *next;
struct linux_link_hash_entry *h;
bfd_vma value;
/* Nonzero if this is a jump instruction that needs to be fixed,
zero if this is just a pointer */
char jump;
char builtin;
};
/* We don't need a special hash table entry structure, but we do need
to keep some information between linker passes, so we use a special
hash table. */
struct linux_link_hash_entry
{
struct aout_link_hash_entry root;
};
struct linux_link_hash_table
{
struct aout_link_hash_table root;
/* First dynamic object found in link. */
bfd *dynobj;
/* Number of fixups. */
size_t fixup_count;
/* Number of builtin fixups. */
size_t local_builtins;
/* List of fixups. */
struct fixup *fixup_list;
};
/* Routine to create an entry in an Linux link hash table. */
static struct bfd_hash_entry *
linux_link_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
{
struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (ret == (struct linux_link_hash_entry *) NULL)
ret = ((struct linux_link_hash_entry *)
bfd_hash_allocate (table, sizeof (struct linux_link_hash_entry)));
if (ret == NULL)
return (struct bfd_hash_entry *) ret;
/* Call the allocation method of the superclass. */
ret = ((struct linux_link_hash_entry *)
NAME(aout,link_hash_newfunc) ((struct bfd_hash_entry *) ret,
table, string));
if (ret != NULL)
{
/* Set local fields; there aren't any. */
}
return (struct bfd_hash_entry *) ret;
}
/* Create a Linux link hash table. */
static struct bfd_link_hash_table *
linux_link_hash_table_create (bfd *abfd)
{
struct linux_link_hash_table *ret;
bfd_size_type amt = sizeof (struct linux_link_hash_table);
ret = (struct linux_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct linux_link_hash_table *) NULL)
return (struct bfd_link_hash_table *) NULL;
if (!NAME(aout,link_hash_table_init) (&ret->root, abfd,
linux_link_hash_newfunc,
sizeof (struct linux_link_hash_entry)))
{
free (ret);
return (struct bfd_link_hash_table *) NULL;
}
return &ret->root.root;
}
/* Look up an entry in a Linux link hash table. */
#define linux_link_hash_lookup(table, string, create, copy, follow) \
((struct linux_link_hash_entry *) \
aout_link_hash_lookup (&(table)->root, (string), (create), (copy),\
(follow)))
/* Traverse a Linux link hash table. */
#define linux_link_hash_traverse(table, func, info) \
(aout_link_hash_traverse \
(&(table)->root, \
(bfd_boolean (*) (struct aout_link_hash_entry *, void *)) (func), \
(info)))
/* Get the Linux link hash table from the info structure. This is
just a cast. */
#define linux_hash_table(p) ((struct linux_link_hash_table *) ((p)->hash))
/* Store the information for a new fixup. */
static struct fixup *
new_fixup (struct bfd_link_info *info,
struct linux_link_hash_entry *h,
bfd_vma value,
int builtin)
{
struct fixup *f;
f = (struct fixup *) bfd_hash_allocate (&info->hash->table,
sizeof (struct fixup));
if (f == NULL)
return f;
f->next = linux_hash_table (info)->fixup_list;
linux_hash_table (info)->fixup_list = f;
f->h = h;
f->value = value;
f->builtin = builtin;
f->jump = 0;
++linux_hash_table (info)->fixup_count;
return f;
}
/* We come here once we realize that we are going to link to a shared
library. We need to create a special section that contains the
fixup table, and we ultimately need to add a pointer to this into
the set vector for SHARABLE_CONFLICTS. At this point we do not
know the size of the section, but that's OK - we just need to
create it for now. */
static bfd_boolean
linux_link_create_dynamic_sections (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
flagword flags;
asection *s;
/* Note that we set the SEC_IN_MEMORY flag. */
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
/* We choose to use the name ".linux-dynamic" for the fixup table.
Why not? */
s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
s->size = 0;
s->contents = 0;
return TRUE;
}
/* Function to add a single symbol to the linker hash table. This is
a wrapper around _bfd_generic_link_add_one_symbol which handles the
tweaking needed for dynamic linking support. */
static bfd_boolean
linux_add_one_symbol (struct bfd_link_info *info,
bfd *abfd,
const char *name,
flagword flags,
asection *section,
bfd_vma value,
const char *string,
bfd_boolean copy,
bfd_boolean collect,
struct bfd_link_hash_entry **hashp)
{
struct linux_link_hash_entry *h;
bfd_boolean insert;
/* Look up and see if we already have this symbol in the hash table.
If we do, and the defining entry is from a shared library, we
need to create the dynamic sections.
FIXME: What if abfd->xvec != info->output_bfd->xvec? We may
want to be able to link Linux a.out and ELF objects together,
but serious confusion is possible. */
insert = FALSE;
if (! bfd_link_relocatable (info)
&& linux_hash_table (info)->dynobj == NULL
&& strcmp (name, SHARABLE_CONFLICTS) == 0
&& (flags & BSF_CONSTRUCTOR) != 0
&& abfd->xvec == info->output_bfd->xvec)
{
if (! linux_link_create_dynamic_sections (abfd, info))
return FALSE;
linux_hash_table (info)->dynobj = abfd;
insert = TRUE;
}
if (bfd_is_abs_section (section)
&& abfd->xvec == info->output_bfd->xvec)
{
h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE,
FALSE, FALSE);
if (h != NULL
&& (h->root.root.type == bfd_link_hash_defined
|| h->root.root.type == bfd_link_hash_defweak))
{
struct fixup *f;
if (hashp != NULL)
*hashp = (struct bfd_link_hash_entry *) h;
f = new_fixup (info, h, value, ! IS_PLT_SYM (name));
if (f == NULL)
return FALSE;
f->jump = IS_PLT_SYM (name);
return TRUE;
}
}
/* Do the usual procedure for adding a symbol. */
if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section,
value, string, copy, collect,
hashp))
return FALSE;
/* Insert a pointer to our table in the set vector. The dynamic
linker requires this information. */
if (insert)
{
asection *s;
/* Here we do our special thing to add the pointer to the
dynamic section in the SHARABLE_CONFLICTS set vector. */
s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
".linux-dynamic");
BFD_ASSERT (s != NULL);
if (! (_bfd_generic_link_add_one_symbol
(info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS,
BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL,
FALSE, FALSE, NULL)))
return FALSE;
}
return TRUE;
}
/* We will crawl the hash table and come here for every global symbol.
We will examine each entry and see if there are indications that we
need to add a fixup. There are two possible cases - one is where
you have duplicate definitions of PLT or GOT symbols - these will
have already been caught and added as "builtin" fixups. If we find
that the corresponding non PLT/GOT symbol is also present, we
convert it to a regular fixup instead.
This function is called via linux_link_hash_traverse. */
static bfd_boolean
linux_tally_symbols (struct linux_link_hash_entry *h, void * data)
{
struct bfd_link_info *info = (struct bfd_link_info *) data;
struct fixup *f, *f1;
int is_plt;
struct linux_link_hash_entry *h1, *h2;
bfd_boolean exists;
if (h->root.root.type == bfd_link_hash_undefined
&& CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB))
{
const char *name;
char *p;
char *alloc = NULL;
name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1;
p = strrchr (name, '_');
if (p != NULL)
alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1);
if (p == NULL || alloc == NULL)
_bfd_error_handler (_("output file requires shared library `%s'"),
name);
else
{
strcpy (alloc, name);
p = strrchr (alloc, '_');
*p++ = '\0';
_bfd_error_handler
/* xgettext:c-format */
(_("output file requires shared library `%s.so.%s'"),
alloc, p);
free (alloc);
}
abort ();
}
/* If this symbol is not a PLT/GOT, we do not even need to look at
it. */
is_plt = IS_PLT_SYM (h->root.root.root.string);
if (is_plt || IS_GOT_SYM (h->root.root.root.string))
{
/* Look up this symbol twice. Once just as a regular lookup,
and then again following all of the indirect links until we
reach a real symbol. */
h1 = linux_link_hash_lookup (linux_hash_table (info),
(h->root.root.root.string
+ sizeof PLT_REF_PREFIX - 1),
FALSE, FALSE, TRUE);
/* h2 does not follow indirect symbols. */
h2 = linux_link_hash_lookup (linux_hash_table (info),
(h->root.root.root.string
+ sizeof PLT_REF_PREFIX - 1),
FALSE, FALSE, FALSE);
/* The real symbol must exist but if it is also an ABS symbol,
there is no need to have a fixup. This is because they both
came from the same library. If on the other hand, we had to
use an indirect symbol to get to the real symbol, we add the
fixup anyway, since there are cases where these symbols come
from different shared libraries */
if (h1 != NULL
&& (((h1->root.root.type == bfd_link_hash_defined
|| h1->root.root.type == bfd_link_hash_defweak)
&& ! bfd_is_abs_section (h1->root.root.u.def.section))
|| h2->root.root.type == bfd_link_hash_indirect))
{
/* See if there is a "builtin" fixup already present
involving this symbol. If so, convert it to a regular
fixup. In the end, this relaxes some of the requirements
about the order of performing fixups. */
exists = FALSE;
for (f1 = linux_hash_table (info)->fixup_list;
f1 != NULL;
f1 = f1->next)
{
if ((f1->h != h && f1->h != h1)
|| (! f1->builtin && ! f1->jump))
continue;
if (f1->h == h1)
exists = TRUE;
if (! exists
&& bfd_is_abs_section (h->root.root.u.def.section))
{
f = new_fixup (info, h1, f1->h->root.root.u.def.value, 0);
f->jump = is_plt;
}
f1->h = h1;
f1->jump = is_plt;
f1->builtin = 0;
exists = TRUE;
}
if (! exists
&& bfd_is_abs_section (h->root.root.u.def.section))
{
f = new_fixup (info, h1, h->root.root.u.def.value, 0);
if (f == NULL)
{
/* FIXME: No way to return error. */
abort ();
}
f->jump = is_plt;
}
}
/* Quick and dirty way of stripping these symbols from the
symtab. */
if (bfd_is_abs_section (h->root.root.u.def.section))
h->root.written = TRUE;
}
return TRUE;
}
/* This is called to set the size of the .linux-dynamic section is.
It is called by the Linux linker emulation before_allocation
routine. We have finished reading all of the input files, and now
we just scan the hash tables to find out how many additional fixups
are required. */
bfd_boolean
bfd_sparclinux_size_dynamic_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
struct fixup *f;
asection *s;
if (output_bfd->xvec != &MY(vec))
return TRUE;
/* First find the fixups... */
linux_link_hash_traverse (linux_hash_table (info),
linux_tally_symbols,
info);
/* If there are builtin fixups, leave room for a marker. This is
used by the dynamic linker so that it knows that all that follow
are builtin fixups instead of regular fixups. */
for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
{
if (f->builtin)
{
++linux_hash_table (info)->fixup_count;
++linux_hash_table (info)->local_builtins;
break;
}
}
if (linux_hash_table (info)->dynobj == NULL)
{
if (linux_hash_table (info)->fixup_count > 0)
abort ();
return TRUE;
}
/* Allocate memory for our fixup table. We will fill it in later. */
s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
".linux-dynamic");
if (s != NULL)
{
s->size = linux_hash_table (info)->fixup_count + 1;
s->size *= 8;
s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->size);
if (s->contents == NULL)
return FALSE;
}
return TRUE;
}
/* We come here once we are ready to actually write the fixup table to
the output file. Scan the fixup tables and so forth and generate
the stuff we need. */
static bfd_boolean
linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info)
{
asection *s, *os, *is;
bfd_byte *fixup_table;
struct linux_link_hash_entry *h;
struct fixup *f;
unsigned int new_addr;
int section_offset;
unsigned int fixups_written;
if (linux_hash_table (info)->dynobj == NULL)
return TRUE;
s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
".linux-dynamic");
BFD_ASSERT (s != NULL);
os = s->output_section;
fixups_written = 0;
#ifdef LINUX_LINK_DEBUG
printf ("Fixup table file offset: %x VMA: %x\n",
os->filepos + s->output_offset,
os->vma + s->output_offset);
#endif
fixup_table = s->contents;
bfd_put_32 (output_bfd,
(bfd_vma) linux_hash_table (info)->fixup_count, fixup_table);
fixup_table += 4;
/* Fill in fixup table. */
for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
{
if (f->builtin)
continue;
if (f->h->root.root.type != bfd_link_hash_defined
&& f->h->root.root.type != bfd_link_hash_defweak)
{
_bfd_error_handler
(_("symbol %s not defined for fixups"),
f->h->root.root.root.string);
continue;
}
is = f->h->root.root.u.def.section;
section_offset = is->output_section->vma + is->output_offset;
new_addr = f->h->root.root.u.def.value + section_offset;
#ifdef LINUX_LINK_DEBUG
printf ("Fixup(%d) %s: %x %x\n",f->jump, f->h->root.root.string,
new_addr, f->value);
#endif
if (f->jump)
{
/* Relative address */
new_addr = new_addr - (f->value + 5);
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
fixup_table += 4;
bfd_put_32 (output_bfd, f->value + 1, fixup_table);
fixup_table += 4;
}
else
{
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
fixup_table += 4;
bfd_put_32 (output_bfd, f->value, fixup_table);
fixup_table += 4;
}
++fixups_written;
}
if (linux_hash_table (info)->local_builtins != 0)
{
/* Special marker so we know to switch to the other type of fixup */
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
fixup_table += 4;
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
fixup_table += 4;
++fixups_written;
for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
{
if (! f->builtin)
continue;
if (f->h->root.root.type != bfd_link_hash_defined
&& f->h->root.root.type != bfd_link_hash_defweak)
{
_bfd_error_handler
(_("symbol %s not defined for fixups"),
f->h->root.root.root.string);
continue;
}
is = f->h->root.root.u.def.section;
section_offset = is->output_section->vma + is->output_offset;
new_addr = f->h->root.root.u.def.value + section_offset;
#ifdef LINUX_LINK_DEBUG
printf ("Fixup(B) %s: %x %x\n", f->h->root.root.string,
new_addr, f->value);
#endif
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
fixup_table += 4;
bfd_put_32 (output_bfd, f->value, fixup_table);
fixup_table += 4;
++fixups_written;
}
}
if (linux_hash_table (info)->fixup_count != fixups_written)
{
_bfd_error_handler (_("warning: fixup count mismatch"));
while (linux_hash_table (info)->fixup_count > fixups_written)
{
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
fixup_table += 4;
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
fixup_table += 4;
++fixups_written;
}
}
h = linux_link_hash_lookup (linux_hash_table (info),
"__BUILTIN_FIXUPS__",
FALSE, FALSE, FALSE);
if (h != NULL
&& (h->root.root.type == bfd_link_hash_defined
|| h->root.root.type == bfd_link_hash_defweak))
{
is = h->root.root.u.def.section;
section_offset = is->output_section->vma + is->output_offset;
new_addr = h->root.root.u.def.value + section_offset;
#ifdef LINUX_LINK_DEBUG
printf ("Builtin fixup table at %x\n", new_addr);
#endif
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
}
else
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset),
SEEK_SET) != 0)
return FALSE;
if (bfd_bwrite (s->contents, s->size, output_bfd) != s->size)
return FALSE;
return TRUE;
}
#define MY_bfd_link_hash_table_create linux_link_hash_table_create
#define MY_add_one_symbol linux_add_one_symbol
#define MY_finish_dynamic_link linux_finish_dynamic_link
#define MY_zmagic_contiguous 1
#include "aout-target.h"

View File

@ -1,245 +0,0 @@
/* BFD support for Sparc binaries under LynxOS.
Copyright (C) 1990-2018 Free Software Foundation, Inc.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
/* 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 (sparc_aout_lynx_,OP)
#define TARGETNAME "a.out-sparc-lynx"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "aout/sun4.h"
#include "libaout.h" /* BFD a.out internal data structures */
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
void NAME (lynx,set_arch_mach) (bfd *, unsigned long);
static void choose_reloc_size (bfd *);
static bfd_boolean NAME (aout,sparclynx_write_object_contents) (bfd *);
/* This is needed to reject a NewsOS file, e.g. in
gdb/testsuite/gdb.t10/crossload.exp. <kingdon@cygnus.com>
I needed to add M_UNKNOWN to recognize a 68000 object, so this will
probably no longer reject a NewsOS object. <ian@cygnus.com>. */
#define MACHTYPE_OK(mtype) ( (mtype) == M_UNKNOWN \
|| (mtype) == M_68010 \
|| (mtype) == M_68020 \
|| (mtype) == M_SPARC)
/* The file @code{aoutf1.h} contains the code for BFD's
a.out back end. Control over the generated back end is given by these
two preprocessor names:
@table @code
@item ARCH_SIZE
This value should be either 32 or 64, depending upon the size of an
int in the target format. It changes the sizes of the structs which
perform the memory/disk mapping of structures.
The 64 bit backend may only be used if the host compiler supports 64
ints (eg long long with gcc), by defining the name @code{BFD_HOST_64_BIT} in @code{bfd.h}.
With this name defined, @emph{all} bfd operations are performed with 64bit
arithmetic, not just those to a 64bit target.
@item TARGETNAME
The name put into the target vector.
@item
@end table */
void
NAME(lynx,set_arch_mach) (bfd *abfd, unsigned long machtype)
{
/* Determine the architecture and machine type of the object file. */
enum bfd_architecture arch;
unsigned long machine;
switch (machtype)
{
case M_UNKNOWN:
/* Some Sun3s make magic numbers without cpu types in them, so
we'll default to the 68000. */
arch = bfd_arch_m68k;
machine = bfd_mach_m68000;
break;
case M_68010:
case M_HP200:
arch = bfd_arch_m68k;
machine = bfd_mach_m68010;
break;
case M_68020:
case M_HP300:
arch = bfd_arch_m68k;
machine = bfd_mach_m68020;
break;
case M_SPARC:
arch = bfd_arch_sparc;
machine = 0;
break;
case M_386:
case M_386_DYNIX:
arch = bfd_arch_i386;
machine = 0;
break;
case M_HPUX:
arch = bfd_arch_m68k;
machine = 0;
break;
default:
arch = bfd_arch_obscure;
machine = 0;
break;
}
bfd_set_arch_mach (abfd, arch, machine);
}
#define SET_ARCH_MACH(ABFD, EXECP) \
NAME(lynx,set_arch_mach) (ABFD, N_MACHTYPE (EXECP)); \
choose_reloc_size(ABFD);
/* Determine the size of a relocation entry, based on the architecture. */
static void
choose_reloc_size (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
case bfd_arch_sparc:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
}
/* Write an object file in LynxOS format.
Section contents have already been written. We write the
file header, symbols, and relocation. */
static bfd_boolean
NAME(aout,sparclynx_write_object_contents) (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_m68010:
N_SET_MACHTYPE (execp, M_68010);
break;
default:
case bfd_mach_m68020:
N_SET_MACHTYPE (execp, M_68020);
break;
}
break;
case bfd_arch_sparc:
N_SET_MACHTYPE (execp, M_SPARC);
break;
case bfd_arch_i386:
N_SET_MACHTYPE (execp, M_386);
break;
default:
N_SET_MACHTYPE (execp, M_UNKNOWN);
}
choose_reloc_size (abfd);
N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
WRITE_HEADERS (abfd, execp);
return TRUE;
}
#define MY_set_sizes sparclynx_set_sizes
static bfd_boolean sparclynx_set_sizes (bfd *);
static bfd_boolean
sparclynx_set_sizes (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
default:
return FALSE;
case bfd_arch_sparc:
adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x2000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return TRUE;
case bfd_arch_m68k:
adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x20000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return TRUE;
}
}
static const struct aout_backend_data sparclynx_aout_backend =
{
0, 1, 0, 1, 0, sparclynx_set_sizes, 0,
0, /* add_dynamic_symbols */
0, /* add_one_symbol */
0, /* link_dynamic_object */
0, /* write_dynamic_symbol */
0, /* check_dynamic_reloc */
0 /* finish_dynamic_link */
};
#define MY_bfd_debug_info_start _bfd_void_bfd
#define MY_bfd_debug_info_end _bfd_void_bfd
#define MY_bfd_debug_info_accumulate _bfd_void_bfd_asection
#define MY_write_object_contents NAME(aout,sparclynx_write_object_contents)
#define MY_backend_data &sparclynx_aout_backend
#define TARGET_IS_BIG_ENDIAN_P
#ifdef LYNX_CORE
char * lynx_core_file_failing_command ();
int lynx_core_file_failing_signal ();
bfd_boolean lynx_core_file_matches_executable_p ();
const bfd_target * lynx_core_file_p ();
#define MY_core_file_failing_command lynx_core_file_failing_command
#define MY_core_file_failing_signal lynx_core_file_failing_signal
#define MY_core_file_matches_executable_p lynx_core_file_matches_executable_p
#define MY_core_file_p lynx_core_file_p
#endif /* LYNX_CORE */
#include "aout-target.h"

View File

@ -1,39 +0,0 @@
/* BFD back-end for NetBSD/sparc a.out-ish binaries.
Copyright (C) 1990-2018 Free Software Foundation, Inc.
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#define TARGET_IS_BIG_ENDIAN_P
/* SPARC chips use either 4K or 8K pages, but object files always
assume 8K page alignment so they will work on either one. */
#define TARGET_PAGE_SIZE 0x2000
#define DEFAULT_ARCH bfd_arch_sparc
#define DEFAULT_MID M_SPARC_NETBSD
/* 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 (sparc_aout_nbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-sparc-netbsd"
#include "netbsd.h"

File diff suppressed because it is too large Load Diff

View File

@ -594,7 +594,6 @@ extern const bfd_target alpha_elf64_fbsd_vec;
extern const bfd_target alpha_vms_vec;
extern const bfd_target alpha_vms_lib_txt_vec;
extern const bfd_target am33_elf32_linux_vec;
extern const bfd_target aout64_vec;
extern const bfd_target aout_vec;
extern const bfd_target arc_elf32_be_vec;
extern const bfd_target arc_elf32_le_vec;
@ -807,13 +806,6 @@ extern const bfd_target sh_elf32_vxworks_vec;
extern const bfd_target sh_elf32_vxworks_le_vec;
extern const bfd_target sh_pe_le_vec;
extern const bfd_target sh_pei_le_vec;
extern const bfd_target sparc_aout_le_vec;
extern const bfd_target sparc_aout_linux_vec;
extern const bfd_target sparc_aout_lynx_vec;
extern const bfd_target sparc_aout_nbsd_vec;
extern const bfd_target sparc_aout_sunos_be_vec;
extern const bfd_target sparc_coff_vec;
extern const bfd_target sparc_coff_lynx_vec;
extern const bfd_target sparc_elf32_vec;
extern const bfd_target sparc_elf32_sol2_vec;
extern const bfd_target sparc_elf32_vxworks_vec;
@ -938,9 +930,6 @@ static const bfd_target * const _bfd_target_vector[] =
&am33_elf32_linux_vec,
#ifdef BFD64
&aout64_vec, /* Only compiled if host has long-long support. */
#endif
#if 0
/* Since a.out files lack decent magic numbers, no way to recognize
which kind of a.out file it is. */
@ -1256,13 +1245,6 @@ static const bfd_target * const _bfd_target_vector[] =
&sh_pe_le_vec,
&sh_pei_le_vec,
&sparc_aout_le_vec,
&sparc_aout_linux_vec,
&sparc_aout_lynx_vec,
&sparc_aout_nbsd_vec,
&sparc_aout_sunos_be_vec,
&sparc_coff_vec,
&sparc_coff_lynx_vec,
&sparc_elf32_vec,
&sparc_elf32_sol2_vec,
&sparc_elf32_vxworks_vec,

View File

@ -1,3 +1,8 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* testsuite/lib/binutils-common.exp: Remove sparc-aout and
sparc-coff support.
2018-04-16 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/copy-2.d: Remove m68k-aout and m68k-coff

View File

@ -66,7 +66,6 @@ proc is_elf_format {} {
&& ( [istarget *-*-netbsd*aout*]
|| [istarget *-*-netbsdpe*]
|| [istarget arm*-*-netbsd*]
|| [istarget sparc-*-netbsd*]
|| [istarget i*86-*-netbsd*]
|| [istarget vax-*-netbsd*]
|| [istarget ns32k-*-netbsd*]) } {
@ -77,8 +76,6 @@ proc is_elf_format {} {
|| [istarget i386-*-openbsd\[0-2\].*]
|| [istarget i386-*-openbsd3.\[0-2\]]
|| [istarget ns32k-*-openbsd*]
|| [istarget sparc-*-openbsd\[0-2\].*]
|| [istarget sparc-*-openbsd3.\[0-1\]]
|| [istarget vax-*-openbsd*] } {
return 0
}
@ -89,11 +86,6 @@ proc is_elf_format {} {
# True if the object format is known to be a.out.
#
proc is_aout_format {} {
if { [istarget *-*-netbsdelf]
|| [istarget sparc64-*-netbsd*]
|| [istarget sparc64-*-openbsd*] } {
return 0
}
if { [istarget *-*-*\[ab\]out*]
|| [istarget *-*-linux*oldld*]
|| [istarget *-*-bsd*]
@ -109,11 +101,6 @@ proc is_aout_format {} {
|| [istarget i?86-*-mach*]
|| [istarget ns32k-*-*]
|| [istarget pdp11-*-*]
|| [istarget sparc*-*-sunos4*]
|| [istarget sparc*-*-netbsd*]
|| [istarget sparc*-*-openbsd\[0-2\]*]
|| [istarget sparc*-*-openbsd3.\[0-1\]*]
|| [istarget sparc*-fujitsu-none]
|| [istarget vax-dec-ultrix*]
|| [istarget vax-*-netbsd] } {
return 1

View File

@ -1,3 +1,17 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove sparc-aout and sparc-coff support.
* config/obj-coff.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-sparc.h: Likewise.
* configure.tgt: Likewise.
* config/te-sparcaout.h: Delete.
* testsuite/gas/sun4/addend.d: Delete.
* testsuite/gas/sun4/addend.exp: Delete.
* testsuite/gas/sun4/addend.s: Delete.
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove m68k-aout and m68k-coff support.

View File

@ -327,7 +327,6 @@ TARG_ENV_HFILES = \
config/te-pe.h \
config/te-riscix.h \
config/te-solaris.h \
config/te-sparcaout.h \
config/te-svr4.h \
config/te-symbian.h \
config/te-tmips.h \

View File

@ -623,7 +623,6 @@ TARG_ENV_HFILES = \
config/te-pe.h \
config/te-riscix.h \
config/te-solaris.h \
config/te-sparcaout.h \
config/te-svr4.h \
config/te-symbian.h \
config/te-tmips.h \

View File

@ -48,10 +48,6 @@
#endif
#endif
#ifdef TC_SPARC
#include "coff/sparc.h"
#endif
#ifdef TC_I386
#ifdef TE_PEP
#include "coff/x86_64.h"

View File

@ -24,10 +24,8 @@
#include "opcode/sparc.h"
#include "dw2gencfi.h"
#ifdef OBJ_ELF
#include "elf/sparc.h"
#include "dwarf2dbg.h"
#endif
/* Some ancient Sun C compilers would not take such hex constants as
unsigned, and would end up sign-extending them to form an offsetT,
@ -70,7 +68,6 @@ static int sparc_arch_size;
changes the value before md_show_usage is called. */
static int default_arch_size;
#ifdef OBJ_ELF
/* The currently selected v9 memory model. Currently only used for
ELF. */
static enum { MM_TSO, MM_PSO, MM_RMO } sparc_memory_model = MM_RMO;
@ -80,7 +77,6 @@ static enum { MM_TSO, MM_PSO, MM_RMO } sparc_memory_model = MM_RMO;
GNU attributes section with hwcap information. */
static bfd_uint64_t hwcap_seen;
#endif
#endif
static bfd_uint64_t hwcap_allowed;
@ -140,9 +136,7 @@ static void s_common (int);
static void s_empty (int);
static void s_uacons (int);
static void s_ncons (int);
#ifdef OBJ_ELF
static void s_register (int);
#endif
const pseudo_typeS md_pseudo_table[] =
{
@ -162,13 +156,11 @@ const pseudo_typeS md_pseudo_table[] =
{"uahalf", s_uacons, 2},
{"uaword", s_uacons, 4},
{"uaxword", s_uacons, 8},
#ifdef OBJ_ELF
/* These are specific to sparc/svr4. */
{"2byte", s_uacons, 2},
{"4byte", s_uacons, 4},
{"8byte", s_uacons, 8},
{"register", s_register, 0},
#endif
{NULL, 0, 0},
};
@ -348,40 +340,11 @@ sparc_target_format (void)
if (! default_init_p)
init_default_arch ();
#ifdef OBJ_AOUT
#ifdef TE_NetBSD
return "a.out-sparc-netbsd";
#else
#ifdef TE_SPARCAOUT
if (target_big_endian)
return "a.out-sunos-big";
else if (default_arch_type == sparc86x && target_little_endian_data)
return "a.out-sunos-big";
else
return "a.out-sparc-little";
#else
return "a.out-sunos-big";
#endif
#endif
#endif
#ifdef OBJ_COFF
#ifdef TE_LYNX
return "coff-sparc-lynx";
#else
return "coff-sparc";
#endif
#endif
#ifdef TE_VXWORKS
return "elf32-sparc-vxworks";
#endif
#ifdef OBJ_ELF
return sparc_arch_size == 64 ? ELF64_TARGET_FORMAT : ELF_TARGET_FORMAT;
#endif
abort ();
}
/* md_parse_option
@ -438,15 +401,7 @@ sparc_target_format (void)
* error. For example, from sparclite to v9.
*/
#ifdef OBJ_ELF
const char *md_shortopts = "A:K:VQ:sq";
#else
#ifdef OBJ_AOUT
const char *md_shortopts = "A:k";
#else
const char *md_shortopts = "A:";
#endif
#endif
struct option md_longopts[] = {
#define OPTION_BUMP (OPTION_MD_BASE)
{"bump", no_argument, NULL, OPTION_BUMP},
@ -454,7 +409,6 @@ struct option md_longopts[] = {
{"sparc", no_argument, NULL, OPTION_SPARC},
#define OPTION_XARCH (OPTION_MD_BASE + 2)
{"xarch", required_argument, NULL, OPTION_XARCH},
#ifdef OBJ_ELF
#define OPTION_32 (OPTION_MD_BASE + 3)
{"32", no_argument, NULL, OPTION_32},
#define OPTION_64 (OPTION_MD_BASE + 4)
@ -465,7 +419,6 @@ struct option md_longopts[] = {
{"PSO", no_argument, NULL, OPTION_PSO},
#define OPTION_RMO (OPTION_MD_BASE + 7)
{"RMO", no_argument, NULL, OPTION_RMO},
#endif
#ifdef SPARC_BIENDIAN
#define OPTION_LITTLE_ENDIAN (OPTION_MD_BASE + 8)
{"EL", no_argument, NULL, OPTION_LITTLE_ENDIAN},
@ -476,12 +429,10 @@ struct option md_longopts[] = {
{"enforce-aligned-data", no_argument, NULL, OPTION_ENFORCE_ALIGNED_DATA},
#define OPTION_LITTLE_ENDIAN_DATA (OPTION_MD_BASE + 11)
{"little-endian-data", no_argument, NULL, OPTION_LITTLE_ENDIAN_DATA},
#ifdef OBJ_ELF
#define OPTION_NO_UNDECLARED_REGS (OPTION_MD_BASE + 12)
{"no-undeclared-regs", no_argument, NULL, OPTION_NO_UNDECLARED_REGS},
#define OPTION_UNDECLARED_REGS (OPTION_MD_BASE + 13)
{"undeclared-regs", no_argument, NULL, OPTION_UNDECLARED_REGS},
#endif
#define OPTION_RELAX (OPTION_MD_BASE + 14)
{"relax", no_argument, NULL, OPTION_RELAX},
#define OPTION_NO_RELAX (OPTION_MD_BASE + 15)
@ -509,7 +460,6 @@ md_parse_option (int c, const char *arg)
break;
case OPTION_XARCH:
#ifdef OBJ_ELF
if (!strncmp (arg, "v9", 2))
md_parse_option (OPTION_64, NULL);
else
@ -522,7 +472,6 @@ md_parse_option (int c, const char *arg)
|| !strcmp (arg, "sparc86x"))
md_parse_option (OPTION_32, NULL);
}
#endif
/* Fall through. */
case 'A':
@ -588,13 +537,6 @@ md_parse_option (int c, const char *arg)
break;
#endif
#ifdef OBJ_AOUT
case 'k':
sparc_pic_code = 1;
break;
#endif
#ifdef OBJ_ELF
case OPTION_32:
case OPTION_64:
{
@ -669,7 +611,6 @@ md_parse_option (int c, const char *arg)
case OPTION_UNDECLARED_REGS:
no_undeclared_regs = 0;
break;
#endif
case OPTION_RELAX:
sparc_relax = 1;
@ -737,11 +678,6 @@ md_show_usage (FILE *stream)
--enforce-aligned-data force .long, etc., to be aligned correctly\n\
-relax relax jumps and branches (default)\n\
-no-relax avoid changing any jumps and branches\n"));
#ifdef OBJ_AOUT
fprintf (stream, _("\
-k generate PIC\n"));
#endif
#ifdef OBJ_ELF
fprintf (stream, _("\
-32 create 32 bit object file\n\
-64 create 64 bit object file\n"));
@ -764,7 +700,6 @@ md_show_usage (FILE *stream)
-q ignored\n\
-Qy, -Qn ignored\n\
-s ignored\n"));
#endif
#ifdef SPARC_BIENDIAN
fprintf (stream, _("\
-EL generate code for a little endian machine\n\
@ -1158,7 +1093,7 @@ void
sparc_md_end (void)
{
unsigned long mach;
#if defined(OBJ_ELF) && !defined(TE_SOLARIS)
#ifndef TE_SOLARIS
int hwcaps, hwcaps2;
#endif
@ -1195,7 +1130,7 @@ sparc_md_end (void)
}
bfd_set_arch_mach (stdoutput, bfd_arch_sparc, mach);
#if defined(OBJ_ELF) && !defined(TE_SOLARIS)
#ifndef TE_SOLARIS
hwcaps = hwcap_seen & U0xffffffff;
hwcaps2 = hwcap_seen >> 32;
@ -3247,7 +3182,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
bfd_uint64_t hwcaps
= (((bfd_uint64_t) insn->hwcaps2) << 32) | insn->hwcaps;
#if defined(OBJ_ELF) && !defined(TE_SOLARIS)
#ifndef TE_SOLARIS
if (hwcaps)
hwcap_seen |= hwcaps;
#endif
@ -3490,9 +3425,7 @@ output_insn (const struct sparc_opcode *insn, struct sparc_it *theinsn)
last_insn = insn;
last_opcode = theinsn->opcode;
#ifdef OBJ_ELF
dwarf2_emit_insn (4);
#endif
}
const char *
@ -3532,7 +3465,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
fixP->fx_addnumber = val; /* Remember value for emit_reloc. */
#ifdef OBJ_ELF
/* SPARC ELF relocations don't use an addend in the data field. */
if (fixP->fx_addsy != NULL)
{
@ -3570,7 +3502,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
return;
}
#endif
/* This is a hack. There should be a better way to
handle this. Probably in terms of howto fields, once
@ -3578,45 +3509,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
if (fixP->fx_r_type == BFD_RELOC_32_PCREL_S2 && fixP->fx_addsy)
val += fixP->fx_where + fixP->fx_frag->fr_address;
#ifdef OBJ_AOUT
/* FIXME: More ridiculous gas reloc hacking. If we are going to
generate a reloc, then we just want to let the reloc addend set
the value. We do not want to also stuff the addend into the
object file. Including the addend in the object file works when
doing a static link, because the linker will ignore the object
file contents. However, the dynamic linker does not ignore the
object file contents. */
if (fixP->fx_addsy != NULL
&& fixP->fx_r_type != BFD_RELOC_32_PCREL_S2)
val = 0;
/* When generating PIC code, we do not want an addend for a reloc
against a local symbol. We adjust fx_addnumber to cancel out the
value already included in val, and to also cancel out the
adjustment which bfd_install_relocation will create. */
if (sparc_pic_code
&& fixP->fx_r_type != BFD_RELOC_32_PCREL_S2
&& fixP->fx_addsy != NULL
&& ! S_IS_COMMON (fixP->fx_addsy)
&& symbol_section_p (fixP->fx_addsy))
fixP->fx_addnumber -= 2 * S_GET_VALUE (fixP->fx_addsy);
/* When generating PIC code, we need to fiddle to get
bfd_install_relocation to do the right thing for a PC relative
reloc against a local symbol which we are going to keep. */
if (sparc_pic_code
&& fixP->fx_r_type == BFD_RELOC_32_PCREL_S2
&& fixP->fx_addsy != NULL
&& (S_IS_EXTERNAL (fixP->fx_addsy)
|| S_IS_WEAK (fixP->fx_addsy))
&& S_IS_DEFINED (fixP->fx_addsy)
&& ! S_IS_COMMON (fixP->fx_addsy))
{
val = 0;
fixP->fx_addnumber -= 2 * S_GET_VALUE (fixP->fx_addsy);
}
#endif
/* If this is a data relocation, just output VAL. */
if (fixP->fx_r_type == BFD_RELOC_8)
@ -4054,21 +3946,16 @@ tc_gen_reloc (asection *section, fixS *fixp)
return NULL;
}
#if defined (OBJ_ELF) || defined (OBJ_AOUT)
/* If we are generating PIC code, we need to generate a different
set of relocs. */
#ifdef OBJ_ELF
#define GOT_NAME "_GLOBAL_OFFSET_TABLE_"
#else
#define GOT_NAME "__GLOBAL_OFFSET_TABLE_"
#endif
#ifdef TE_VXWORKS
#define GOTT_BASE "__GOTT_BASE__"
#define GOTT_INDEX "__GOTT_INDEX__"
#endif
/* This code must be parallel to the OBJ_ELF tc_fix_adjustable. */
/* This code must be parallel to tc_fix_adjustable. */
if (sparc_pic_code)
{
@ -4111,7 +3998,6 @@ tc_gen_reloc (asection *section, fixS *fixp)
break;
}
}
#endif /* defined (OBJ_ELF) || defined (OBJ_AOUT) */
/* Nothing is aligned in DWARF debugging sections. */
if (bfd_get_section_flags (stdoutput, section) & SEC_DEBUGGING)
@ -4138,25 +4024,6 @@ tc_gen_reloc (asection *section, fixS *fixp)
}
/* @@ Why fx_addnumber sometimes and fx_offset other times? */
#ifdef OBJ_AOUT
if (reloc->howto->pc_relative == 0
|| code == BFD_RELOC_SPARC_PC10
|| code == BFD_RELOC_SPARC_PC22)
reloc->addend = fixp->fx_addnumber;
else if (sparc_pic_code
&& fixp->fx_r_type == BFD_RELOC_32_PCREL_S2
&& fixp->fx_addsy != NULL
&& (S_IS_EXTERNAL (fixp->fx_addsy)
|| S_IS_WEAK (fixp->fx_addsy))
&& S_IS_DEFINED (fixp->fx_addsy)
&& ! S_IS_COMMON (fixp->fx_addsy))
reloc->addend = fixp->fx_addnumber;
else
reloc->addend = fixp->fx_offset - reloc->address;
#else /* elf or coff */
if (code != BFD_RELOC_32_PCREL_S2
&& code != BFD_RELOC_SPARC_WDISP22
&& code != BFD_RELOC_SPARC_WDISP16
@ -4172,7 +4039,6 @@ tc_gen_reloc (asection *section, fixS *fixp)
+ md_pcrel_from (fixp));
else
reloc->addend = fixp->fx_offset;
#endif
/* We expand R_SPARC_OLO10 to R_SPARC_LO10 and R_SPARC_13
on the same location. */
@ -4205,20 +4071,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
valueT
md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
{
#ifndef OBJ_ELF
/* This is not right for ELF; a.out wants it, and COFF will force
the alignment anyways. */
valueT align = ((valueT) 1
<< (valueT) bfd_get_section_alignment (stdoutput, segment));
valueT newsize;
/* Turn alignment value into a mask. */
align--;
newsize = (size + align) & ~align;
return newsize;
#else
return size;
#endif
}
/* Exactly what point is a PC-relative offset relative TO?
@ -4257,10 +4110,6 @@ mylog2 (int value)
/* Sort of like s_lcomm. */
#ifndef OBJ_ELF
static int max_alignment = 15;
#endif
static void
s_reserve (int ignore ATTRIBUTE_UNUSED)
{
@ -4324,14 +4173,6 @@ s_reserve (int ignore ATTRIBUTE_UNUSED)
align = (int) get_absolute_expression ();
#ifndef OBJ_ELF
if (align > max_alignment)
{
align = max_alignment;
as_warn (_("alignment too large; assuming %d"), align);
}
#endif
if (align < 0)
{
as_bad (_("negative alignment"));
@ -4357,12 +4198,7 @@ s_reserve (int ignore ATTRIBUTE_UNUSED)
else
align = 0;
if (!S_IS_DEFINED (symbolP)
#ifdef OBJ_AOUT
&& S_GET_OTHER (symbolP) == 0
&& S_GET_DESC (symbolP) == 0
#endif
)
if (!S_IS_DEFINED (symbolP))
{
if (! need_pass_2)
{
@ -4390,9 +4226,7 @@ s_reserve (int ignore ATTRIBUTE_UNUSED)
subseg_set (current_seg, current_subseg);
#ifdef OBJ_ELF
S_SET_SIZE (symbolP, size);
#endif
}
}
else
@ -4453,13 +4287,6 @@ s_common (int ignore ATTRIBUTE_UNUSED)
S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), (long) size);
}
}
else
{
#ifndef OBJ_ELF
S_SET_VALUE (symbolP, (valueT) size);
S_SET_EXTERNAL (symbolP);
#endif
}
know (symbol_get_frag (symbolP) == &zero_address_frag);
if (*input_line_pointer != ',')
{
@ -4473,14 +4300,6 @@ s_common (int ignore ATTRIBUTE_UNUSED)
{
temp = get_absolute_expression ();
#ifndef OBJ_ELF
if (temp > max_alignment)
{
temp = max_alignment;
as_warn (_("alignment too large; assuming %ld"), (long) temp);
}
#endif
if (temp < 0)
{
as_bad (_("negative alignment"));
@ -4488,7 +4307,6 @@ s_common (int ignore ATTRIBUTE_UNUSED)
return;
}
#ifdef OBJ_ELF
if (symbol_get_obj (symbolP)->local)
{
segT old_sec;
@ -4526,14 +4344,11 @@ s_common (int ignore ATTRIBUTE_UNUSED)
subseg_set (old_sec, old_subsec);
}
else
#endif /* OBJ_ELF */
{
allocate_common:
S_SET_VALUE (symbolP, (valueT) size);
#ifdef OBJ_ELF
S_SET_ALIGN (symbolP, temp);
S_SET_SIZE (symbolP, size);
#endif
S_SET_EXTERNAL (symbolP);
S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
}
@ -4669,7 +4484,6 @@ s_ncons (int bytes ATTRIBUTE_UNUSED)
cons (sparc_arch_size == 32 ? 4 : 8);
}
#ifdef OBJ_ELF
/* Handle the SPARC ELF .register pseudo-op. This sets the binding of a
global register.
The syntax is:
@ -4782,7 +4596,6 @@ sparc_adjust_symtab (void)
S_SET_SEGMENT (sym, undefined_section);
}
}
#endif
/* If the --enforce-aligned-data option is used, we require .word,
et. al., to be aligned correctly. We do it by setting up an
@ -4882,7 +4695,6 @@ sparc_handle_align (fragS *fragp)
}
}
#ifdef OBJ_ELF
/* Some special processing for a Sparc ELF file. */
void
@ -5048,8 +4860,6 @@ sparc_cons (expressionS *exp, int size)
return sparc_cons_special_reloc;
}
#endif
/* This is called by emit_expr via TC_CONS_FIX_NEW when creating a
reloc for a cons. We could use the definition there, except that
we want to handle little endian relocs specially. */

View File

@ -82,29 +82,6 @@ extern void sparc_handle_align (struct frag *);
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
/* I know that "call 0" fails in sparc-coff if this doesn't return 1. I
don't know about other relocation types, or other formats, yet. */
#ifdef OBJ_COFF
#define TC_FORCE_RELOCATION_ABS(FIX) \
((FIX)->fx_r_type == BFD_RELOC_32_PCREL_S2 \
|| TC_FORCE_RELOCATION (FIX))
#define RELOC_REQUIRES_SYMBOL
#endif
#ifdef OBJ_AOUT
/* This expression evaluates to true if the relocation is for a local
object for which we still want to do the relocation at runtime.
False if we are willing to perform this relocation while building
the .o file. */
#define TC_FORCE_RELOCATION_LOCAL(FIX) \
(GENERIC_FORCE_RELOCATION_LOCAL (FIX) \
|| (sparc_pic_code \
&& S_IS_EXTERNAL ((FIX)->fx_addsy)))
#endif
#ifdef OBJ_ELF
/* Don't turn certain relocs into relocations against sections. This
is required for the dynamic linker to operate properly. When
generating PIC, we need to keep any non PC relative reloc. The PIC
@ -142,21 +119,6 @@ extern void sparc_adjust_symtab (void);
|| (FIX)->fx_r_type == BFD_RELOC_32 \
|| (FIX)->fx_r_type == BFD_RELOC_16 \
|| (FIX)->fx_r_type == BFD_RELOC_8))
#endif
#ifdef OBJ_AOUT
/* When generating PIC code, we must not adjust any reloc which will
turn into a reloc against the global offset table, nor any reloc
which we will need if a symbol is overridden. */
#define tc_fix_adjustable(FIX) \
(! sparc_pic_code \
|| ((FIX)->fx_pcrel \
&& ((FIX)->fx_addsy == NULL \
|| (! S_IS_EXTERNAL ((FIX)->fx_addsy) \
&& ! S_IS_WEAK ((FIX)->fx_addsy)))) \
|| (FIX)->fx_r_type == BFD_RELOC_16 \
|| (FIX)->fx_r_type == BFD_RELOC_32)
#endif
#define elf_tc_final_processing sparc_elf_final_processing
extern void sparc_elf_final_processing (void);
@ -166,15 +128,11 @@ extern void sparc_elf_final_processing (void);
extern void sparc_md_end (void);
#define md_end() sparc_md_end ()
#endif
#define TC_PARSE_CONS_RETURN_TYPE const char *
#define TC_PARSE_CONS_RETURN_NONE NULL
#ifdef OBJ_ELF
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) sparc_cons (EXP, NBYTES)
extern const char *sparc_cons (expressionS *, int);
#endif
#define TC_CONS_FIX_NEW cons_fix_new_sparc
extern void cons_fix_new_sparc
@ -220,4 +178,4 @@ extern int sparc_cie_data_alignment;
this, BFD_RELOC_32_PCREL will be emitted directly instead. */
#define CFI_DIFF_EXPR_OK 0
/* end of tc-sparc.h */
#endif

View File

@ -1,22 +0,0 @@
/* te-sparcaout.h -- embedded sparc-aout target environment declarations.
Copyright (C) 1996-2018 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 3, 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, 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1301, USA. */
#define TE_SPARCAOUT 1
#include "obj-format.h"

View File

@ -412,28 +412,9 @@ case ${generic_target} in
sh-*-kaos*) fmt=elf ;;
shle*-*-kaos*) fmt=elf ;;
sparc-*-sunos4*) fmt=aout em=sun3 ;;
sparc-*-aout) fmt=aout em=sparcaout ;;
sparc-*-coff) fmt=coff ;;
sparc-*-linux*aout*) fmt=aout em=linux ;;
sparc-*-linux-*) fmt=elf em=linux ;;
sparc-fujitsu-none) fmt=aout ;;
sparc-*-elf) fmt=elf ;;
sparc-*-sysv4*) fmt=elf ;;
sparc-*-solaris*) fmt=elf em=solaris ;;
sparc-*-netbsdelf*) fmt=elf em=nbsd ;;
sparc-*-netbsd*)
case ${cpu} in
sparc64) fmt=elf em=nbsd ;;
*) fmt=aout em=nbsd ;;
esac ;;
sparc-*-openbsd[0-2].* | \
sparc-*-openbsd3.[0-1])
case ${cpu} in
sparc64) fmt=elf em=nbsd ;;
*) fmt=aout em=nbsd ;;
esac ;;
sparc-*-openbsd*) fmt=elf em=nbsd ;;
sparc-*-*bsd*) fmt=elf em=nbsd ;;
spu-*-elf) fmt=elf ;;

View File

@ -202,7 +202,6 @@ config/te-pc532mach.h
config/te-pe.h
config/te-riscix.h
config/te-solaris.h
config/te-sparcaout.h
config/te-svr4.h
config/te-symbian.h
config/te-tmips.h

View File

@ -1,13 +0,0 @@
#objdump: -r
# name : addends
.*: +file format a.out-sunos-big
RELOCATION RECORDS FOR \[.text\]:
OFFSET TYPE +VALUE
0+08 WDISP22 +foo1\+0xf+fc
0+0c WDISP22 +foo1\+0xf+f8
0+10 WDISP22 +foo1\+0xf+f0
0+14 WDISP22 +foo1\+0xf+ec
0+1c 32 +foo1
0+20 32 +foo1\+0x0+4
#0+20 32 +foo1\+0x0+4

View File

@ -1,23 +0,0 @@
# Copyright (C) 2012-2018 Free Software Foundation, Inc.
# 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# SunOS4 on SPARC tests
#
if [istarget sparc-*-sunos4*] then {
run_dump_test "addend"
}

View File

@ -1,11 +0,0 @@
.global foo
foo:
nop
nop
ba foo1+0x4
ba foo1+0x4
ba foo1
ba foo1
nop
.word foo1
.word foo1+4

View File

@ -1,3 +1,20 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove sparc-aout and sparc-coff support.
* configure.tgt: Likewise.
* testsuite/ld-elfvers/vers.exp: Likewise.
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-shared/shared.exp: Likewise.
* emulparams/coff_sparc.sh: Delete.
* emulparams/sparcaout.sh: Delete.
* emulparams/sparclinux.sh: Delete.
* emulparams/sparcnbsd.sh: Delete.
* emulparams/sun4.sh: Delete.
* scripttempl/sparccoff.sc: Delete.
* Makefile.in: Regenerate.
* po/BLD-POTFILES.in: Regenerate.
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove m68k-aout and m68k-coff support.

View File

@ -209,7 +209,6 @@ ALL_EMULATION_SOURCES = \
eavrxmega6.c \
eavrxmega7.c \
eavrtiny.c \
ecoff_sparc.c \
ecrisaout.c \
ecriself.c \
ecrislinux.c \
@ -372,10 +371,6 @@ ALL_EMULATION_SOURCES = \
eshlelf_nto.c \
eshlelf_vxworks.c \
eshpe.c \
esparcaout.c \
esparclinux.c \
esparcnbsd.c \
esun4.c \
etic30aout.c \
etic30coff.c \
etic3xcoff.c \
@ -879,9 +874,6 @@ eavrtiny.c: $(srcdir)/emulparams/avrtiny.sh \
$(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS}
@ -1652,18 +1644,6 @@ eshlelf_vxworks.c: $(srcdir)/emulparams/shlelf_vxworks.sh \
eshpe.c: $(srcdir)/emulparams/shpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
esun4.c: $(srcdir)/emulparams/sun4.sh \
$(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30aout.sc ${GEN_DEPENDS}

View File

@ -578,7 +578,6 @@ ALL_EMULATION_SOURCES = \
eavrxmega6.c \
eavrxmega7.c \
eavrtiny.c \
ecoff_sparc.c \
ecrisaout.c \
ecriself.c \
ecrislinux.c \
@ -741,10 +740,6 @@ ALL_EMULATION_SOURCES = \
eshlelf_nto.c \
eshlelf_vxworks.c \
eshpe.c \
esparcaout.c \
esparclinux.c \
esparcnbsd.c \
esun4.c \
etic30aout.c \
etic30coff.c \
etic3xcoff.c \
@ -1140,7 +1135,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eavrxmega5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eavrxmega6.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eavrxmega7.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecoff_sparc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecrisaout.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecriself.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecrislinux.Po@am__quote@
@ -1364,10 +1358,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eshlelf_nto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eshlelf_vxworks.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eshpe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esparcaout.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esparclinux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esparcnbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esun4.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etic30aout.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etic30coff.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etic3xcoff.Po@am__quote@
@ -2395,9 +2385,6 @@ eavrtiny.c: $(srcdir)/emulparams/avrtiny.sh \
$(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS}
@ -3168,18 +3155,6 @@ eshlelf_vxworks.c: $(srcdir)/emulparams/shlelf_vxworks.sh \
eshpe.c: $(srcdir)/emulparams/shpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
esun4.c: $(srcdir)/emulparams/sun4.sh \
$(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30aout.sc ${GEN_DEPENDS}

View File

@ -702,45 +702,27 @@ sh-*-nto*) targ_emul=shelf_nto
sh-*-pe) targ_emul=shpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
sh-*-*) targ_emul=sh; targ_extra_emuls=shl ;;
sparc64-*-aout*) targ_emul=sparcaout ;;
sparc64-*-elf* | sparc64-*-rtems*)
targ_emul=elf64_sparc ;;
sparc-sun-sunos4*) targ_emul=sun4 ;;
sparclite*-*-elf) targ_emul=elf32_sparc ;;
sparclite*-*-coff) targ_emul=coff_sparc ;;
sparclite*-fujitsu-*) targ_emul=sparcaout ;;
sparc*-*-aout) targ_emul=sparcaout ;;
sparc*-*-coff) targ_emul=coff_sparc ;;
sparc*-*-elf | sparc-*-rtems*)
targ_emul=elf32_sparc ;;
sparc*-*-sysv4*) targ_emul=elf32_sparc ;;
sparc*-*-vxworks*) targ_emul=elf32_sparc_vxworks ;;
sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
targ_emul=elf64_sparc_fbsd
targ_extra_emuls="elf64_sparc elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
sparc*-*-linux*aout*) targ_emul=sparclinux
targ_extra_emuls="elf32_sparc sun4"
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
tdir_sun4=sparc-sun-sunos4 ;;
sparc64-*-linux-*) targ_emul=elf64_sparc
targ_extra_emuls="elf32_sparc sparclinux sun4"
targ_extra_emuls="elf32_sparc"
targ_extra_libpath=elf32_sparc
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
tdir_sparclinux=${tdir_elf32_sparc}aout
tdir_sun4=sparc-sun-sunos4 ;;
sparc*-*-linux-*) targ_emul=elf32_sparc
targ_extra_emuls="sparclinux elf64_sparc sun4"
targ_extra_libpath=elf64_sparc
tdir_sparclinux=${targ_alias}aout
tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
tdir_sun4=sparc-sun-sunos4 ;;
sparc64-*-netbsd* | sparc64-*-openbsd*)
targ_emul=elf64_sparc
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
sparc64-*-*bsd*) targ_emul=elf64_sparc
targ_extra_emuls="elf32_sparc" ;;
sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;;
sparc*-*-netbsd*) targ_emul=sparcnbsd ;;
sparc64-*-solaris2* | sparcv9-*-solaris2*)
targ_emul=elf64_sparc_sol2
targ_extra_emuls="elf64_sparc elf32_sparc_sol2 elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
sparc64-*-*) targ_emul=elf64_sparc ;;
sparc*-*-linux-*) targ_emul=elf32_sparc
targ_extra_emuls="elf64_sparc"
targ_extra_libpath=elf64_sparc
tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'` ;;
sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
targ_emul=elf32_sparc_sol2
targ_extra_emuls=elf32_sparc ;;
@ -748,13 +730,8 @@ sparc-*-solaris2*) targ_emul=elf32_sparc_sol2
targ_extra_emuls="elf32_sparc elf64_sparc_sol2 elf64_sparc"
targ_extra_libpath=$targ_extra_emuls
tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'` ;;
sparcv9-*-solaris2* | sparc64-*-solaris2*)
targ_emul=elf64_sparc_sol2
targ_extra_emuls="elf64_sparc elf32_sparc_sol2 elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
sparc*-*-solaris2*) targ_emul=elf32_sparc ;;
sparc*-wrs-vxworks*) targ_emul=sparcaout ;;
sparc*-*-vxworks*) targ_emul=elf32_sparc_vxworks ;;
sparc*-*-*) targ_emul=elf32_sparc ;;
spu-*-elf*) targ_emul=elf32_spu ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
tic30-*-*coff*) targ_emul=tic30coff ;;

View File

@ -1,9 +0,0 @@
SCRIPT_NAME=sparccoff
OUTPUT_FORMAT="coff-sparc"
# following are dubious (borrowed from sparc lynx)
TARGET_PAGE_SIZE=0x1000
TEXT_START_ADDR=0
case ${LD_FLAG} in
n|N) TEXT_START_ADDR=0x1000 ;;
esac
ARCH=sparc

View File

@ -1,10 +0,0 @@
SCRIPT_NAME=aout
OUTPUT_FORMAT="a.out-sunos-big"
BIG_OUTPUT_FORMAT="a.out-sunos-big"
LITTLE_OUTPUT_FORMAT="a.out-sparc-little"
TEXT_START_ADDR=0x2020
case ${LD_FLAG} in
n|N) TEXT_START_ADDR=0x2000 ;;
esac
TARGET_PAGE_SIZE=0x2000
ARCH=sparc

View File

@ -1,9 +0,0 @@
SCRIPT_NAME=aout
OUTPUT_FORMAT="a.out-sparc-linux"
TARGET_PAGE_SIZE=0x1000
TEXT_START_ADDR=0x1020
case ${LD_FLAG} in
n|N) TEXT_START_ADDR=0 ;;
esac
ARCH=sparc
TEMPLATE_NAME=linux

View File

@ -1,5 +0,0 @@
SCRIPT_NAME=aout
TEXT_START_ADDR=0x1020
OUTPUT_FORMAT="a.out-sparc-netbsd"
TARGET_PAGE_SIZE=0x1000
ARCH=sparc

View File

@ -1,7 +0,0 @@
SCRIPT_NAME=aout
OUTPUT_FORMAT="a.out-sunos-big"
TEXT_START_ADDR=0x2020
TARGET_PAGE_SIZE=0x2000
ALIGNMENT=8
ARCH=sparc
TEMPLATE_NAME=sunos

View File

@ -66,7 +66,6 @@ eavrxmega4.c
eavrxmega5.c
eavrxmega6.c
eavrxmega7.c
ecoff_sparc.c
ecrisaout.c
ecriself.c
ecrislinux.c
@ -290,10 +289,6 @@ eshlelf_nbsd.c
eshlelf_nto.c
eshlelf_vxworks.c
eshpe.c
esparcaout.c
esparclinux.c
esparcnbsd.c
esun4.c
etic30aout.c
etic30coff.c
etic3xcoff.c

View File

@ -1,62 +0,0 @@
# Linker script for Sparc COFF.
# Based on i386coff.sc by Ian Taylor <ian@cygnus.com>.
#
# Copyright (C) 2014-2018 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
test -z "$ENTRY" && ENTRY=_start
cat <<EOF
/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
${LIB_SEARCH_DIRS}
${RELOCATING+ENTRY (${ENTRY})}
SECTIONS
{
.text ${RELOCATING+ SIZEOF_HEADERS} : {
*(.init)
*(.text)
${RELOCATING+ etext = .;}
${CONSTRUCTING+ ___CTOR_LIST__ = .;}
${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
${CONSTRUCTING+ *(.ctors)}
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ ___CTOR_END__ = .;}
${CONSTRUCTING+ ___DTOR_LIST__ = .;}
${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)}
${CONSTRUCTING+ *(.dtors)}
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ ___DTOR_END__ = .;}
*(.fini)
${RELOCATING+ etext = .};
}
.data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : {
*(.data)
${RELOCATING+ edata = .};
}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
*(.bss)
*(COMMON)
${RELOCATING+ end = .};
}
.stab 0 ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
}
.stabstr 0 ${RELOCATING+(NOLOAD)} :
{
[ .stabstr ]
}
}
EOF

View File

@ -93,11 +93,7 @@ if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
|| [string match "*option ignored*" $exec_output]
|| [string match "*unrecognized option*" $exec_output]
|| [string match "*passed to ld*" $exec_output] } {
if [istarget *-*-sunos4*] {
set picflag "-pic"
} else {
set picflag "-KPIC"
}
set picflag "-KPIC"
}
}

View File

@ -299,8 +299,6 @@ proc visibility_run {visibility} {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
}
} else {
setup_xfail "*-*-sunos4*"
}
# Non-pic code uses name binding rules for applications to
@ -342,9 +340,6 @@ proc visibility_run {visibility} {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
}
} else {
setup_xfail "*-*-sunos4*"
setup_xfail "*-*-linux*libc1"
}
if { [ string match $visibility "hidden_normal" ]
|| [ string match $visibility "hidden_weak" ]
@ -392,14 +387,11 @@ proc visibility_run {visibility} {
setup_xfail $target_triplet
}
}
# SunOS can not compare function pointers correctly
if [istarget "*-*-sunos4*"] {
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o sun4
} else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
} else {
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb $COMPRESS_LDFLAG
} }
}
}
}}
@ -423,8 +415,6 @@ proc visibility_run {visibility} {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
}
} else {
setup_xfail "*-*-sunos4*"
}
if { ![ string match $visibility "hidden_undef" ]
&& ![ string match $visibility "protected_undef" ] } {
@ -493,11 +483,7 @@ if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
|| [string match "*option ignored*" $exec_output] \
|| [string match "*unrecognized option*" $exec_output] \
|| [string match "*passed to ld*" $exec_output] } {
if [istarget *-*-sunos4*] {
set picflag "-pic"
} else {
set picflag "-KPIC"
}
set picflag "-KPIC"
}
}
verbose "Using $picflag to compile PIC code"

View File

@ -384,11 +384,7 @@ if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
|| [string match "*option ignored*" $exec_output]
|| [string match "*unrecognized option*" $exec_output]
|| [string match "*passed to ld*" $exec_output] } {
if [istarget *-*-sunos4*] {
set picflag "-pic"
} else {
set picflag "-KPIC"
}
set picflag "-KPIC"
}
}
verbose "Using $picflag to compile PIC code"

View File

@ -50,7 +50,6 @@ if { ![istarget hppa*64*-*-hpux*] \
&& ![istarget powerpc*-*-sysv4*] \
&& ![istarget sparc*-*-elf] \
&& ![istarget sparc*-*-solaris2*] \
&& ![istarget sparc*-*-sunos4*] \
&& ![istarget sparc*-*-linux*] \
&& ![istarget arm*-*-linux*] \
&& ![istarget alpha*-*-linux*] \
@ -205,11 +204,7 @@ if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
|| [string match "*option ignored*" $exec_output] \
|| [string match "*unrecognized option*" $exec_output] \
|| [string match "*passed to ld*" $exec_output] } {
if [istarget *-*-sunos4*] {
set picflag "-pic"
} else {
set picflag "-KPIC"
}
set picflag "-KPIC"
}
}
verbose "Using $picflag to compile PIC code"
@ -234,7 +229,6 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o]
} else {
# SunOS non PIC shared libraries don't permit some cases of
# overriding.
setup_xfail "*-*-sunos4*"
setup_xfail "ia64-*-linux*"
setup_xfail "alpha*-*-linux*"
setup_xfail "powerpc64*-*-*"
@ -259,7 +253,6 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o]
# address for the library. Near as I can tell, the R_*_RELATIVE
# relocations for various targets are broken in the case where
# the load address is not zero (which is the default).
setup_xfail "*-*-sunos4*"
setup_xfail "*-*-linux*libc1"
setup_xfail "powerpc*-*-linux*"
setup_xfail "ia64-*-linux*"
@ -291,10 +284,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o]
|| ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
unresolved "shared"
} else {
# SunOS can not compare function pointers correctly
if [istarget "*-*-sunos4*"] {
shared_test shp "shared" mainnp.o sh1p.o sh2p.o sun4
} else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
shared_test shp "shared" mainnp.o sh1p.o sh2p.o xcoff
} else {
shared_test shp "shared" mainnp.o sh1p.o sh2p.o shared
@ -303,7 +293,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o]
shared_test shp "shared -Bsymbolic" mainnp.o sh1p.o sh2p.o symbolic "-Bsymbolic"
ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
} }
}
}
}
@ -318,7 +308,6 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/m
} else {
# SunOS non PIC shared libraries don't permit some cases of
# overriding.
setup_xfail "*-*-sunos4*"
setup_xfail "ia64-*-linux*"
setup_xfail "alpha*-*-linux*"
setup_xfail "powerpc64*-*-*"