Binutils 2.35 with MCST patches
This commit is contained in:
parent
97ccaa1a4c
commit
ae2c13e275
|
@ -306,6 +306,7 @@ BFD32_BACKENDS = \
|
|||
elf32-dlx.lo \
|
||||
elf32-e2k.lo \
|
||||
elf32-e2k-pm.lo \
|
||||
elf32-e2k-pm-uclibc.lo \
|
||||
elf32-epiphany.lo \
|
||||
elf32-fr30.lo \
|
||||
elf32-frv.lo \
|
||||
|
@ -359,6 +360,8 @@ BFD32_BACKENDS = \
|
|||
elf32.lo \
|
||||
elflink.lo \
|
||||
elfxx-e2k.lo \
|
||||
elfxx-e2k-pm.lo \
|
||||
elfxx-e2k-uclibc.lo \
|
||||
elfxx-sparc.lo \
|
||||
elfxx-tilegx.lo \
|
||||
i386aout.lo \
|
||||
|
@ -444,6 +447,7 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf32-dlx.c \
|
||||
elf32-e2k.c \
|
||||
elf32-e2k-pm.c \
|
||||
elf32-e2k-pm-uclibc.c \
|
||||
elf32-epiphany.c \
|
||||
elf32-fr30.c \
|
||||
elf32-frv.c \
|
||||
|
@ -497,6 +501,8 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf32.c \
|
||||
elflink.c \
|
||||
elfxx-e2k.c \
|
||||
elfxx-e2k-pm.c \
|
||||
elfxx-e2k-uclibc.c \
|
||||
elfxx-sparc.c \
|
||||
elfxx-tilegx.c \
|
||||
i386aout.c \
|
||||
|
@ -556,6 +562,9 @@ BFD64_BACKENDS = \
|
|||
elf32-score7.lo \
|
||||
elf64-alpha.lo \
|
||||
elf64-e2k.lo \
|
||||
elf64-e2k-kpda.lo \
|
||||
elf64-e2k-pm.lo \
|
||||
elf64-e2k-uclibc.lo \
|
||||
elf64-gen.lo \
|
||||
elf64-hppa.lo \
|
||||
elf64-ia64.lo \
|
||||
|
@ -598,6 +607,9 @@ BFD64_BACKENDS_CFILES = \
|
|||
elf32-score7.c \
|
||||
elf64-alpha.c \
|
||||
elf64-e2k.c \
|
||||
elf64-e2k-kpda.c \
|
||||
elf64-e2k-pm.c \
|
||||
elf64-e2k-uclibc.c \
|
||||
elf64-gen.c \
|
||||
elf64-hppa.c \
|
||||
elf64-ia64-vms.c \
|
||||
|
@ -956,7 +968,7 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
|
|||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
bfd_version_string="\"$(VERSION)-23.008\"" ;\
|
||||
bfd_version_string="\"$(VERSION)-25.014\"" ;\
|
||||
bfd_soversion="$(VERSION)" ;\
|
||||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
|
|
|
@ -186,7 +186,7 @@ am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
|
|||
format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo \
|
||||
opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo \
|
||||
syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo \
|
||||
verilog.lo
|
||||
verilog.lo eir.lo
|
||||
am_libbfd_la_OBJECTS = $(am__objects_1)
|
||||
libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
|
@ -499,7 +499,7 @@ BFD32_LIBS = \
|
|||
coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo \
|
||||
hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \
|
||||
section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo \
|
||||
binary.lo ihex.lo srec.lo tekhex.lo verilog.lo
|
||||
binary.lo ihex.lo srec.lo tekhex.lo verilog.lo eir.lo
|
||||
|
||||
BFD64_LIBS = archive64.lo
|
||||
BFD32_LIBS_CFILES = \
|
||||
|
@ -507,7 +507,7 @@ BFD32_LIBS_CFILES = \
|
|||
compress.c corefile.c elf-properties.c format.c hash.c \
|
||||
init.c libbfd.c linker.c merge.c opncls.c reloc.c \
|
||||
section.c simple.c stab-syms.c stabs.c syms.c targets.c \
|
||||
binary.c ihex.c srec.c tekhex.c verilog.c
|
||||
binary.c ihex.c srec.c tekhex.c verilog.c eir.c
|
||||
|
||||
BFD64_LIBS_CFILES = archive64.c
|
||||
|
||||
|
@ -528,6 +528,7 @@ ALL_MACHINES = \
|
|||
cpu-d10v.lo \
|
||||
cpu-d30v.lo \
|
||||
cpu-dlx.lo \
|
||||
cpu-e2k.lo \
|
||||
cpu-epiphany.lo \
|
||||
cpu-fr30.lo \
|
||||
cpu-frv.lo \
|
||||
|
@ -612,6 +613,7 @@ ALL_MACHINES_CFILES = \
|
|||
cpu-d10v.c \
|
||||
cpu-d30v.c \
|
||||
cpu-dlx.c \
|
||||
cpu-e2k.c \
|
||||
cpu-epiphany.c \
|
||||
cpu-fr30.c \
|
||||
cpu-frv.c \
|
||||
|
@ -727,6 +729,9 @@ BFD32_BACKENDS = \
|
|||
elf32-d10v.lo \
|
||||
elf32-d30v.lo \
|
||||
elf32-dlx.lo \
|
||||
elf32-e2k.lo \
|
||||
elf32-e2k-pm.lo \
|
||||
elf32-e2k-pm-uclibc.lo \
|
||||
elf32-epiphany.lo \
|
||||
elf32-fr30.lo \
|
||||
elf32-frv.lo \
|
||||
|
@ -779,6 +784,9 @@ BFD32_BACKENDS = \
|
|||
elf32-z80.lo \
|
||||
elf32.lo \
|
||||
elflink.lo \
|
||||
elfxx-e2k.lo \
|
||||
elfxx-e2k-pm.lo \
|
||||
elfxx-e2k-uclibc.lo \
|
||||
elfxx-sparc.lo \
|
||||
elfxx-tilegx.lo \
|
||||
i386aout.lo \
|
||||
|
@ -862,6 +870,9 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf32-d10v.c \
|
||||
elf32-d30v.c \
|
||||
elf32-dlx.c \
|
||||
elf32-e2k.c \
|
||||
elf32-e2k-pm.c \
|
||||
elf32-e2k-pm-uclibc.c \
|
||||
elf32-epiphany.c \
|
||||
elf32-fr30.c \
|
||||
elf32-frv.c \
|
||||
|
@ -914,6 +925,9 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf32-z80.c \
|
||||
elf32.c \
|
||||
elflink.c \
|
||||
elfxx-e2k.c \
|
||||
elfxx-e2k-pm.c \
|
||||
elfxx-e2k-uclibc.c \
|
||||
elfxx-sparc.c \
|
||||
elfxx-tilegx.c \
|
||||
i386aout.c \
|
||||
|
@ -973,6 +987,10 @@ BFD64_BACKENDS = \
|
|||
elf32-score.lo \
|
||||
elf32-score7.lo \
|
||||
elf64-alpha.lo \
|
||||
elf64-e2k.lo \
|
||||
elf64-e2k-kpda.lo \
|
||||
elf64-e2k-pm.lo \
|
||||
elf64-e2k-uclibc.lo \
|
||||
elf64-gen.lo \
|
||||
elf64-hppa.lo \
|
||||
elf64-ia64.lo \
|
||||
|
@ -1014,6 +1032,10 @@ BFD64_BACKENDS_CFILES = \
|
|||
elf32-score.c \
|
||||
elf32-score7.c \
|
||||
elf64-alpha.c \
|
||||
elf64-e2k.c \
|
||||
elf64-e2k-kpda.c \
|
||||
elf64-e2k-pm.c \
|
||||
elf64-e2k-uclibc.c \
|
||||
elf64-gen.c \
|
||||
elf64-hppa.c \
|
||||
elf64-ia64-vms.c \
|
||||
|
@ -1338,6 +1360,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-d10v.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-d30v.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-dlx.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-e2k.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-epiphany.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-fr30.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-frv.Plo@am__quote@
|
||||
|
@ -1410,6 +1433,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf2.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecoff.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecofflink.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eir.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-attrs.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-eh-frame.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-ifunc.Plo@am__quote@
|
||||
|
@ -1433,6 +1457,9 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-d10v.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-d30v.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-dlx.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-e2k-pm-uclibc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-e2k-pm.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-e2k.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-epiphany.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-fr30.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-frv.Plo@am__quote@
|
||||
|
@ -1491,6 +1518,10 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-aarch64.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-alpha.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-bpf.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-e2k-kpda.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-e2k-pm.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-e2k-uclibc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-e2k.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-gen.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-hppa.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ia64-vms.Plo@am__quote@
|
||||
|
@ -1508,6 +1539,9 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elflink.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfn32-mips.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-aarch64.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-e2k-pm.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-e2k-uclibc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-e2k.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-ia64.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-mips.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx-riscv.Plo@am__quote@
|
||||
|
@ -2058,7 +2092,7 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
|
|||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
bfd_version_string="\"$(VERSION)\"" ;\
|
||||
bfd_version_string="\"$(VERSION)-25.014\"" ;\
|
||||
bfd_soversion="$(VERSION)" ;\
|
||||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
|
|
|
@ -131,9 +131,15 @@ DESCRIPTION
|
|||
.#define bfd_mach_sparc_v9m 20 {* with OSA2015 and M7 add'ns. *}
|
||||
.#define bfd_mach_sparc_v8plusm8 21 {* with OSA2017 and M8 add'ns. *}
|
||||
.#define bfd_mach_sparc_v9m8 22 {* with OSA2017 and M8 add'ns. *}
|
||||
.#define bfd_mach_sparc_v8plus_r1000 23 {* with r1000 add'ns. *}
|
||||
.#define bfd_mach_sparc_v9_r1000 24 {* with r1000 add'ns. *}
|
||||
.#define bfd_mach_sparc_v8plus_r2000 25 {* with r2000 add'ns. *}
|
||||
.#define bfd_mach_sparc_v9_r2000 26 {* with r2000 add'ns. *}
|
||||
.#define bfd_mach_sparc_v8plus_r2000_plus 27 {* with r2000+ add'ns. *}
|
||||
.#define bfd_mach_sparc_v9_r2000_plus 28 {* with r2000+ add'ns. *}
|
||||
.{* Nonzero if MACH has the v9 instruction set. *}
|
||||
.#define bfd_mach_sparc_v9_p(mach) \
|
||||
. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
|
||||
. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9_mcst \
|
||||
. && (mach) != bfd_mach_sparc_sparclite_le)
|
||||
.{* Nonzero if MACH is a 64 bit sparc architecture. *}
|
||||
.#define bfd_mach_sparc_64bit_p(mach) \
|
||||
|
@ -144,7 +150,10 @@ DESCRIPTION
|
|||
. && (mach) != bfd_mach_sparc_v8pluse \
|
||||
. && (mach) != bfd_mach_sparc_v8plusv \
|
||||
. && (mach) != bfd_mach_sparc_v8plusm \
|
||||
. && (mach) != bfd_mach_sparc_v8plusm8)
|
||||
. && (mach) != bfd_mach_sparc_v8plusm8 \
|
||||
. && (mach) != bfd_mach_sparc_v8plus_r1000 \
|
||||
. && (mach) != bfd_mach_sparc_v8plus_r2000 \
|
||||
. && (mach) != bfd_mach_sparc_v8plus_r2000_plus)
|
||||
. bfd_arch_spu, {* PowerPC SPU. *}
|
||||
.#define bfd_mach_spu 256
|
||||
. bfd_arch_mips, {* MIPS Rxxxx. *}
|
||||
|
@ -522,6 +531,27 @@ DESCRIPTION
|
|||
. bfd_arch_lm32, {* Lattice Mico32. *}
|
||||
.#define bfd_mach_lm32 1
|
||||
. bfd_arch_microblaze,{* Xilinx MicroBlaze. *}
|
||||
. bfd_arch_e2k, {* MCST E2K. *}
|
||||
.{* It's crucial that the underlying `bfd_mach_e2k*' have the same values as *}
|
||||
.{* the corresponding `E_E2K_MACH_*'s!!! *}
|
||||
.#define bfd_mach_e2k_generic 0
|
||||
.#define bfd_mach_e2k_ev1 1
|
||||
.{* This is interpreted as the common subset of all Elbrus V2 iterations.
|
||||
. Currently it is the same as the common subset of all elbrus-2c+. *}
|
||||
.#define bfd_mach_e2k_ev2 2
|
||||
.#define bfd_mach_e2k_ev3 3
|
||||
.#define bfd_mach_e2k_ev4 4
|
||||
.#define bfd_mach_e2k_ev5 5
|
||||
.#define bfd_mach_e2k_ev6 6
|
||||
.{* Values 16, 17 and 18 used to be reserved for the first three iterations
|
||||
. of `elbrus-v2'. See `include/elf/e2k.h' for why they can't be reused right
|
||||
. now. *}
|
||||
.#define bfd_mach_e2k_8c 19
|
||||
.#define bfd_mach_e2k_1cplus 20
|
||||
.#define bfd_mach_e2k_12c 21
|
||||
.#define bfd_mach_e2k_16c 22
|
||||
.#define bfd_mach_e2k_2c3 23
|
||||
|
||||
. bfd_arch_tilepro, {* Tilera TILEPro. *}
|
||||
. bfd_arch_tilegx, {* Tilera TILE-Gx. *}
|
||||
.#define bfd_mach_tilepro 1
|
||||
|
@ -620,6 +650,7 @@ extern const bfd_arch_info_type bfd_d10v_arch;
|
|||
extern const bfd_arch_info_type bfd_d30v_arch;
|
||||
extern const bfd_arch_info_type bfd_dlx_arch;
|
||||
extern const bfd_arch_info_type bfd_bpf_arch;
|
||||
extern const bfd_arch_info_type bfd_e2k_arch;
|
||||
extern const bfd_arch_info_type bfd_epiphany_arch;
|
||||
extern const bfd_arch_info_type bfd_fr30_arch;
|
||||
extern const bfd_arch_info_type bfd_frv_arch;
|
||||
|
@ -709,6 +740,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
|
|||
&bfd_d30v_arch,
|
||||
&bfd_dlx_arch,
|
||||
&bfd_bpf_arch,
|
||||
&bfd_e2k_arch,
|
||||
&bfd_epiphany_arch,
|
||||
&bfd_fr30_arch,
|
||||
&bfd_frv_arch,
|
||||
|
|
116
bfd/bfd-in2.h
116
bfd/bfd-in2.h
|
@ -1531,9 +1531,15 @@ enum bfd_architecture
|
|||
#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
|
||||
#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
|
||||
#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
|
||||
#define bfd_mach_sparc_v8plus_r1000 23 /* with r1000 add'ns. */
|
||||
#define bfd_mach_sparc_v9_r1000 24 /* with r1000 add'ns. */
|
||||
#define bfd_mach_sparc_v8plus_r2000 25 /* with r2000 add'ns. */
|
||||
#define bfd_mach_sparc_v9_r2000 26 /* with r2000 add'ns. */
|
||||
#define bfd_mach_sparc_v8plus_r2000_plus 27 /* with r2000+ add'ns. */
|
||||
#define bfd_mach_sparc_v9_r2000_plus 28 /* with r2000+ add'ns. */
|
||||
/* Nonzero if MACH has the v9 instruction set. */
|
||||
#define bfd_mach_sparc_v9_p(mach) \
|
||||
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
|
||||
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9_mcst \
|
||||
&& (mach) != bfd_mach_sparc_sparclite_le)
|
||||
/* Nonzero if MACH is a 64 bit sparc architecture. */
|
||||
#define bfd_mach_sparc_64bit_p(mach) \
|
||||
|
@ -1544,7 +1550,10 @@ enum bfd_architecture
|
|||
&& (mach) != bfd_mach_sparc_v8pluse \
|
||||
&& (mach) != bfd_mach_sparc_v8plusv \
|
||||
&& (mach) != bfd_mach_sparc_v8plusm \
|
||||
&& (mach) != bfd_mach_sparc_v8plusm8)
|
||||
&& (mach) != bfd_mach_sparc_v8plusm8 \
|
||||
&& (mach) != bfd_mach_sparc_v8plus_r1000 \
|
||||
&& (mach) != bfd_mach_sparc_v8plus_r2000 \
|
||||
&& (mach) != bfd_mach_sparc_v8plus_r2000_plus)
|
||||
bfd_arch_spu, /* PowerPC SPU. */
|
||||
#define bfd_mach_spu 256
|
||||
bfd_arch_mips, /* MIPS Rxxxx. */
|
||||
|
@ -1922,6 +1931,26 @@ enum bfd_architecture
|
|||
bfd_arch_lm32, /* Lattice Mico32. */
|
||||
#define bfd_mach_lm32 1
|
||||
bfd_arch_microblaze,/* Xilinx MicroBlaze. */
|
||||
bfd_arch_e2k, /* MCST E2K. */
|
||||
/* It's crucial that the underlying `bfd_mach_e2k*' have the same values as */
|
||||
/* the corresponding `E_E2K_MACH_*'s!!! */
|
||||
#define bfd_mach_e2k_generic 0
|
||||
#define bfd_mach_e2k_ev1 1
|
||||
/* This is interpreted as the common subset of all Elbrus V2 iterations.
|
||||
Currently it is the same as the common subset of all elbrus-2c+. */
|
||||
#define bfd_mach_e2k_ev2 2
|
||||
#define bfd_mach_e2k_ev3 3
|
||||
#define bfd_mach_e2k_ev4 4
|
||||
#define bfd_mach_e2k_ev5 5
|
||||
#define bfd_mach_e2k_ev6 6
|
||||
/* Values 16, 17 and 18 used to be reserved for the first three iterations
|
||||
of `elbrus-v2'. See `include/elf/e2k.h' for why they can't be reused right
|
||||
now. */
|
||||
#define bfd_mach_e2k_8c 19
|
||||
#define bfd_mach_e2k_1cplus 20
|
||||
#define bfd_mach_e2k_12c 21
|
||||
#define bfd_mach_e2k_16c 22
|
||||
#define bfd_mach_e2k_2c3 23
|
||||
bfd_arch_tilepro, /* Tilera TILEPro. */
|
||||
bfd_arch_tilegx, /* Tilera TILE-Gx. */
|
||||
#define bfd_mach_tilepro 1
|
||||
|
@ -6268,6 +6297,89 @@ assembler and not (currently) written to any object files. */
|
|||
|
||||
/* S12Z relocations. */
|
||||
BFD_RELOC_S12Z_OPR,
|
||||
|
||||
/* This one corresponds to R_E2K_64_ABS_LIT. */
|
||||
BFD_RELOC_E2K_64_ABS_LIT,
|
||||
|
||||
/* This one corresponds to R_E2K_DISP. */
|
||||
BFD_RELOC_E2K_DISP,
|
||||
|
||||
/* This one corresponds to R_E2K_GOT. */
|
||||
BFD_RELOC_E2K_GOT,
|
||||
|
||||
/* This one corresponds to R_E2K_TLS_GDMOD. */
|
||||
BFD_RELOC_E2K_TLS_GDMOD,
|
||||
|
||||
/* This one corresponds to R_E2K_TLS_GDREL. */
|
||||
BFD_RELOC_E2K_TLS_GDREL,
|
||||
|
||||
/* This one corresponds to R_E2K_TLS_IE. */
|
||||
BFD_RELOC_E2K_TLS_IE,
|
||||
|
||||
/* This one corresponds to R_E2K_32_TLS_LE. */
|
||||
BFD_RELOC_E2K_32_TLS_LE,
|
||||
|
||||
/* This one corresponds to R_E2K_64_TLS_LE. */
|
||||
BFD_RELOC_E2K_64_TLS_LE,
|
||||
|
||||
/* This one corresponds to R_E2K_TLS_32_DTPREL. */
|
||||
BFD_RELOC_E2K_32_DTPREL,
|
||||
|
||||
/* This one corresponds to R_E2K_TLS_64_DTPREL. */
|
||||
BFD_RELOC_E2K_64_DTPREL,
|
||||
|
||||
/* This one corresponds to R_E2K_PLT. */
|
||||
BFD_RELOC_E2K_PLT,
|
||||
|
||||
/* This one corresponds to R_E2K_GOTPLT. */
|
||||
BFD_RELOC_E2K_GOTPLT,
|
||||
|
||||
/* This one corresponds to R_E2K_ISLOCAL. */
|
||||
BFD_RELOC_E2K_ISLOCAL,
|
||||
|
||||
/* This one corresponds to R_E2K_AP_GOT. */
|
||||
BFD_RELOC_E2K_AP_GOT,
|
||||
|
||||
/* This one corresponds to R_E2K_PL_GOT. */
|
||||
BFD_RELOC_E2K_PL_GOT,
|
||||
|
||||
/* This one corresponds to R_E2K_PREF. */
|
||||
BFD_RELOC_E2K_PREF,
|
||||
|
||||
/* This one corresponds to R_E2K_ISLOCAL32. */
|
||||
BFD_RELOC_E2K_ISLOCAL32,
|
||||
|
||||
/* This one corresponds to R_E2K_GOTOFF64. */
|
||||
BFD_RELOC_E2K_GOTOFF64,
|
||||
|
||||
/* This one corresponds to R_E2K_GOTOFF64_LIT. */
|
||||
BFD_RELOC_E2K_GOTOFF64_LIT,
|
||||
|
||||
/* This one corresponds to R_E2K_AP. */
|
||||
BFD_RELOC_E2K_AP,
|
||||
|
||||
/* This one corresponds to R_E2K_PL. */
|
||||
BFD_RELOC_E2K_PL,
|
||||
|
||||
/* This one corresponds to R_E2K_32_DYNOPT. */
|
||||
BFD_RELOC_E2K_DYNOPT32,
|
||||
|
||||
/* This one corresponds to R_E2K_64_DYNOPT. */
|
||||
BFD_RELOC_E2K_DYNOPT64,
|
||||
|
||||
/* Elvees Elcore relocations. */
|
||||
BFD_RELOC_ELCORE32,
|
||||
BFD_RELOC_ELCORE16NPC,
|
||||
BFD_RELOC_ELCORE16PC,
|
||||
BFD_RELOC_ELCORE16S,
|
||||
BFD_RELOC_ELCORE16,
|
||||
BFD_RELOC_ELCORE5,
|
||||
BFD_RELOC_ELCORE32_FAKE,
|
||||
BFD_RELOC_ELCORE16NPC_FAKE,
|
||||
BFD_RELOC_ELCORE16PC_FAKE,
|
||||
BFD_RELOC_ELCORE16S_FAKE,
|
||||
BFD_RELOC_ELCORE16_FAKE,
|
||||
BFD_RELOC_ELCORE5_FAKE,
|
||||
BFD_RELOC_UNUSED };
|
||||
|
||||
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
|
||||
|
|
|
@ -176,6 +176,7 @@ crisv32) targ_archs=bfd_cris_arch ;;
|
|||
crx*) targ_archs=bfd_crx_arch ;;
|
||||
csky*) targ_archs=bfd_csky_arch ;;
|
||||
dlx*) targ_archs=bfd_dlx_arch ;;
|
||||
e2k*) targ_archs=bfd_e2k_arch ;;
|
||||
fido*) targ_archs=bfd_m68k_arch ;;
|
||||
hppa*) targ_archs=bfd_hppa_arch ;;
|
||||
i[3-7]86) targ_archs=bfd_i386_arch ;;
|
||||
|
@ -475,6 +476,24 @@ case "${targ}" in
|
|||
;;
|
||||
#endif
|
||||
|
||||
e2k-*-linux-gnu)
|
||||
targ_defvec=e2k_elf64_vec
|
||||
targ_selvecs="e2k_elf32_vec e2k_pm_elf32_vec"
|
||||
targ64_selvecs="e2k_pm_elf64_vec"
|
||||
want64=true
|
||||
;;
|
||||
|
||||
e2k-*-linux-uclibc)
|
||||
targ_defvec=e2k_uclibc_elf64_vec
|
||||
targ_selvecs="e2k_pm_uclibc_elf32_vec"
|
||||
want64=true
|
||||
;;
|
||||
|
||||
e2k-*-kpda)
|
||||
targ_defvec=e2k_kpda_elf64_vec
|
||||
want64=true
|
||||
;;
|
||||
|
||||
epiphany-*-*)
|
||||
targ_defvec=epiphany_elf32_vec
|
||||
targ_underscore=yes
|
||||
|
|
|
@ -302,6 +302,9 @@
|
|||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define if we should enable new PM ABI */
|
||||
#undef NEW_PM_ABI
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
|
|
|
@ -830,6 +830,7 @@ enable_targets
|
|||
enable_64_bit_archive
|
||||
with_mmap
|
||||
enable_secureplt
|
||||
enable_new_pm_abi
|
||||
enable_separate_code
|
||||
enable_leading_mingw64_underscores
|
||||
with_separate_debug_dir
|
||||
|
@ -1487,6 +1488,7 @@ Optional Features:
|
|||
--enable-targets alternative target configurations
|
||||
--enable-64-bit-archive force 64-bit archives
|
||||
--enable-secureplt Default to creating read-only plt entries
|
||||
--enable-new-pm-abi Enable new PM ABI on E2K
|
||||
--enable-separate-code enable -z separate-code in ELF linker by default
|
||||
--enable-leading-mingw64-underscores
|
||||
Enable leading underscores on 64 bit mingw targets
|
||||
|
@ -11728,7 +11730,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11731 "configure"
|
||||
#line 11733 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -11834,7 +11836,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11837 "configure"
|
||||
#line 11839 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -12493,6 +12495,22 @@ $as_echo "#define USE_SECUREPLT 1" >>confdefs.h
|
|||
|
||||
fi
|
||||
|
||||
# Check whether --enable-new-pm-abi was given.
|
||||
if test "${enable_new_pm_abi+set}" = set; then :
|
||||
enableval=$enable_new_pm_abi; case "${enableval}" in
|
||||
yes) new_pm_abi=true ;;
|
||||
no) new_pm_abi=false ;;
|
||||
*) as_fn_error $? "bad value ${enableval} for new-pm-abi option" "$LINENO" 5 ;;
|
||||
esac
|
||||
else
|
||||
new_pm_abi=false
|
||||
fi
|
||||
if test $new_pm_abi = true; then
|
||||
|
||||
$as_echo "#define NEW_PM_ABI 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Decide if -z separate-code should be enabled in ELF linker by default.
|
||||
ac_default_ld_z_separate_code=unset
|
||||
# Check whether --enable-separate-code was given.
|
||||
|
@ -14755,6 +14773,13 @@ do
|
|||
d10v_elf32_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
|
||||
d30v_elf32_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
|
||||
dlx_elf32_be_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
|
||||
e2k_elf32_vec) tb="$tb elf32-e2k.lo elfxx-e2k.lo elf-ifunc.lo $elf"; want64=true;;
|
||||
e2k_pm_elf32_vec) tb="$tb elf32-e2k-pm.lo elfxx-e2k-pm.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
e2k_pm_uclibc_elf32_vec) tb="$tb elf32-e2k-pm-uclibc.lo elfxx-e2k-pm.lo elfxx-e2k-uclibc.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
e2k_elf64_vec) tb="$tb elf64-e2k.lo elfxx-e2k.lo elf-ifunc.lo $elf"; target_size=64;;
|
||||
e2k_kpda_elf64_vec) tb="$tb elf64-e2k-kpda.lo elfxx-e2k.lo elf-ifunc.lo $elf"; target_size=64;;
|
||||
e2k_pm_elf64_vec) tb="$tb elf64-e2k-pm.lo elfxx-e2k-pm.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
e2k_uclibc_elf64_vec) tb="$tb elf64-e2k-uclibc.lo elfxx-e2k-uclibc.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
elf32_be_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
|
||||
elf32_le_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
|
||||
elf64_be_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
|
|
|
@ -116,6 +116,18 @@ if test $use_secureplt = true; then
|
|||
[Define if we should default to creating read-only plt entries])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(new-pm-abi,
|
||||
[ --enable-new-pm-abi Enable new PM ABI on E2K],
|
||||
[case "${enableval}" in
|
||||
yes) new_pm_abi=true ;;
|
||||
no) new_pm_abi=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for new-pm-abi option) ;;
|
||||
esac],[new_pm_abi=false])dnl
|
||||
if test $new_pm_abi = true; then
|
||||
AC_DEFINE(NEW_PM_ABI, 1,
|
||||
[Define if we should enable new PM ABI])
|
||||
fi
|
||||
|
||||
# Decide if -z separate-code should be enabled in ELF linker by default.
|
||||
ac_default_ld_z_separate_code=unset
|
||||
AC_ARG_ENABLE(separate-code,
|
||||
|
@ -491,6 +503,13 @@ do
|
|||
d10v_elf32_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
|
||||
d30v_elf32_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
|
||||
dlx_elf32_be_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
|
||||
e2k_elf32_vec) tb="$tb elf32-e2k.lo elfxx-e2k.lo elf-ifunc.lo $elf"; want64=true;;
|
||||
e2k_pm_elf32_vec) tb="$tb elf32-e2k-pm.lo elfxx-e2k-pm.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
e2k_pm_uclibc_elf32_vec) tb="$tb elf32-e2k-pm-uclibc.lo elfxx-e2k-pm.lo elfxx-e2k-uclibc.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
e2k_elf64_vec) tb="$tb elf64-e2k.lo elfxx-e2k.lo elf-ifunc.lo $elf"; target_size=64;;
|
||||
e2k_kpda_elf64_vec) tb="$tb elf64-e2k-kpda.lo elfxx-e2k.lo elf-ifunc.lo $elf"; target_size=64;;
|
||||
e2k_pm_elf64_vec) tb="$tb elf64-e2k-pm.lo elfxx-e2k-pm.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
e2k_uclibc_elf64_vec) tb="$tb elf64-e2k-uclibc.lo elfxx-e2k-uclibc.lo elfxx-e2k.lo elf-ifunc.lo $elf";;
|
||||
elf32_be_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
|
||||
elf32_le_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
|
||||
elf64_be_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
|
|
242
bfd/cpu-e2k.c
242
bfd/cpu-e2k.c
|
@ -38,10 +38,12 @@ canonicalize_arch_name (const char *name, int *pmode)
|
|||
|
||||
if (pcolon != NULL)
|
||||
{
|
||||
if (((pcolon[1] == '3' && pcolon[2] == '2' && (mode = 32))
|
||||
if ((((pcolon[1] == '3' && pcolon[2] == '2' && (mode = 32))
|
||||
|| (pcolon[1] == '6' && pcolon[2] == '4' && (mode = 64))
|
||||
|| (pcolon[1] == 'p' && pcolon[2] == 'm' && (mode = 128)))
|
||||
&& pcolon[3] == '\0')
|
||||
|| (pcolon[1] == 'a' && pcolon[2] == 'n' && pcolon[3] == 'y'
|
||||
&& pcolon[4] == '\0' && (mode = 256)))
|
||||
len = pcolon - name;
|
||||
else
|
||||
return NULL;
|
||||
|
@ -56,16 +58,8 @@ canonicalize_arch_name (const char *name, int *pmode)
|
|||
#define STRNCMP(s1, s2, n) \
|
||||
((n == sizeof (s2) - 1 && strncmp (s1, s2, n) == 0) ? 0 : 1)
|
||||
|
||||
if (STRNCMP (name, "generic", len) == 0
|
||||
/* FIXME: `ARCH=e2k' is still used within the generated LD scripts for
|
||||
E2K. Changing it to "generic" would result in a reference to some dummy
|
||||
`bfd_arch_generic' which is definitely not the thing I need. */
|
||||
|| STRNCMP (name, "e2k", len) == 0)
|
||||
name = "generic";
|
||||
else if (STRNCMP (name, "elbrus-v1", len) == 0
|
||||
|| STRNCMP (name, "elbrus", len) == 0)
|
||||
name = "elbrus-v1";
|
||||
else if (STRNCMP (name, "elbrus-v2", len) == 0
|
||||
if (STRNCMP (name, "e2k", len) == 0
|
||||
|| STRNCMP (name, "elbrus-v2", len) == 0
|
||||
|| STRNCMP (name, "elbrus-2c+", len) == 0
|
||||
|| STRNCMP (name, "elbrus-2cm", len) == 0)
|
||||
name = "elbrus-v2";
|
||||
|
@ -95,13 +89,13 @@ canonicalize_arch_name (const char *name, int *pmode)
|
|||
static bfd_boolean
|
||||
e2k_scan (const struct bfd_arch_info *info, const char *string)
|
||||
{
|
||||
static const int modes[] = {64, 32, 128};
|
||||
static const int modes[] = {64, 32, 128, 256};
|
||||
const char *canon;
|
||||
int mode;
|
||||
|
||||
canon = canonicalize_arch_name (string, &mode);
|
||||
if (canon != NULL
|
||||
&& mode == modes[info->mach % 3]
|
||||
&& mode == modes[info->mach % 4]
|
||||
&& strncmp (canon, info->printable_name, strlen (canon)) == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@ -113,44 +107,120 @@ extern const bfd_arch_info_type bfd_e2k_arch;
|
|||
static const bfd_arch_info_type *
|
||||
bfd_e2k_compatible (const bfd_arch_info_type *i, const bfd_arch_info_type *o)
|
||||
{
|
||||
/* FIXME: while reworking this function to make it return the "least common
|
||||
denominator" of I and O a limited amount of code was copy/pasted from
|
||||
`_bfd_e2k_elf_merge_private_bfd_data_1 ()'. Moreover, it was simplified
|
||||
so as not to take EF_E2K_INCOMPAT case into account. The latter means
|
||||
that GDB won't emit a warning (not an error?) on an attempt to execute a
|
||||
forward-incompatible ELF for elbrus-vX on elbrus-v{Y > X} at it'll be the
|
||||
Kernel that will prevent this. To make such a control possible here info
|
||||
on the presence of EF_E2K_INCOMPAT should probably be encoded in `bfd_arch
|
||||
_info_type.mach' along with 32-, 64-bit or PM ABIs. Once this is done, it
|
||||
should be possible to delegate similar activities from `_bfd_e2k_elf_merge
|
||||
_private_bfd_data_1 ()' to this function. */
|
||||
enum
|
||||
{
|
||||
ev1,
|
||||
ev2,
|
||||
ev3,
|
||||
e8c,
|
||||
e1cplus,
|
||||
ev5,
|
||||
e12c,
|
||||
e16c,
|
||||
e2c3,
|
||||
/* The related bit in mask stands for "all future processor models". */
|
||||
ev7
|
||||
};
|
||||
|
||||
#define AT(p) (1L << p)
|
||||
#define AT_ev6 (AT (e12c) | AT (e16c) | AT (e2c3))
|
||||
|
||||
|
||||
/* A reduced version of mask[] from `_bfd_e2k_elf_merge_private_bfd_data_1 ()'
|
||||
without an "incompatible" column. */
|
||||
static const unsigned long mask[] =
|
||||
{
|
||||
[bfd_mach_e2k_generic] = (AT (ev1) | AT (ev2) | AT (ev3) | AT (e8c)
|
||||
| AT (e1cplus) | AT (ev5) | AT_ev6
|
||||
| AT (ev7)),
|
||||
|
||||
[bfd_mach_e2k_ev1] = AT (ev1),
|
||||
|
||||
[bfd_mach_e2k_ev2] = (AT (ev2) | AT (ev3) | AT (e8c) | AT (e1cplus)
|
||||
| AT (ev5) | AT_ev6 | AT (ev7)),
|
||||
|
||||
[bfd_mach_e2k_ev3] = (AT (ev3) | AT (e8c) | AT (e1cplus) | AT (ev5)
|
||||
| AT_ev6 | AT (ev7)),
|
||||
|
||||
[bfd_mach_e2k_ev4] = (AT (e8c) | AT (e1cplus) | AT (ev5) | AT_ev6
|
||||
| AT (ev7)),
|
||||
|
||||
[bfd_mach_e2k_ev5] = (AT (ev5) | AT_ev6 | AT (ev7)),
|
||||
|
||||
[bfd_mach_e2k_ev6] = (AT_ev6 | AT (ev7)),
|
||||
|
||||
[bfd_mach_e2k_8c] = AT (e8c),
|
||||
|
||||
[bfd_mach_e2k_1cplus] = AT (e1cplus),
|
||||
|
||||
[bfd_mach_e2k_12c] = AT (e12c),
|
||||
|
||||
[bfd_mach_e2k_16c] = AT (e16c),
|
||||
|
||||
[bfd_mach_e2k_2c3] = AT (e2c3),
|
||||
};
|
||||
|
||||
unsigned long imach, omach, remind;
|
||||
unsigned int j;
|
||||
|
||||
|
||||
if (i->arch != o->arch)
|
||||
return NULL;
|
||||
|
||||
/* Check whether input and output BFDs have the same ABI. */
|
||||
if (i->mach % 3 != o->mach % 3)
|
||||
imach = i->mach;
|
||||
omach = o->mach;
|
||||
|
||||
/* Check whether input and output BFDs have the same ABI. 3 stands for
|
||||
"any ABI will do" and is currently used when assigning bfd_arch_info
|
||||
to TARGET_DESC in gdb as there is probably no way to determine which
|
||||
mode the inferior is started in. */
|
||||
if (imach % 4 != 3 && omach % 4 != 3 && imach % 4 != omach % 4)
|
||||
return NULL;
|
||||
|
||||
/* Nowadays that we should be able to dynamically choose an output
|
||||
machine without `-A' (see Bug #58358) any further checks here
|
||||
are meaningless. They are moved to `_bfd_e2k_merge_private_bfd_data'.
|
||||
Just return our "generic" arch info in order not to upset
|
||||
`lang_check ()'. It turns out that a value returned by this function
|
||||
is not actually used at all except for aforementioned formal(?) check and
|
||||
remind = (imach % 4 != 3) ? imach % 4 : omach % 4;
|
||||
|
||||
. . . GDB's `can_run_code_for ()' which expects us to return the "more
|
||||
featureful" of the two arches. For it to succeed the returned arch should
|
||||
coincide with that of the executable, which is the `I' argument of this
|
||||
function). I think that it's quite reasonable to return `I' for now, since
|
||||
its arch can't certainly turn out to be "less featureful" than the minimal
|
||||
arch of the GDB's handler, represented by `O'. But this may very well
|
||||
change once GDB for E2K gets "non-minimal" handlers!
|
||||
imach /= 4;
|
||||
omach /= 4;
|
||||
|
||||
By the way, why don't they want to let GDB's handler have a more advanced
|
||||
arch than that of the executable? As far as I remember, this is because a
|
||||
more "featureful" handler may require registers which aren't provided by
|
||||
the executable's primitive ABI. */
|
||||
imach = mask[imach];
|
||||
omach = mask[omach];
|
||||
|
||||
return i;
|
||||
omach = omach & imach;
|
||||
if (omach != 0)
|
||||
{
|
||||
for (j = 0; j < sizeof (mask) / sizeof (mask[0]); j++)
|
||||
{
|
||||
if (omach == mask[j])
|
||||
return bfd_lookup_arch (o->arch, 4 * j + remind);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#define BITS_ADDR_64 64
|
||||
#define BITS_ADDR_32 32
|
||||
#define BITS_ADDR_pm 32
|
||||
/* This is a formal definition as we are unaware of "BITS_ADDR" when "any"
|
||||
bfd_arch_info_type is used. */
|
||||
#define BITS_ADDR_any 64
|
||||
|
||||
#define MACH_64(mach) (3 * (mach))
|
||||
#define MACH_32(mach) (3 * (mach) + 1)
|
||||
#define MACH_pm(mach) (3 * (mach) + 2)
|
||||
#define MACH_64(mach) (4 * (mach))
|
||||
#define MACH_32(mach) (4 * (mach) + 1)
|
||||
#define MACH_pm(mach) (4 * (mach) + 2)
|
||||
#define MACH_any(mach) (4 * (mach) + 3)
|
||||
|
||||
#define PRINT_PREFIX_64 "64-bit ABI for "
|
||||
#define PRINT_PREFIX_32 "32-bit ABI for "
|
||||
|
@ -181,102 +251,144 @@ bfd_e2k_compatible (const bfd_arch_info_type *i, const bfd_arch_info_type *o)
|
|||
bfd_e2k_compatible, \
|
||||
e2k_scan, \
|
||||
bfd_arch_default_fill, \
|
||||
NEXT \
|
||||
NEXT, \
|
||||
0 /* Maximum offset of a reloc from the start of an insn. */ \
|
||||
}
|
||||
|
||||
/* These indices are used to refer to the next arch_info entry. I_generic_64
|
||||
is not needed here since the corresponding entry is defined apart. */
|
||||
enum
|
||||
{
|
||||
I_generic_64 = -1,
|
||||
I_generic_32,
|
||||
I_generic_pm,
|
||||
I_generic_any,
|
||||
|
||||
I_ev1_64,
|
||||
I_ev1_32,
|
||||
I_ev1_pm,
|
||||
I_ev1_any,
|
||||
|
||||
I_ev2_64,
|
||||
I_ev2_32,
|
||||
I_ev2_pm,
|
||||
I_ev2_any,
|
||||
|
||||
I_ev3_64,
|
||||
I_ev3_32,
|
||||
I_ev3_pm,
|
||||
I_ev3_any,
|
||||
|
||||
I_ev4_64,
|
||||
I_ev4_32,
|
||||
I_ev4_pm,
|
||||
I_ev4_any,
|
||||
|
||||
I_ev5_64,
|
||||
I_ev5_32,
|
||||
I_ev5_pm,
|
||||
I_ev5_any,
|
||||
|
||||
I_ev6_64,
|
||||
I_ev6_32,
|
||||
I_ev6_pm,
|
||||
I_ev6_any,
|
||||
|
||||
I_8c_64,
|
||||
I_8c_32,
|
||||
I_8c_pm,
|
||||
I_8c_any,
|
||||
|
||||
I_1cplus_64,
|
||||
I_1cplus_32,
|
||||
I_1cplus_pm,
|
||||
I_1cplus_any,
|
||||
|
||||
I_12c_64,
|
||||
I_12c_32,
|
||||
I_12c_pm,
|
||||
I_12c_any,
|
||||
|
||||
I_16c_64,
|
||||
I_16c_32,
|
||||
I_16c_pm,
|
||||
I_16c_any,
|
||||
|
||||
I_2c3_64,
|
||||
I_2c3_32,
|
||||
I_2c3_pm,
|
||||
I_2c3_any
|
||||
};
|
||||
|
||||
#define NN(index) (&arch_info_struct[(index) + 1])
|
||||
|
||||
static const bfd_arch_info_type arch_info_struct[] =
|
||||
#define FIRST_TRIP(mach, name) \
|
||||
N (bfd_mach_e2k_##mach, 32, name, FALSE, NN (I_##mach##_32)), \
|
||||
N (bfd_mach_e2k_##mach, pm, name, FALSE, NN (I_##mach##_pm)), \
|
||||
N (bfd_mach_e2k_##mach, any, name, FALSE, NN (I_##mach##_any))
|
||||
|
||||
#define TRIP(mach, name) \
|
||||
N (bfd_mach_e2k_##mach, 64, name, FALSE, NN (I_##mach##_64)), \
|
||||
N (bfd_mach_e2k_##mach, 32, name, FALSE, NN (I_##mach##_32)), \
|
||||
N (bfd_mach_e2k_##mach, pm, name, FALSE, NN (I_##mach##_pm))
|
||||
|
||||
#define QUAD(mach, name) \
|
||||
TRIP (mach, name), \
|
||||
N (bfd_mach_e2k_##mach, any, name, FALSE, NN (I_##mach##_any))
|
||||
|
||||
#define LAST_QUAD(mach, name) \
|
||||
TRIP (mach, name), \
|
||||
N (bfd_mach_e2k_##mach, any, name, FALSE, NULL)
|
||||
|
||||
|
||||
|
||||
|
||||
const bfd_arch_info_type arch_info_struct[] =
|
||||
{
|
||||
/* The two remaining generic entries. */
|
||||
N (bfd_mach_e2k_generic, 32, "generic", FALSE, NN (I_generic_32)),
|
||||
N (bfd_mach_e2k_generic, pm, "generic", FALSE, NN (I_generic_pm)),
|
||||
FIRST_TRIP (generic, "generic"),
|
||||
|
||||
/* `elbrus-v1' entries. */
|
||||
N (bfd_mach_e2k_ev1, 64, "elbrus-v1", FALSE, NN (I_ev1_64)),
|
||||
N (bfd_mach_e2k_ev1, 32, "elbrus-v1", FALSE, NN (I_ev1_32)),
|
||||
N (bfd_mach_e2k_ev1, pm, "elbrus-v1", FALSE, NN (I_ev1_pm)),
|
||||
QUAD (ev1, "elbrus-v1"),
|
||||
|
||||
/* `elbrus-v2' entries. */
|
||||
N (bfd_mach_e2k_ev2, 64, "elbrus-v2", FALSE, NN (I_ev2_64)),
|
||||
N (bfd_mach_e2k_ev2, 32, "elbrus-v2", FALSE, NN (I_ev2_32)),
|
||||
N (bfd_mach_e2k_ev2, pm, "elbrus-v2", FALSE, NN (I_ev2_pm)),
|
||||
QUAD (ev2, "elbrus-v2"),
|
||||
|
||||
/* `elbrus-v3' entries. */
|
||||
N (bfd_mach_e2k_ev3, 64, "elbrus-v3", FALSE, NN (I_ev3_64)),
|
||||
N (bfd_mach_e2k_ev3, 32, "elbrus-v3", FALSE, NN (I_ev3_32)),
|
||||
N (bfd_mach_e2k_ev3, pm, "elbrus-v3", FALSE, NN (I_ev3_pm)),
|
||||
QUAD (ev3, "elbrus-v3"),
|
||||
|
||||
/* `elbrus-v4' entries. */
|
||||
N (bfd_mach_e2k_ev4, 64, "elbrus-v4", FALSE, NN (I_ev4_64)),
|
||||
N (bfd_mach_e2k_ev4, 32, "elbrus-v4", FALSE, NN (I_ev4_32)),
|
||||
N (bfd_mach_e2k_ev4, pm, "elbrus-v4", FALSE, NN (I_ev4_pm)),
|
||||
QUAD (ev4, "elbrus-v4"),
|
||||
|
||||
/* `elbrus-v5' entries. */
|
||||
N (bfd_mach_e2k_ev5, 64, "elbrus-v5", FALSE, NN (I_ev5_64)),
|
||||
N (bfd_mach_e2k_ev5, 32, "elbrus-v5", FALSE, NN (I_ev5_32)),
|
||||
N (bfd_mach_e2k_ev5, pm, "elbrus-v5", FALSE, NN (I_ev5_pm)),
|
||||
QUAD (ev5, "elbrus-v5"),
|
||||
|
||||
/* `elbrus-v6' entries. */
|
||||
N (bfd_mach_e2k_ev6, 64, "elbrus-v6", FALSE, NN (I_ev6_64)),
|
||||
N (bfd_mach_e2k_ev6, 32, "elbrus-v6", FALSE, NN (I_ev6_32)),
|
||||
N (bfd_mach_e2k_ev6, pm, "elbrus-v6", FALSE, NN (I_ev6_pm)),
|
||||
QUAD (ev6, "elbrus-v6"),
|
||||
|
||||
/* Entries, describing the specific `elbrus-8c' processor also known as
|
||||
Processor-1 (elbrus-v4). */
|
||||
N (bfd_mach_e2k_8c, 64, "elbrus-8c", FALSE, NN (I_8c_64)),
|
||||
N (bfd_mach_e2k_8c, 32, "elbrus-8c", FALSE, NN (I_8c_32)),
|
||||
N (bfd_mach_e2k_8c, pm, "elbrus-8c", FALSE, NN (I_8c_pm)),
|
||||
QUAD (8c, "elbrus-8c"),
|
||||
|
||||
/* Entries, describing the specific `elbrus-1c+' processor also known as
|
||||
Processor-2 (elbrus-v4). */
|
||||
N (bfd_mach_e2k_1cplus, 64, "elbrus-1c+", FALSE, NN (I_1cplus_64)),
|
||||
N (bfd_mach_e2k_1cplus, 32, "elbrus-1c+", FALSE, NN (I_1cplus_32)),
|
||||
N (bfd_mach_e2k_1cplus, pm, "elbrus-1c+", FALSE, NULL)
|
||||
QUAD (1cplus, "elbrus-1c+"),
|
||||
|
||||
/* Entries, describing the specific `elbrus-12c' processor of elbrus-v6
|
||||
series. */
|
||||
QUAD (12c, "elbrus-12c"),
|
||||
|
||||
/* Entries, describing the specific `elbrus-16c' processor of elbrus-v6
|
||||
series. */
|
||||
QUAD (16c, "elbrus-16c"),
|
||||
|
||||
/* Entries, describing the specific `elbrus-2c3' processor of elbrus-v6
|
||||
series. */
|
||||
LAST_QUAD (2c3, "elbrus-2c3")
|
||||
};
|
||||
|
||||
/* I don't remember for sure what DEFAULT actually means here. We should
|
||||
probably only one default arch, however. Let it be a 64-bit elbrus
|
||||
generic arch. */
|
||||
const bfd_arch_info_type bfd_e2k_arch =
|
||||
N (bfd_mach_e2k_generic, 64, "generic", TRUE, &arch_info_struct[0]);
|
||||
N (bfd_mach_e2k_generic, 64, "generic", TRUE, NN (I_generic_64));
|
||||
|
|
|
@ -62,7 +62,13 @@ static const bfd_arch_info_type arch_info_struct[] =
|
|||
N (32, bfd_mach_sparc_v8plusm, "sparc:v8plusm", FALSE, arch_info_struct + 18),
|
||||
N (64, bfd_mach_sparc_v9m, "sparc:v9m", FALSE, arch_info_struct + 19),
|
||||
N (32, bfd_mach_sparc_v8plusm8, "sparc:v8plusm8", FALSE, arch_info_struct + 20),
|
||||
N (64, bfd_mach_sparc_v9m8, "sparc:v9m8", FALSE, NULL)
|
||||
N (64, bfd_mach_sparc_v9m8, "sparc:v9m8", FALSE, arch_info_struct + 21),
|
||||
N (32, bfd_mach_sparc_v8plus_r1000, "sparc:v8plus_r1000", FALSE, arch_info_struct + 22),
|
||||
N (64, bfd_mach_sparc_v9_r1000, "sparc:r1000", FALSE, arch_info_struct + 23),
|
||||
N (32, bfd_mach_sparc_v8plus_r2000, "sparc:v8plus_r2000", FALSE, arch_info_struct + 24),
|
||||
N (64, bfd_mach_sparc_v9_r2000, "sparc:r2000", FALSE, arch_info_struct + 25),
|
||||
N (32, bfd_mach_sparc_v8plus_r2000_plus, "sparc:v8plus_r2000_plus", FALSE, arch_info_struct + 26),
|
||||
N (64, bfd_mach_sparc_v9_r2000_plus, "sparc:r2000_plus", FALSE, NULL),
|
||||
};
|
||||
|
||||
const bfd_arch_info_type bfd_sparc_arch =
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Controls whether to enable development-mode features by default.
|
||||
development=true
|
||||
development=false
|
||||
|
||||
# Indicate whether this is a release branch.
|
||||
experimental=false
|
||||
|
|
16
bfd/eir.c
16
bfd/eir.c
|
@ -74,16 +74,16 @@ const bfd_target eir_vec =
|
|||
_bfd_dummy_target,
|
||||
},
|
||||
{ /* bfd_set_format */
|
||||
bfd_false,
|
||||
bfd_true,
|
||||
bfd_false,
|
||||
bfd_false,
|
||||
_bfd_bool_bfd_false_error,
|
||||
_bfd_bool_bfd_true,
|
||||
_bfd_bool_bfd_false_error,
|
||||
_bfd_bool_bfd_false_error,
|
||||
},
|
||||
{ /* bfd_write_contents */
|
||||
bfd_false,
|
||||
bfd_true,
|
||||
bfd_false,
|
||||
bfd_false,
|
||||
_bfd_bool_bfd_false_error,
|
||||
_bfd_bool_bfd_true,
|
||||
_bfd_bool_bfd_false_error,
|
||||
_bfd_bool_bfd_false_error,
|
||||
},
|
||||
|
||||
BFD_JUMP_TABLE_GENERIC (_bfd_generic),
|
||||
|
|
|
@ -523,6 +523,7 @@ enum elf_target_id
|
|||
TILEGX_ELF_DATA,
|
||||
TILEPRO_ELF_DATA,
|
||||
RISCV_ELF_DATA,
|
||||
E2K_ELF_DATA,
|
||||
GENERIC_ELF_DATA
|
||||
};
|
||||
|
||||
|
@ -1664,6 +1665,8 @@ struct elf_backend_data
|
|||
/* True if the 64-bit Linux PRPSINFO structure's `pr_uid' and `pr_gid'
|
||||
members use a 16-bit data type. */
|
||||
unsigned linux_prpsinfo64_ugid16 : 1;
|
||||
|
||||
bfd_vma r_none_info;
|
||||
};
|
||||
|
||||
/* Information about reloc sections associated with a bfd_elf_section_data
|
||||
|
@ -2887,6 +2890,12 @@ extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs
|
|||
struct elf_dyn_relocs **, unsigned int, unsigned int,
|
||||
unsigned int, bfd_boolean);
|
||||
|
||||
/* Leave it in place since E2K needs it. */
|
||||
extern long _bfd_elf_ifunc_get_synthetic_symtab
|
||||
(bfd *, long, asymbol **, long, asymbol **, asymbol **, asection *,
|
||||
int, void *,
|
||||
bfd_vma *(*) (bfd *, asymbol **, asection *, asection *, int, void *));
|
||||
|
||||
extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *);
|
||||
extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *);
|
||||
|
||||
|
@ -2917,6 +2926,15 @@ extern bfd_boolean _bfd_elf_maybe_set_textrel
|
|||
extern bfd_boolean _bfd_elf_add_dynamic_tags
|
||||
(bfd *, struct bfd_link_info *, bfd_boolean);
|
||||
|
||||
/* Stupidly ensure that this is NOT compiled for non-e2k targets. */
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
extern bfd_vma adjust_offset_in_cud_gd
|
||||
(struct bfd_link_info *, bfd_vma);
|
||||
|
||||
extern bfd_vma orig_offset_in_cud
|
||||
(struct bfd_link_info *, bfd_vma);
|
||||
#endif /* HAVE_e2k_elf64_vec */
|
||||
|
||||
/* Large common section. */
|
||||
extern asection _bfd_elf_large_com_section;
|
||||
|
||||
|
|
|
@ -1002,6 +1002,15 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
|
|||
CIE instructions. */
|
||||
|| (set_loc_count && this_inf->cie))
|
||||
goto free_no_table;
|
||||
|
||||
/* Prevent e2k-linux-ld from adjusting the size of entries (are only CIEs
|
||||
adjusted this way?) and thus ensure that the 16 byte alignment of all
|
||||
subsequent CIEs and FDEs is preserved in such a primitive way . . . */
|
||||
if (((elf_elfheader (abfd)->e_flags & 32 /* EF_E2K_PM */)
|
||||
== 32 /* EF_E2K_PM */)
|
||||
&& strstr (abfd->xvec->name, "e2k-pm") != NULL)
|
||||
insns_end = end;
|
||||
|
||||
this_inf->size -= end - insns_end;
|
||||
if (insns_end != end && this_inf->cie)
|
||||
{
|
||||
|
@ -2164,9 +2173,28 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
|
|||
break;
|
||||
case DW_EH_PE_pcrel:
|
||||
value += (bfd_vma) ent->offset - ent->new_offset;
|
||||
address += (sec->output_section->vma
|
||||
address +=
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
/* Note "This is called with the relocated contents" above
|
||||
meaning that "pc-relative deltas" read from the section
|
||||
contain the differencies of PACKED addresses in e2k PM
|
||||
written out by my backend. Therefore, evaluate the
|
||||
absolute PACKED address and ... */
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
(sec->output_section->vma
|
||||
+ sec->output_offset
|
||||
+ ent->offset + 8);
|
||||
+ ent->offset + 8)
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
;
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
/* ... use it to restore the original absolute one. Later it
|
||||
will be used to calculate another PACKED "pc-relative
|
||||
delta" from another location. */
|
||||
address = orig_offset_in_cud (info, address);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
if (ent->make_relative)
|
||||
|
@ -2470,19 +2498,83 @@ write_dwarf_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
|
|||
{
|
||||
bfd_vma val;
|
||||
|
||||
val = hdr_info->u.dwarf.array[i].initial_loc
|
||||
- sec->output_section->vma;
|
||||
val =
|
||||
(
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
hdr_info->u.dwarf.array[i].initial_loc
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
-
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
sec->output_section->vma
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
);
|
||||
|
||||
val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
|
||||
if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64
|
||||
&& (hdr_info->u.dwarf.array[i].initial_loc
|
||||
!= sec->output_section->vma + val))
|
||||
&& (
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
hdr_info->u.dwarf.array[i].initial_loc
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
!=
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
sec->output_section->vma
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
+ val))
|
||||
overflow = TRUE;
|
||||
bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 4);
|
||||
val = hdr_info->u.dwarf.array[i].fde - sec->output_section->vma;
|
||||
val = (
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
hdr_info->u.dwarf.array[i].fde
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
-
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
sec->output_section->vma
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
);
|
||||
val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
|
||||
if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64
|
||||
&& (hdr_info->u.dwarf.array[i].fde
|
||||
!= sec->output_section->vma + val))
|
||||
&& (
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
|
||||
hdr_info->u.dwarf.array[i].fde
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
!=
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
adjust_offset_in_cud_gd (info,
|
||||
#endif
|
||||
sec->output_section->vma
|
||||
#ifdef HAVE_e2k_elf64_vec
|
||||
)
|
||||
#endif
|
||||
+ val))
|
||||
overflow = TRUE;
|
||||
bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 8);
|
||||
if (i != 0
|
||||
|
|
170
bfd/elf-ifunc.c
170
bfd/elf-ifunc.c
|
@ -348,3 +348,173 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Leave the underlying function in place since E2K needs it. */
|
||||
|
||||
/* Similar to _bfd_elf_get_synthetic_symtab, optimized for unsorted PLT
|
||||
entries. PLT is the PLT section. PLT_SYM_VAL is a function pointer
|
||||
which returns an array of PLT entry symbol values. */
|
||||
|
||||
long
|
||||
_bfd_elf_ifunc_get_synthetic_symtab
|
||||
(bfd *abfd, long symcount ATTRIBUTE_UNUSED,
|
||||
asymbol **syms ATTRIBUTE_UNUSED, long dynsymcount, asymbol **dynsyms,
|
||||
asymbol **ret, asection *plt,
|
||||
int kind,
|
||||
void *dummy,
|
||||
bfd_vma *(*get_plt_sym_val) (bfd *, asymbol **, asection *, asection *,
|
||||
int, void *))
|
||||
{
|
||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||
asection *relplt;
|
||||
asymbol *s;
|
||||
const char *relplt_name;
|
||||
bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
|
||||
arelent *p;
|
||||
long count, i, n;
|
||||
size_t size;
|
||||
Elf_Internal_Shdr *hdr;
|
||||
char *names;
|
||||
bfd_vma *plt_sym_val;
|
||||
const char *plt_sfx;
|
||||
size_t plt_sfx_sz;
|
||||
|
||||
switch (kind)
|
||||
{
|
||||
case 0:
|
||||
plt_sfx = "@plt";
|
||||
plt_sfx_sz = sizeof ("@plt");
|
||||
break;
|
||||
case 1:
|
||||
plt_sfx = "@secondary_plt";
|
||||
plt_sfx_sz = sizeof ("@secondary_plt");
|
||||
break;
|
||||
case 2:
|
||||
plt_sfx = "@plt.got";
|
||||
plt_sfx_sz = sizeof ("@plt.got");
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ret = NULL;
|
||||
|
||||
if (plt == NULL)
|
||||
return 0;
|
||||
|
||||
if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0)
|
||||
return 0;
|
||||
|
||||
if (dynsymcount <= 0)
|
||||
return 0;
|
||||
|
||||
/* When looking for primary and secondary PLT entries one should iterate
|
||||
over `.rela.plt', whereas for `.plt.got' entries (recall that they are
|
||||
created for functions a pointer to which should be resolved in a non-lazy
|
||||
way (in a shared library?)) - over `.rela.dyn'. */
|
||||
if (kind == 0 || kind == 1)
|
||||
{
|
||||
relplt_name = bed->relplt_name;
|
||||
if (relplt_name == NULL)
|
||||
relplt_name = bed->rela_plts_and_copies_p ? ".rela.plt" : ".rel.plt";
|
||||
relplt = bfd_get_section_by_name (abfd, relplt_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: currently this function is called with `kind == 2' for E2K
|
||||
only. How should I properly choose between `.rel{,a}.dyn' on other
|
||||
platforms? */
|
||||
relplt_name = ".rela.dyn";
|
||||
|
||||
/* FIXME: is it worthwhile to iterate over a potentially huge `.rela.dyn'
|
||||
for just a few relocations related to `.plt.got' entries? There are a
|
||||
couple of such entries in libc.so . . . */
|
||||
relplt = bfd_get_section_by_name (abfd, relplt_name);
|
||||
}
|
||||
|
||||
if (relplt == NULL)
|
||||
return 0;
|
||||
|
||||
hdr = &elf_section_data (relplt)->this_hdr;
|
||||
if (hdr->sh_link != elf_dynsymtab (abfd)
|
||||
|| (hdr->sh_type != SHT_REL && hdr->sh_type != SHT_RELA))
|
||||
return 0;
|
||||
|
||||
slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
|
||||
if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE))
|
||||
return -1;
|
||||
|
||||
count = relplt->size / hdr->sh_entsize;
|
||||
size = count * sizeof (asymbol);
|
||||
p = relplt->relocation;
|
||||
for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel)
|
||||
{
|
||||
size += strlen ((*p->sym_ptr_ptr)->name) + plt_sfx_sz;
|
||||
if (p->addend != 0)
|
||||
{
|
||||
#ifdef BFD64
|
||||
size += sizeof ("+0x") - 1 + 8 + 8 * (bed->s->elfclass == ELFCLASS64);
|
||||
#else
|
||||
size += sizeof ("+0x") - 1 + 8;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
plt_sym_val = get_plt_sym_val (abfd, dynsyms, plt, relplt, kind, dummy);
|
||||
if (plt_sym_val == NULL)
|
||||
return -1;
|
||||
|
||||
s = *ret = (asymbol *) bfd_malloc (size);
|
||||
if (s == NULL)
|
||||
{
|
||||
free (plt_sym_val);
|
||||
return -1;
|
||||
}
|
||||
|
||||
names = (char *) (s + count);
|
||||
p = relplt->relocation;
|
||||
n = 0;
|
||||
for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel)
|
||||
{
|
||||
size_t len;
|
||||
bfd_vma addr;
|
||||
|
||||
addr = plt_sym_val[i];
|
||||
if (addr == (bfd_vma) -1)
|
||||
continue;
|
||||
|
||||
*s = **p->sym_ptr_ptr;
|
||||
/* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since
|
||||
we are defining a symbol, ensure one of them is set. */
|
||||
if ((s->flags & BSF_LOCAL) == 0)
|
||||
s->flags |= BSF_GLOBAL;
|
||||
s->flags |= BSF_SYNTHETIC;
|
||||
s->section = plt;
|
||||
s->value = addr - plt->vma;
|
||||
s->name = names;
|
||||
s->udata.p = NULL;
|
||||
len = strlen ((*p->sym_ptr_ptr)->name);
|
||||
memcpy (names, (*p->sym_ptr_ptr)->name, len);
|
||||
names += len;
|
||||
if (p->addend != 0)
|
||||
{
|
||||
char buf[30], *a;
|
||||
|
||||
memcpy (names, "+0x", sizeof ("+0x") - 1);
|
||||
names += sizeof ("+0x") - 1;
|
||||
bfd_sprintf_vma (abfd, buf, p->addend);
|
||||
for (a = buf; *a == '0'; ++a)
|
||||
;
|
||||
len = strlen (a);
|
||||
memcpy (names, a, len);
|
||||
names += len;
|
||||
}
|
||||
memcpy (names, plt_sfx, plt_sfx_sz);
|
||||
names += plt_sfx_sz;
|
||||
++s, ++n;
|
||||
}
|
||||
|
||||
free (plt_sym_val);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
/* The only macro that should be defined prior to inclusion of
|
||||
elf32-e2k.c so as to prevent it from including elf32-target.h
|
||||
before we redefine all other macros of interest. */
|
||||
#define TARGET_LITTLE_NAME "elf32-e2k-pm-uclibc"
|
||||
#include "elf32-e2k.c"
|
||||
|
||||
#undef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM e2k_pm_uclibc_elf32_vec
|
||||
|
||||
#include "elfxx-e2k-pm.h"
|
||||
|
||||
#include "elfxx-e2k-uclibc.h"
|
||||
|
||||
#undef bfd_elf32_bfd_merge_private_bfd_data
|
||||
#define bfd_elf32_bfd_merge_private_bfd_data \
|
||||
_bfd_e2k_uclibc_elf_merge_private_bfd_data
|
||||
|
||||
#include "elf32-target.h"
|
|
@ -1,130 +1,12 @@
|
|||
#include "sysdep.h"
|
||||
#include "bfd.h"
|
||||
#include "libbfd.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elf/e2k.h"
|
||||
#include "elfxx-e2k.h"
|
||||
|
||||
static bfd_boolean
|
||||
segment_executable (struct elf_segment_map *seg)
|
||||
{
|
||||
if (seg->p_flags_valid)
|
||||
return (seg->p_flags & PF_X) != 0;
|
||||
else
|
||||
{
|
||||
/* The p_flags value has not been computed yet,
|
||||
so we have to look through the sections. */
|
||||
unsigned int i;
|
||||
for (i = 0; i < seg->count; ++i)
|
||||
if (seg->sections[i]->flags & SEC_CODE)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Determine if this segment is eligible to receive the file and program
|
||||
headers. It must be read-only and non-executable.
|
||||
Its first section must start far enough past the page boundary to
|
||||
allow space for the headers. */
|
||||
static bfd_boolean
|
||||
segment_eligible_for_headers (struct elf_segment_map *seg,
|
||||
bfd_vma minpagesize, bfd_vma sizeof_headers)
|
||||
{
|
||||
unsigned int i;
|
||||
if (seg->count == 0 || seg->sections[0]->lma % minpagesize < sizeof_headers)
|
||||
return FALSE;
|
||||
for (i = 0; i < seg->count; ++i)
|
||||
{
|
||||
if ((seg->sections[i]->flags & (SEC_CODE|SEC_READONLY)) != SEC_READONLY)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static bfd_boolean
|
||||
_bfd_e2k_pm_elf_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
|
||||
{
|
||||
const struct elf_backend_data *const bed = get_elf_backend_data (abfd);
|
||||
struct elf_segment_map **m = &elf_seg_map (abfd);
|
||||
struct elf_segment_map **first_load = NULL;
|
||||
struct elf_segment_map **last_load = NULL;
|
||||
bfd_boolean moved_headers = FALSE;
|
||||
int sizeof_headers;
|
||||
|
||||
sizeof_headers = bfd_sizeof_headers (abfd, info);
|
||||
|
||||
while (*m != NULL)
|
||||
{
|
||||
struct elf_segment_map *seg = *m;
|
||||
|
||||
if (seg->p_type == PT_LOAD)
|
||||
{
|
||||
bfd_boolean executable = segment_executable (seg);
|
||||
|
||||
/* First, we're just finding the earliest PT_LOAD.
|
||||
By the normal rules, this will be the lowest-addressed one.
|
||||
We only have anything interesting to do if it's executable. */
|
||||
last_load = m;
|
||||
if (first_load == NULL)
|
||||
{
|
||||
if (!executable)
|
||||
goto next;
|
||||
first_load = m;
|
||||
}
|
||||
/* Now that we've noted the first PT_LOAD, we're looking for
|
||||
the first non-executable PT_LOAD with a nonempty p_filesz. */
|
||||
else if (!moved_headers
|
||||
&& segment_eligible_for_headers (seg, bed->minpagesize,
|
||||
sizeof_headers))
|
||||
{
|
||||
/* This is the one we were looking for!
|
||||
|
||||
First, clear the flags on previous segments that
|
||||
say they include the file header and phdrs. */
|
||||
struct elf_segment_map *prevseg;
|
||||
for (prevseg = *first_load;
|
||||
prevseg != seg;
|
||||
prevseg = prevseg->next)
|
||||
if (prevseg->p_type == PT_LOAD)
|
||||
{
|
||||
prevseg->includes_filehdr = 0;
|
||||
prevseg->includes_phdrs = 0;
|
||||
}
|
||||
|
||||
/* This segment will include those headers instead. */
|
||||
seg->includes_filehdr = 1;
|
||||
seg->includes_phdrs = 1;
|
||||
|
||||
moved_headers = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
next:
|
||||
m = &seg->next;
|
||||
}
|
||||
|
||||
if (first_load != last_load && moved_headers)
|
||||
{
|
||||
/* Now swap the first and last PT_LOAD segments'
|
||||
positions in segment_map. */
|
||||
struct elf_segment_map *first = *first_load;
|
||||
struct elf_segment_map *last = *last_load;
|
||||
*first_load = first->next;
|
||||
first->next = last->next;
|
||||
last->next = first;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define elf_backend_modify_segment_map _bfd_e2k_pm_elf_modify_segment_map
|
||||
|
||||
/* The first Elf32_Addr GOT entry containing link-time "address" of `_DYNAMIC'
|
||||
is followed by two 16 bytes long appropriately aligned descriptors containing
|
||||
`struct link_map *' and `&_dl_fixup ()'. */
|
||||
#define elf_backend_got_header_size 48
|
||||
#define TARGET_LITTLE_SYM e2k_pm_elf32_vec
|
||||
/* The only macro that should be defined prior to inclusion of
|
||||
elf32-e2k.c so as to prevent it from including elf32-target.h
|
||||
before we redefine all other macros of interest. */
|
||||
#define TARGET_LITTLE_NAME "elf32-e2k-pm"
|
||||
|
||||
#include "elf32-e2k.c"
|
||||
|
||||
#undef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM e2k_pm_elf32_vec
|
||||
|
||||
#include "elfxx-e2k-pm.h"
|
||||
|
||||
#include "elf32-target.h"
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#if ! defined TARGET_LITTLE_SYM
|
||||
|
||||
#include "sysdep.h"
|
||||
#include "bfd.h"
|
||||
#include "libbfd.h"
|
||||
|
@ -28,9 +26,6 @@
|
|||
#include "elf/e2k.h"
|
||||
#include "elfxx-e2k.h"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static int
|
||||
elf32_e2k_write_out_phdrs (bfd *abfd,
|
||||
const Elf_Internal_Phdr *phdr,
|
||||
|
@ -111,6 +106,7 @@ static const struct elf_size_info elf32_e2k_size_info = {
|
|||
#define bfd_elf32_bfd_reloc_type_lookup _bfd_e2k_elf_reloc_type_lookup
|
||||
#define bfd_elf32_bfd_reloc_name_lookup _bfd_e2k_elf_reloc_name_lookup
|
||||
#define bfd_elf32_bfd_merge_private_bfd_data _bfd_e2k_elf_merge_private_bfd_data
|
||||
|
||||
#define bfd_elf32_mkobject _bfd_e2k_elf_mkobject
|
||||
#define bfd_elf32_bfd_link_hash_table_create _bfd_e2k_elf_link_hash_table_create
|
||||
#define bfd_elf32_bfd_final_link _bfd_e2k_elf_final_link
|
||||
|
@ -140,10 +136,11 @@ static const struct elf_size_info elf32_e2k_size_info = {
|
|||
#define elf_backend_finish_dynamic_symbol _bfd_e2k_elf_finish_dynamic_symbol
|
||||
#define elf_backend_reloc_type_class _bfd_e2k_elf_reloc_type_class
|
||||
#define elf_backend_finish_dynamic_sections _bfd_e2k_elf_finish_dynamic_sections
|
||||
#define elf_backend_post_process_headers _bfd_e2k_elf_post_process_headers
|
||||
#define elf_backend_init_file_header _bfd_e2k_elf_init_file_header
|
||||
#define elf_backend_ignore_discarded_relocs _bfd_e2k_elf_ignore_discarded_relocs
|
||||
#define elf_backend_hide_symbol _bfd_e2k_elf_hide_symbol
|
||||
#define elf_backend_object_p _bfd_e2k_elf_object_p
|
||||
|
||||
#define elf_backend_setup_gnu_properties _bfd_e2k_elf_link_setup_gnu_properties
|
||||
|
||||
/* Make tests employing `gc-sections' option PASS. I wonder if any backend-
|
||||
|
@ -170,6 +167,10 @@ static const struct elf_size_info elf32_e2k_size_info = {
|
|||
|
||||
#define elf_backend_r_none_info R_E2K_NONE
|
||||
|
||||
/* Let `bfd_elf_size_dynamic_sections ()' treat a missing PT_GNU_STACK as an
|
||||
unexecutable one to be in line with the Kernel and glibc. */
|
||||
#define elf_backend_default_execstack 0
|
||||
|
||||
|
||||
#define ELF_ARCH bfd_arch_e2k
|
||||
|
||||
|
@ -180,19 +181,13 @@ static const struct elf_size_info elf32_e2k_size_info = {
|
|||
|
||||
#define ELF_MAXPAGESIZE 0x1000
|
||||
|
||||
#ifndef elf_backend_got_header_size
|
||||
/* The first entry in `.got' is reserved for the `_DYNAMIC' link-time
|
||||
address. */
|
||||
#define elf_backend_got_header_size 12
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM e2k_elf32_vec
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_LITTLE_NAME
|
||||
# define TARGET_LITTLE_NAME "elf32-e2k"
|
||||
#endif
|
||||
|
||||
|
||||
# include "elf32-target.h"
|
||||
#endif
|
||||
|
|
|
@ -75,6 +75,13 @@ elf32_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||
/* FIXME: This should not be static. */
|
||||
static unsigned long previous_ibfd_e_flags = (unsigned long) -1;
|
||||
|
||||
/* No matter whether the output BFD is ELF or not, check magic in the input
|
||||
one provided that it is. */
|
||||
if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour
|
||||
&& ! _bfd_sparc_elf_check_magic (ibfd))
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|
||||
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
|
||||
return TRUE;
|
||||
|
@ -147,6 +154,17 @@ sparc_final_write_processing (bfd *abfd)
|
|||
elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1
|
||||
| EF_SPARC_SUN_US3;
|
||||
break;
|
||||
/* I cannot understand why in 32-bit mode the same functionality as in
|
||||
(sparc_elf_final_processing (), tc-sparc.c) is DUPLICATED here. In fact
|
||||
we set the same value of `e_flags' both there and here. */
|
||||
case bfd_mach_sparc_v8plus_r1000:
|
||||
case bfd_mach_sparc_v8plus_r2000:
|
||||
case bfd_mach_sparc_v8plus_r2000_plus:
|
||||
elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
|
||||
elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
|
||||
elf_elfheader (abfd)->e_flags |= (EF_SPARC_32PLUS | EF_SPARC_SUN_US1
|
||||
| EF_SPARC_SUN_US3 | EF_SPARC_MCST);
|
||||
break;
|
||||
case bfd_mach_sparc_sparclite_le:
|
||||
elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
|
||||
break;
|
||||
|
@ -273,6 +291,18 @@ elf32_sparc_reloc_type_class (const struct bfd_link_info *info,
|
|||
|
||||
#define elf_backend_linux_prpsinfo32_ugid16 TRUE
|
||||
|
||||
/* EIR-specific hacks. */
|
||||
#define bfd_elf32_bfd_link_add_symbols _bfd_sparc_elf_link_add_symbols
|
||||
#define bfd_elf32_bfd_final_link _bfd_sparc_elf_final_link
|
||||
#define elf_backend_ignore_discarded_relocs _bfd_sparc_elf_ignore_discarded_relocs
|
||||
#define elf_backend_hide_symbol _bfd_sparc_elf_hide_symbol
|
||||
#define bfd_elf32_write_object_contents _bfd_sparc_elf_write_object_contents
|
||||
|
||||
/* Let `.magic' section be `SHT_NOTE'. */
|
||||
#define elf_backend_special_sections _bfd_sparc_elf_special_sections
|
||||
|
||||
#define elf_backend_extern_protected_data 1
|
||||
|
||||
#include "elf32-target.h"
|
||||
|
||||
/* Solaris 2. */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* Signalize that elf64-e2k.c shouldn't set up bfd target vector for us.
|
||||
We'll do it ourselves after redefining a few macros. */
|
||||
#define TARGET_KPDA
|
||||
/* The only macro that should be defined prior to inclusion of
|
||||
elf64-e2k.c so as to prevent it from including elf64-target.h
|
||||
before we redefine all other macros of interest. */
|
||||
#define TARGET_LITTLE_NAME "elf64-e2k-kpda"
|
||||
#include "elf64-e2k.c"
|
||||
#undef TARGET_KPDA
|
||||
|
||||
#if 0
|
||||
static void
|
||||
|
@ -25,9 +25,6 @@ _bfd_e2k_kpda_elf64_post_process_headers (bfd *abfd,
|
|||
#undef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM e2k_kpda_elf64_vec
|
||||
|
||||
#undef TARGET_LITTLE_NAME
|
||||
#define TARGET_LITTLE_NAME "elf64-e2k-kpda"
|
||||
|
||||
#define ELF_OSABI ELFOSABI_KPDA
|
||||
|
||||
/* Now set up the target vector. */
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* The only macro that should be defined prior to inclusion of
|
||||
elf64-e2k.c so as to prevent it from including elf64-target.h
|
||||
before we redefine all other macros of interest. */
|
||||
#define TARGET_LITTLE_NAME "elf64-e2k-pm"
|
||||
#include "elf64-e2k.c"
|
||||
|
||||
#undef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM e2k_pm_elf64_vec
|
||||
|
||||
#include "elfxx-e2k-pm.h"
|
||||
|
||||
#include "elf64-target.h"
|
|
@ -0,0 +1,16 @@
|
|||
/* The only macro that should be defined prior to inclusion of
|
||||
elf64-e2k.c so as to prevent it from including elf64-target.h
|
||||
before we redefine all other macros of interest. */
|
||||
#define TARGET_LITTLE_NAME "elf64-e2k-uclibc"
|
||||
#include "elf64-e2k.c"
|
||||
|
||||
#undef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM e2k_uclibc_elf64_vec
|
||||
|
||||
#include "elfxx-e2k-uclibc.h"
|
||||
|
||||
#undef bfd_elf64_bfd_merge_private_bfd_data
|
||||
#define bfd_elf64_bfd_merge_private_bfd_data \
|
||||
_bfd_e2k_uclibc_elf_merge_private_bfd_data
|
||||
|
||||
#include "elf64-target.h"
|
|
@ -100,6 +100,7 @@ static const struct elf_size_info elf64_e2k_size_info = {
|
|||
#define bfd_elf64_bfd_reloc_type_lookup _bfd_e2k_elf_reloc_type_lookup
|
||||
#define bfd_elf64_bfd_reloc_name_lookup _bfd_e2k_elf_reloc_name_lookup
|
||||
#define bfd_elf64_bfd_merge_private_bfd_data _bfd_e2k_elf_merge_private_bfd_data
|
||||
|
||||
#define bfd_elf64_mkobject _bfd_e2k_elf_mkobject
|
||||
#define bfd_elf64_bfd_link_hash_table_create _bfd_e2k_elf_link_hash_table_create
|
||||
#define bfd_elf64_bfd_final_link _bfd_e2k_elf_final_link
|
||||
|
@ -134,10 +135,11 @@ static const struct elf_size_info elf64_e2k_size_info = {
|
|||
#define elf_backend_finish_dynamic_symbol _bfd_e2k_elf_finish_dynamic_symbol
|
||||
#define elf_backend_reloc_type_class _bfd_e2k_elf_reloc_type_class
|
||||
#define elf_backend_finish_dynamic_sections _bfd_e2k_elf_finish_dynamic_sections
|
||||
#define elf_backend_post_process_headers _bfd_e2k_elf_post_process_headers
|
||||
#define elf_backend_init_file_header _bfd_e2k_elf_init_file_header
|
||||
#define elf_backend_ignore_discarded_relocs _bfd_e2k_elf_ignore_discarded_relocs
|
||||
#define elf_backend_hide_symbol _bfd_e2k_elf_hide_symbol
|
||||
#define elf_backend_object_p _bfd_e2k_elf_object_p
|
||||
|
||||
#define elf_backend_setup_gnu_properties _bfd_e2k_elf_link_setup_gnu_properties
|
||||
|
||||
/* Make tests employing `gc-sections' option PASS. I wonder if any backend-
|
||||
|
@ -168,9 +170,12 @@ static const struct elf_size_info elf64_e2k_size_info = {
|
|||
|
||||
#define elf_backend_r_none_info R_E2K_NONE
|
||||
|
||||
/* Let `bfd_elf_size_dynamic_sections ()' treat a missing PT_GNU_STACK as an
|
||||
unexecutable one to be in line with the Kernel and glibc. */
|
||||
#define elf_backend_default_execstack 0
|
||||
|
||||
#define TARGET_LITTLE_SYM e2k_elf64_vec
|
||||
#define TARGET_LITTLE_NAME "elf64-e2k"
|
||||
|
||||
#define ELF_ARCH bfd_arch_e2k
|
||||
|
||||
#define ELF_MACHINE_CODE EM_MCST_ELBRUS
|
||||
|
@ -180,8 +185,7 @@ static const struct elf_size_info elf64_e2k_size_info = {
|
|||
|
||||
#define ELF_MAXPAGESIZE 0x1000
|
||||
|
||||
/* Don't rush to set up BFD target vector if we are included on behalf of KPDA
|
||||
target: some of the above definitions are going to be altered by it. */
|
||||
#ifndef TARGET_KPDA
|
||||
#ifndef TARGET_LITTLE_NAME
|
||||
# define TARGET_LITTLE_NAME "elf64-e2k"
|
||||
# include "elf64-target.h"
|
||||
#endif /* ! TARGET_KPDA */
|
||||
#endif
|
||||
|
|
|
@ -657,6 +657,12 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||
flagword new_flags, old_flags;
|
||||
int new_mm, old_mm;
|
||||
|
||||
/* No matter whether the output BFD is ELF or not, check magic in the input
|
||||
one provided that it is. */
|
||||
if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour
|
||||
&& ! _bfd_sparc_elf_check_magic (ibfd))
|
||||
return FALSE;
|
||||
|
||||
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|
||||
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
|
||||
return TRUE;
|
||||
|
@ -677,8 +683,10 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||
{
|
||||
error = FALSE;
|
||||
|
||||
/* MCST extensions should be considered Sun- rather than HAL-compatible.
|
||||
See the code below. */
|
||||
#define EF_SPARC_ISA_EXTENSIONS \
|
||||
(EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3 | EF_SPARC_HAL_R1)
|
||||
(EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3 | EF_SPARC_MCST | EF_SPARC_HAL_R1)
|
||||
|
||||
if ((ibfd->flags & DYNAMIC) != 0)
|
||||
{
|
||||
|
@ -694,12 +702,14 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||
/* Choose the highest architecture requirements. */
|
||||
old_flags |= (new_flags & EF_SPARC_ISA_EXTENSIONS);
|
||||
new_flags |= (old_flags & EF_SPARC_ISA_EXTENSIONS);
|
||||
if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3))
|
||||
if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3
|
||||
| EF_SPARC_MCST))
|
||||
&& (old_flags & EF_SPARC_HAL_R1))
|
||||
{
|
||||
error = TRUE;
|
||||
_bfd_error_handler
|
||||
(_("%pB: linking UltraSPARC specific with HAL specific code"),
|
||||
(_("%pB: linking either UltraSPARC or MCST specific "
|
||||
"with HAL specific code"),
|
||||
ibfd);
|
||||
}
|
||||
/* Choose the most restrictive memory ordering. */
|
||||
|
@ -970,6 +980,18 @@ const struct elf_size_info elf64_sparc_size_info =
|
|||
/* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table. */
|
||||
#define elf_backend_plt_alignment 8
|
||||
|
||||
/* EIR-specific hacks. */
|
||||
#define bfd_elf64_bfd_link_add_symbols _bfd_sparc_elf_link_add_symbols
|
||||
#define bfd_elf64_bfd_final_link _bfd_sparc_elf_final_link
|
||||
#define elf_backend_ignore_discarded_relocs _bfd_sparc_elf_ignore_discarded_relocs
|
||||
#define elf_backend_hide_symbol _bfd_sparc_elf_hide_symbol
|
||||
#define bfd_elf64_write_object_contents _bfd_sparc_elf_write_object_contents
|
||||
|
||||
/* Let `.magic' section be `SHT_NOTE'. */
|
||||
#define elf_backend_special_sections _bfd_sparc_elf_special_sections
|
||||
|
||||
#define elf_backend_extern_protected_data 1
|
||||
|
||||
#include "elf64-target.h"
|
||||
|
||||
/* FreeBSD support */
|
||||
|
|
|
@ -1906,26 +1906,23 @@ _bfd_elf_add_default_symbol (bfd *abfd,
|
|||
|
||||
if (hi->def_regular || ELF_COMMON_DEF_P (hi))
|
||||
{
|
||||
struct bfd_elf_version_tree *vertree = hi->verinfo.vertree;
|
||||
|
||||
/* If the undecorated symbol will have a version added by a
|
||||
script different to H, then don't indirect to/from the
|
||||
undecorated symbol. This isn't ideal because we may not yet
|
||||
have seen symbol versions, if given by a script on the
|
||||
command line rather than via --version-script. */
|
||||
if (hi->verinfo.vertree == NULL && info->version_info != NULL)
|
||||
if (vertree == NULL && info->version_info != NULL)
|
||||
{
|
||||
bfd_boolean hide;
|
||||
|
||||
hi->verinfo.vertree
|
||||
vertree
|
||||
= bfd_find_version_for_sym (info->version_info,
|
||||
hi->root.root.string, &hide);
|
||||
if (hi->verinfo.vertree != NULL && hide)
|
||||
{
|
||||
(*bed->elf_backend_hide_symbol) (info, hi, TRUE);
|
||||
goto nondefault;
|
||||
}
|
||||
}
|
||||
if (hi->verinfo.vertree != NULL
|
||||
&& strcmp (p + 1 + (p[1] == '@'), hi->verinfo.vertree->name) != 0)
|
||||
if (vertree != NULL
|
||||
&& strcmp (p + 1 + (p[1] == '@'), vertree->name) != 0)
|
||||
goto nondefault;
|
||||
}
|
||||
|
||||
|
@ -9506,6 +9503,12 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
|
|||
free (sort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: currently there's an unresolved issue on Sparc making me
|
||||
occasionally allocate excessive space in `.rela.got', which is why
|
||||
'>=' is temporarely used here instead of '=='. */
|
||||
BFD_ASSERT (o->size >= o->reloc_count * ext_size);
|
||||
|
||||
erel = o->contents;
|
||||
erelend = o->contents + o->size;
|
||||
p = sort + o->output_offset * opb / ext_size * sort_elt;
|
||||
|
@ -10934,7 +10937,16 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
|
|||
|
||||
/* We need to reverse-copy input .ctors/.dtors sections if
|
||||
they are placed in .init_array/.finit_array for output. */
|
||||
if (o->size > address_size
|
||||
if (
|
||||
#if 1
|
||||
/* However, there's no point in doing so in E2K Protected
|
||||
Mode. */
|
||||
(((elf_elfheader (input_bfd)->e_flags & 32 /* EF_E2K_PM */)
|
||||
!= 32 /* EF_E2K_PM */)
|
||||
|| (strstr (input_bfd->xvec->name, "e2k-pm") == NULL))
|
||||
&&
|
||||
#endif /* 0 */
|
||||
o->size > address_size
|
||||
&& ((strncmp (o->name, ".ctors", 6) == 0
|
||||
&& strcmp (o->output_section->name,
|
||||
".init_array") == 0)
|
||||
|
@ -11197,7 +11209,14 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
|
|||
bfd_elf_discard_info rely on reloc offsets
|
||||
being ordered. */
|
||||
irela->r_offset = last_offset;
|
||||
irela->r_info = 0;
|
||||
/* FIXME: I suppose that the original code setting
|
||||
`r_info' to 0 is sure to lead for an invalid result not
|
||||
only for E2K but for all targets with `R_xxx_NONE
|
||||
!= 0'. Moreover, it discards my attempts to setup
|
||||
R_E2K_NONE instead of an original relocation against a
|
||||
symbol coming from a discarded section in `_bfd_e2k_elf
|
||||
_relocate_section ()'. */
|
||||
irela->r_info = bed->r_none_info;
|
||||
irela->r_addend = 0;
|
||||
continue;
|
||||
}
|
||||
|
@ -14783,9 +14802,13 @@ _bfd_elf_copy_link_hash_symbol_type (bfd *abfd,
|
|||
void
|
||||
elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
|
||||
{
|
||||
static const char zero_rel[sizeof (Elf_Internal_Rela)];
|
||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||
bfd_byte *loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela);
|
||||
BFD_ASSERT (loc + bed->s->sizeof_rela <= s->contents + s->size);
|
||||
|
||||
BFD_ASSERT (memcmp (rel, zero_rel, sizeof (zero_rel)) != 0);
|
||||
|
||||
bed->s->swap_reloca_out (abfd, rel, loc);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
#include "sysdep.h"
|
||||
#include "bfd.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elfxx-e2k.h"
|
||||
#include "elfxx-e2k-pm.h"
|
||||
|
||||
static bfd_boolean
|
||||
segment_executable (struct elf_segment_map *seg)
|
||||
{
|
||||
if (seg->p_flags_valid)
|
||||
return (seg->p_flags & PF_X) != 0;
|
||||
else
|
||||
{
|
||||
/* The p_flags value has not been computed yet,
|
||||
so we have to look through the sections. */
|
||||
unsigned int i;
|
||||
for (i = 0; i < seg->count; ++i)
|
||||
if (seg->sections[i]->flags & SEC_CODE)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Determine if this segment is eligible to receive the file and program
|
||||
headers. It must be read-only and non-executable.
|
||||
Its first section must start far enough past the page boundary to
|
||||
allow space for the headers. */
|
||||
static bfd_boolean
|
||||
segment_eligible_for_headers (struct elf_segment_map *seg,
|
||||
bfd_vma minpagesize, bfd_vma sizeof_headers)
|
||||
{
|
||||
unsigned int i;
|
||||
if (seg->count == 0 || seg->sections[0]->lma % minpagesize < sizeof_headers)
|
||||
return FALSE;
|
||||
for (i = 0; i < seg->count; ++i)
|
||||
{
|
||||
if ((seg->sections[i]->flags & (SEC_CODE|SEC_READONLY)) != SEC_READONLY)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bfd_boolean
|
||||
_bfd_e2k_pm_elf_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
|
||||
{
|
||||
const struct elf_backend_data *const bed = get_elf_backend_data (abfd);
|
||||
struct elf_segment_map **m = &elf_seg_map (abfd);
|
||||
struct elf_segment_map **first_load = NULL;
|
||||
struct elf_segment_map **last_load = NULL;
|
||||
bfd_boolean moved_headers = FALSE;
|
||||
int sizeof_headers;
|
||||
|
||||
if (info != NULL)
|
||||
/* We're doing linking, so evalute SIZEOF_HEADERS as in a linker script. */
|
||||
sizeof_headers = bfd_sizeof_headers (abfd, info);
|
||||
else
|
||||
{
|
||||
/* We're not doing linking, so this is objcopy or suchlike.
|
||||
We just need to collect the size of the existing headers. */
|
||||
struct elf_segment_map *seg;
|
||||
sizeof_headers = bed->s->sizeof_ehdr;
|
||||
for (seg = *m; seg != NULL; seg = seg->next)
|
||||
sizeof_headers += bed->s->sizeof_phdr;
|
||||
}
|
||||
|
||||
while (*m != NULL)
|
||||
{
|
||||
struct elf_segment_map *seg = *m;
|
||||
|
||||
if (seg->p_type == PT_LOAD)
|
||||
{
|
||||
bfd_boolean executable = segment_executable (seg);
|
||||
|
||||
/* First, we're just finding the earliest PT_LOAD.
|
||||
By the normal rules, this will be the lowest-addressed one.
|
||||
We only have anything interesting to do if it's executable. */
|
||||
last_load = m;
|
||||
if (first_load == NULL)
|
||||
{
|
||||
if (!executable)
|
||||
goto next;
|
||||
first_load = m;
|
||||
}
|
||||
/* Now that we've noted the first PT_LOAD, we're looking for
|
||||
the first non-executable PT_LOAD with a nonempty p_filesz. */
|
||||
else if (!moved_headers
|
||||
&& segment_eligible_for_headers (seg, bed->minpagesize,
|
||||
sizeof_headers))
|
||||
{
|
||||
/* This is the one we were looking for!
|
||||
|
||||
First, clear the flags on previous segments that
|
||||
say they include the file header and phdrs. */
|
||||
struct elf_segment_map *prevseg;
|
||||
for (prevseg = *first_load;
|
||||
prevseg != seg;
|
||||
prevseg = prevseg->next)
|
||||
if (prevseg->p_type == PT_LOAD)
|
||||
{
|
||||
prevseg->includes_filehdr = 0;
|
||||
prevseg->includes_phdrs = 0;
|
||||
}
|
||||
|
||||
/* This segment will include those headers instead. */
|
||||
seg->includes_filehdr = 1;
|
||||
seg->includes_phdrs = 1;
|
||||
|
||||
moved_headers = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
next:
|
||||
m = &seg->next;
|
||||
}
|
||||
|
||||
if (first_load != last_load && moved_headers)
|
||||
{
|
||||
/* Now swap the first and last PT_LOAD segments'
|
||||
positions in segment_map. */
|
||||
struct elf_segment_map *first = *first_load;
|
||||
struct elf_segment_map *last = *last_load;
|
||||
*first_load = first->next;
|
||||
first->next = last->next;
|
||||
last->next = first;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bfd_boolean
|
||||
_bfd_e2k_pm_elf_object_p (bfd *abfd)
|
||||
{
|
||||
return _bfd_e2k_elf_object_p_1 (abfd, TRUE);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
extern bfd_boolean _bfd_e2k_pm_elf_modify_segment_map
|
||||
(bfd *, struct bfd_link_info *);
|
||||
|
||||
extern bfd_boolean _bfd_e2k_pm_elf_object_p
|
||||
(bfd *);
|
||||
|
||||
#undef elf_backend_modify_segment_map
|
||||
#define elf_backend_modify_segment_map _bfd_e2k_pm_elf_modify_segment_map
|
||||
|
||||
#undef elf_backend_object_p
|
||||
#define elf_backend_object_p _bfd_e2k_pm_elf_object_p
|
||||
|
||||
/* The first Elf32_Addr GOT entry containing link-time "address" of `_DYNAMIC'
|
||||
is followed by two 16 bytes long appropriately aligned descriptors containing
|
||||
`struct link_map *' and `&_dl_fixup ()'. */
|
||||
#undef elf_backend_got_header_size
|
||||
#define elf_backend_got_header_size 48
|
|
@ -0,0 +1,12 @@
|
|||
#include "sysdep.h"
|
||||
#include "bfd.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elfxx-e2k.h"
|
||||
#include "elfxx-e2k-uclibc.h"
|
||||
|
||||
bfd_boolean
|
||||
_bfd_e2k_uclibc_elf_merge_private_bfd_data (bfd *ibfd,
|
||||
struct bfd_link_info *info)
|
||||
{
|
||||
return _bfd_e2k_elf_merge_private_bfd_data_1 (ibfd, info->output_bfd, TRUE);
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
extern bfd_boolean _bfd_e2k_uclibc_elf_merge_private_bfd_data
|
||||
(bfd *ibfd, struct bfd_link_info *info);
|
1554
bfd/elfxx-e2k.c
1554
bfd/elfxx-e2k.c
File diff suppressed because it is too large
Load Diff
|
@ -72,12 +72,14 @@ struct _bfd_e2k_elf_link_hash_table
|
|||
/* PLTGOT header, its size and offsets at which it should be adjusted at
|
||||
link time. */
|
||||
const unsigned int *plt_got_header;
|
||||
unsigned int plt_got_header_nop_offset;
|
||||
unsigned int plt_got_link_map_ld_offset;
|
||||
unsigned int plt_got_dl_fixup_ld_offset;
|
||||
unsigned int plt_got_header_size;
|
||||
|
||||
|
||||
const unsigned int *plt_got_primary_entry;
|
||||
unsigned int plt_got_entry_nop_offset;
|
||||
unsigned int plt_got_target_ld_offset;
|
||||
unsigned int plt_got_primary_entry_size;
|
||||
|
||||
|
@ -136,6 +138,9 @@ struct _bfd_e2k_elf_link_hash_table
|
|||
/* The numbers of primary and secondary PLT entries in the current link. */
|
||||
bfd_vma primary_plt_num;
|
||||
bfd_vma secondary_plt_num;
|
||||
|
||||
int ranges_num;
|
||||
void *ranges;
|
||||
};
|
||||
|
||||
/* This variable should be accessible from multiple modules. Moreover, it
|
||||
|
@ -185,7 +190,7 @@ extern bfd_boolean _bfd_e2k_elf_final_link
|
|||
|
||||
/* Methods of struct elf_backend_data */
|
||||
|
||||
extern void _bfd_e2k_elf_info_to_howto
|
||||
extern bfd_boolean _bfd_e2k_elf_info_to_howto
|
||||
(bfd *, arelent *, Elf_Internal_Rela *);
|
||||
|
||||
extern bfd_boolean _bfd_e2k_elf_add_symbol_hook
|
||||
|
@ -221,6 +226,8 @@ extern unsigned int _bfd_e2k_elf_action_discarded
|
|||
|
||||
extern bfd_boolean simulating_mode;
|
||||
|
||||
//extern bfd_boolean pack_cud_gd;
|
||||
|
||||
extern int simulate_relocate_section (bfd *input_bfd,
|
||||
asection *input_section,
|
||||
bfd_byte *contents,
|
||||
|
@ -243,10 +250,7 @@ _bfd_e2k_elf_reloc_type_class (const struct bfd_link_info *,
|
|||
extern bfd_boolean _bfd_e2k_elf_finish_dynamic_sections
|
||||
(bfd *, struct bfd_link_info *);
|
||||
|
||||
extern void _bfd_e2k_elf_post_process_headers_1
|
||||
(bfd *, struct bfd_link_info *, bfd_boolean);
|
||||
|
||||
extern void _bfd_e2k_elf_post_process_headers
|
||||
extern bfd_boolean _bfd_e2k_elf_init_file_header
|
||||
(bfd *, struct bfd_link_info *);
|
||||
|
||||
extern bfd_boolean _bfd_e2k_elf_ignore_discarded_relocs
|
||||
|
@ -287,7 +291,8 @@ extern long _bfd_e2k_elf_get_synthetic_symtab
|
|||
extern void _bfd_e2k_elf_after_parse (int);
|
||||
|
||||
extern void _bfd_e2k_elf_after_open (int, int, int, bfd_boolean, bfd_boolean,
|
||||
bfd_boolean, bfd_boolean, bfd_boolean);
|
||||
bfd_boolean, bfd_boolean, bfd_boolean,
|
||||
bfd_boolean);
|
||||
|
||||
extern const struct bfd_elf_special_section _bfd_e2k_elf_special_sections[];
|
||||
|
||||
|
|
|
@ -2294,6 +2294,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Input relocations in `.rela.xxx' sections against ifunctions defined
|
||||
in regular object files are not copied to the output file (see how
|
||||
they are treated in relocate_section () below). Therefore, avoid
|
||||
allocating redundant space for them below. The failure to recognize
|
||||
this issue turned out to be the reason for Bugs #81941 and #88486. */
|
||||
if (h->dyn_relocs != NULL
|
||||
&& h->type == STT_GNU_IFUNC
|
||||
&& h->def_regular)
|
||||
h->dyn_relocs = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2424,6 +2434,20 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
|
|||
{
|
||||
struct elf_dyn_relocs *p;
|
||||
|
||||
/* Don't allocate space for dynamic relocations not only if the
|
||||
section to which they are applied is discarded (condition in the
|
||||
loop a few lines below takes care of that), but also if the section
|
||||
"against" which they are resolved is. This lets me resolve an issue
|
||||
when LD manages without creation of dynamic relocations against
|
||||
discarded `.gnu.linkonce'-sections within kept `.eh_frame's (as you
|
||||
remember the contents of the latter is modified somehow to
|
||||
eliminate the need for dynamic relocations then): allocation of
|
||||
redundant space would lead to an assertion failure described in
|
||||
Bug #79553. For a more detailed example see the commit. */
|
||||
if (!bfd_is_abs_section (s)
|
||||
&& bfd_is_abs_section (s->output_section))
|
||||
continue;
|
||||
|
||||
for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next)
|
||||
{
|
||||
if (!bfd_is_abs_section (p->sec)
|
||||
|
@ -4737,9 +4761,18 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
|
|||
? 0 : htab->plt_entry_size);
|
||||
}
|
||||
|
||||
if (htab->elf.sgot)
|
||||
{
|
||||
if (bfd_is_abs_section (htab->elf.sgot->output_section))
|
||||
{
|
||||
_bfd_error_handler
|
||||
(_("discarded output section: `%pA'"), htab->elf.sgot);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Set the first entry in the global offset table to the address of
|
||||
the dynamic section. */
|
||||
if (htab->elf.sgot && htab->elf.sgot->size > 0)
|
||||
if (htab->elf.sgot->size > 0)
|
||||
{
|
||||
bfd_vma val = (sdyn ?
|
||||
sdyn->output_section->vma + sdyn->output_offset :
|
||||
|
@ -4748,9 +4781,9 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
|
|||
SPARC_ELF_PUT_WORD (htab, output_bfd, val, htab->elf.sgot->contents);
|
||||
}
|
||||
|
||||
if (htab->elf.sgot)
|
||||
elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize =
|
||||
SPARC_ELF_WORD_BYTES (htab);
|
||||
}
|
||||
|
||||
/* Fill PLT and GOT entries for local STT_GNU_IFUNC symbols. */
|
||||
htab_traverse (htab->loc_hash_table, finish_local_dynamic_symbol, info);
|
||||
|
@ -4805,11 +4838,23 @@ _bfd_sparc_elf_object_p (bfd *abfd)
|
|||
| ELF_SPARC_HWCAP2_RLE
|
||||
| ELF_SPARC_HWCAP2_SHA3);
|
||||
|
||||
unsigned int r2000_hwcaps_mask = ELF_SPARC_HWCAP_SAPPHIRE;
|
||||
unsigned int r2000_plus_hwcaps2_mask = ELF_SPARC_HWCAP2_SAPPHIRE_PLUS;
|
||||
|
||||
if (ABI_64_P (abfd))
|
||||
{
|
||||
unsigned long mach = bfd_mach_sparc_v9;
|
||||
|
||||
if (hwcaps2->i & m8_hwcaps2_mask)
|
||||
if (elf_elfheader (abfd)->e_flags & EF_SPARC_MCST)
|
||||
{
|
||||
if (hwcaps2->i & r2000_plus_hwcaps2_mask)
|
||||
mach = bfd_mach_sparc_v9_r2000_plus;
|
||||
else if (hwcaps->i & r2000_hwcaps_mask)
|
||||
mach = bfd_mach_sparc_v9_r2000;
|
||||
else
|
||||
mach = bfd_mach_sparc_v9_r1000;
|
||||
}
|
||||
else if (hwcaps2->i & m8_hwcaps2_mask)
|
||||
mach = bfd_mach_sparc_v9m8;
|
||||
else if (hwcaps2->i & v9m_hwcaps2_mask)
|
||||
mach = bfd_mach_sparc_v9m;
|
||||
|
@ -4831,7 +4876,20 @@ _bfd_sparc_elf_object_p (bfd *abfd)
|
|||
{
|
||||
if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS)
|
||||
{
|
||||
if (hwcaps2->i & m8_hwcaps2_mask)
|
||||
if (elf_elfheader (abfd)->e_flags & EF_SPARC_MCST)
|
||||
{
|
||||
if (hwcaps2->i & r2000_plus_hwcaps2_mask)
|
||||
return
|
||||
bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
|
||||
bfd_mach_sparc_v8plus_r2000_plus);
|
||||
else if (hwcaps->i & r2000_hwcaps_mask)
|
||||
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
|
||||
bfd_mach_sparc_v8plus_r2000);
|
||||
else
|
||||
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
|
||||
bfd_mach_sparc_v8plus_r1000);
|
||||
}
|
||||
else if (hwcaps2->i & m8_hwcaps2_mask)
|
||||
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
|
||||
bfd_mach_sparc_v8plusm8);
|
||||
else if (hwcaps2->i & v9m_hwcaps2_mask)
|
||||
|
@ -4933,3 +4991,380 @@ _bfd_sparc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* EIR specific methods. */
|
||||
|
||||
static int link_mixed_eir_phase;
|
||||
static bfd_boolean met_eir_section;
|
||||
static bfd_boolean eir_in_this_bfd;
|
||||
|
||||
void
|
||||
_bfd_sparc_elf_after_parse (int phase)
|
||||
{
|
||||
link_mixed_eir_phase = phase;
|
||||
}
|
||||
|
||||
static void
|
||||
search_eir (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (strcmp (sect->name, ".pack_pure_eir") == 0
|
||||
|| strcmp (sect->name, ".pack_mixed_eir") == 0)
|
||||
{
|
||||
met_eir_section = TRUE;
|
||||
eir_in_this_bfd = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
discard_unsuitable_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
||||
if ((link_mixed_eir_phase == 1 && met_eir_section)
|
||||
|| (link_mixed_eir_phase == 3
|
||||
&& (!(met_eir_section && !eir_in_this_bfd)
|
||||
|| abfd->my_archive)))
|
||||
{
|
||||
/* SEC_DEBUGGING is required to fool lang_gc_sections in ldlang.c */
|
||||
sect->flags |= (SEC_EXCLUDE | SEC_DEBUGGING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
search_pure_eir (bfd *abfd, asection *sec, void *no_pure_eir)
|
||||
{
|
||||
if (strcmp (sec->name, ".pack_pure_eir") == 0)
|
||||
{
|
||||
*((bfd_boolean *) no_pure_eir) = FALSE;
|
||||
_bfd_error_handler ("%pB with '.pack_pure_eir' is illegal during "
|
||||
"non-relocatable linkage", abfd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bfd_boolean
|
||||
_bfd_sparc_elf_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
{
|
||||
bfd_boolean ret;
|
||||
|
||||
/* Check for the absence of `.pack_pure_eir' sections during
|
||||
non-relocatable linkage (see Bug #41413). */
|
||||
if (bfd_get_format (abfd) == bfd_object && info
|
||||
&& !bfd_link_relocatable (info))
|
||||
{
|
||||
bfd_boolean no_pure_eir = TRUE;
|
||||
bfd_map_over_sections (abfd, search_pure_eir, &no_pure_eir);
|
||||
|
||||
if (! no_pure_eir)
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
ret = bfd_elf_link_add_symbols (abfd, info);
|
||||
|
||||
/* COMMON sections are created while COMMON symbols are being
|
||||
read rather than while parsing input file's section headers.
|
||||
Therefore, a call to `bfd_elf_link_add_symbols ()' should
|
||||
precede the following, provided that we need to be able to
|
||||
discard COMMON sections. And we actually need this (see
|
||||
Bug #57962). */
|
||||
if ((link_mixed_eir_phase == 1
|
||||
|| link_mixed_eir_phase == 3)
|
||||
&& bfd_get_format (abfd) == bfd_object)
|
||||
{
|
||||
eir_in_this_bfd = FALSE;
|
||||
bfd_map_over_sections (abfd, search_eir, NULL);
|
||||
bfd_map_over_sections (abfd, discard_unsuitable_section, NULL);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bfd_boolean
|
||||
_bfd_sparc_elf_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
{
|
||||
/* There is nothing to be done here if we are going to output
|
||||
a binary file when linking EIR (see Bug #59012, Comment # ). */
|
||||
if (link_mixed_eir_phase == 2)
|
||||
return TRUE;
|
||||
|
||||
return bfd_elf_final_link (abfd, info);
|
||||
}
|
||||
|
||||
bfd_boolean
|
||||
_bfd_sparc_elf_ignore_discarded_relocs (asection *sec)
|
||||
{
|
||||
bfd *abfd;
|
||||
size_t locsymcount;
|
||||
Elf_Internal_Shdr *symtab_hdr;
|
||||
Elf_Internal_Rela *internal_relocs;
|
||||
Elf_Internal_Rela *rel, *relend;
|
||||
struct elf_link_hash_entry **sym_hashes;
|
||||
const struct elf_backend_data *bed;
|
||||
int r_sym_shift;
|
||||
|
||||
if (link_mixed_eir_phase != 1
|
||||
&& link_mixed_eir_phase !=3)
|
||||
return FALSE;
|
||||
|
||||
abfd = sec->owner;
|
||||
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
|
||||
locsymcount = symtab_hdr->sh_info;
|
||||
|
||||
bed = get_elf_backend_data (abfd);
|
||||
|
||||
internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, FALSE);
|
||||
rel = internal_relocs;
|
||||
relend = rel + sec->reloc_count * bed->s->int_rels_per_ext_rel;
|
||||
|
||||
r_sym_shift = (bed->s->arch_size == 32) ? 8 : 32;
|
||||
|
||||
|
||||
sym_hashes = elf_sym_hashes (abfd);
|
||||
for ( ; rel < relend; rel++)
|
||||
{
|
||||
unsigned long r_symndx = rel->r_info >> r_sym_shift;
|
||||
struct elf_link_hash_entry *h = NULL;
|
||||
|
||||
if (r_symndx == STN_UNDEF)
|
||||
continue;
|
||||
|
||||
if (r_symndx >= locsymcount)
|
||||
{
|
||||
h = sym_hashes[r_symndx - locsymcount];
|
||||
|
||||
while (h->root.type == bfd_link_hash_indirect
|
||||
|| h->root.type == bfd_link_hash_warning)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
if (((h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
&& discarded_section (h->root.u.def.section))
|
||||
/* Don't forget about common symbols. Their sections may
|
||||
very well be discarded as well. */
|
||||
|| (h->root.type == bfd_link_hash_common
|
||||
&& discarded_section (h->root.u.c.p->section)))
|
||||
#if 0
|
||||
/* I don't have legal access to this (link) info . . . */
|
||||
&& (h->root.u.def.next || . . .)
|
||||
#endif /* 0 */
|
||||
{
|
||||
/* Stupidly make it undefined. Is it going to work? */
|
||||
h->root.type = bfd_link_hash_undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* free (internal_relocs); */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_bfd_sparc_elf_hide_symbol (struct bfd_link_info *info,
|
||||
struct elf_link_hash_entry *h,
|
||||
bfd_boolean force_local)
|
||||
{
|
||||
/* I don't want to hide (make local) symbols from unsuitable
|
||||
(SEC_EXCLUDE | SEC_DEBUGGING) sections
|
||||
(see discard_unsuitable_section () before) in EIR linkage
|
||||
mode. Prevent the code in `elf_link_add_object_symbols ()'
|
||||
from achieving this. Interestingly enough, there is no attempt
|
||||
to hide these symbols in binutils-2.21. */
|
||||
|
||||
if (link_mixed_eir_phase != 1 && link_mixed_eir_phase != 3)
|
||||
_bfd_elf_link_hash_hide_symbol (info, h, force_local);
|
||||
}
|
||||
|
||||
struct write_eir_info
|
||||
{
|
||||
bfd_size_type max_size;
|
||||
bfd_byte *contents;
|
||||
/* This is set to FALSE if `_bfd_e2k_write_eir_contens ()' fails
|
||||
for any section. */
|
||||
bfd_boolean res;
|
||||
};
|
||||
|
||||
static void
|
||||
write_eir_contents (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
asection *s,
|
||||
void *param)
|
||||
{
|
||||
static bfd_vma s_offset;
|
||||
bfd_vma next_s_offset;
|
||||
bfd_vma mask;
|
||||
struct bfd_link_order *p;
|
||||
struct write_eir_info *wei;
|
||||
|
||||
/* There is nothing to do for non-EIR sections. */
|
||||
if (strcmp (s->name, ".pack_pure_eir") != 0
|
||||
&& strcmp (s->name, ".pack_mixed_eir") != 0)
|
||||
return;
|
||||
|
||||
wei = (struct write_eir_info *) param;
|
||||
/* If we've already failed, there is no point in continuing. */
|
||||
if (wei->res == FALSE)
|
||||
return;
|
||||
|
||||
mask = (1 << s->alignment_power) - 1;
|
||||
s_offset = (s_offset + mask) & ~mask;
|
||||
next_s_offset = s_offset;
|
||||
|
||||
for (p = s->map_head.link_order; p != NULL; p = p->next)
|
||||
{
|
||||
asection *i;
|
||||
|
||||
if (p->type != bfd_indirect_link_order)
|
||||
continue;
|
||||
|
||||
i = p->u.indirect.section;
|
||||
|
||||
if (i->size > 0)
|
||||
{
|
||||
if (i->size > wei->max_size)
|
||||
{
|
||||
wei->max_size = i->size;
|
||||
wei->contents = (bfd_byte *) bfd_realloc (wei->contents,
|
||||
wei->max_size);
|
||||
}
|
||||
|
||||
if (s_offset + i->output_offset + i->size > next_s_offset)
|
||||
next_s_offset = s_offset + i->output_offset + i->size;
|
||||
|
||||
if (! bfd_get_section_contents (i->owner, i, wei->contents,
|
||||
0, i->size)
|
||||
|| bfd_seek (abfd, s_offset + i->output_offset, SEEK_SET) != 0
|
||||
|| bfd_bwrite (wei->contents, i->size, abfd) != i->size)
|
||||
{
|
||||
wei->res = FALSE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Setting initial `s_offset' value for the next invocation. */
|
||||
s_offset = next_s_offset;
|
||||
}
|
||||
|
||||
|
||||
/* This function gets called when BFD is being closed. Avoid calling
|
||||
an ELF-specific method (which outputs strtab, . . .) when a raw
|
||||
binary for EIR is required. */
|
||||
bfd_boolean
|
||||
_bfd_sparc_elf_write_object_contents (bfd *abfd)
|
||||
{
|
||||
struct write_eir_info wei;
|
||||
|
||||
if (link_mixed_eir_phase != 2)
|
||||
return _bfd_elf_write_object_contents (abfd);
|
||||
|
||||
wei.max_size = 0;
|
||||
wei.contents = NULL;
|
||||
wei.res = TRUE;
|
||||
|
||||
/* Calculating positions of EIR sections and setting their contents. */
|
||||
bfd_map_over_sections (abfd, write_eir_contents, &wei);
|
||||
|
||||
if (wei.contents)
|
||||
free (wei.contents);
|
||||
|
||||
return wei.res;
|
||||
}
|
||||
|
||||
|
||||
/* This is a helper of `_bfd_sparc_elf_check_magic () below. */
|
||||
static bfd_boolean
|
||||
check_magic (bfd *abfd, asection *magic_sec)
|
||||
{
|
||||
char *magic = getenv ("MAGIC");
|
||||
size_t magic_size;
|
||||
char *data;
|
||||
bfd_boolean res = FALSE;
|
||||
|
||||
BFD_ASSERT (magic);
|
||||
magic_size = strlen (magic) + 1;
|
||||
|
||||
data = xmalloc (magic_sec->size);
|
||||
if (! bfd_get_section_contents (abfd, magic_sec, data, 0, magic_sec->size))
|
||||
{
|
||||
_bfd_error_handler (_("%pB: cannot read contents of section %pA\n"),
|
||||
abfd, magic_sec);
|
||||
}
|
||||
|
||||
if (magic_sec->size == (12 + ((sizeof ("MCST") + 3) & 0xfffffffc)
|
||||
+ ((magic_size + 3) & 0xfffffffc))
|
||||
&& bfd_get_32 (abfd, data) == sizeof ("MCST")
|
||||
&& bfd_get_32 (abfd, data + 4) == magic_size
|
||||
&& bfd_get_32 (abfd, data + 8) == NT_MAGIC
|
||||
&& data[12 + sizeof ("MCST") - 1] == '\0'
|
||||
&& data[12 + ((sizeof ("MCST") + 3) & 0xfffffffc)
|
||||
+ magic_size - 1] == '\0'
|
||||
&& strncmp (data + 12, "MCST", sizeof ("MCST") - 1) == 0
|
||||
&& strncmp (data + 12 + ((sizeof ("MCST") + 3) & 0xfffffffc), magic,
|
||||
magic_size - 1) == 0)
|
||||
res = TRUE;
|
||||
|
||||
free (data);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* This function is required to implement MCST-specific MAGIC checks
|
||||
(see Bug #67430). It gets called from `elf{32,64}_sparc_merge_private_bfd
|
||||
_data ()' so that they don't have a chance to `return TRUE' without
|
||||
performing this test (see their code just after the call to this function
|
||||
for how it may happen).
|
||||
|
||||
FIXME: this function replicates the analogous part of
|
||||
`_bfd_e2k_elf_merge_private_bfd_data_1 ()' in `elfxx-e2k.c'. Get rid of this
|
||||
awful Copy/Paste by placing them in some common (for E2K and Sparc) source
|
||||
file. Its`check_magic ()' helper and EIR-specific functions should probably
|
||||
go there as well. */
|
||||
|
||||
bfd_boolean
|
||||
_bfd_sparc_elf_check_magic (bfd *ibfd)
|
||||
{
|
||||
if (! getenv ("MAGIC"))
|
||||
return TRUE;
|
||||
|
||||
asection *magic_sec;
|
||||
static bfd_boolean first_ibfd_saved = TRUE;
|
||||
bfd_boolean res, first_ibfd = first_ibfd_saved;
|
||||
|
||||
/* Next time `first_ibfd' will be set to FALSE. */
|
||||
first_ibfd_saved = FALSE;
|
||||
|
||||
magic_sec = bfd_get_section_by_name (ibfd, ".magic");
|
||||
if (magic_sec == NULL)
|
||||
{
|
||||
_bfd_error_handler (_("Input object %pB doesn't have a .magic "
|
||||
"section"), ibfd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
res = check_magic (ibfd, magic_sec);
|
||||
/* Exclude this section from output no matter what `check_magic ()'
|
||||
returned, though it's not absolutely necessary if it failed: we are
|
||||
not going to have any output in this case. */
|
||||
if (! first_ibfd)
|
||||
{
|
||||
magic_sec->flags |= SEC_EXCLUDE;
|
||||
magic_sec->size = 0;
|
||||
}
|
||||
|
||||
if (! res)
|
||||
{
|
||||
_bfd_error_handler (_("Input object %pB contains wrong MAGIC "),
|
||||
ibfd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const struct bfd_elf_special_section _bfd_sparc_elf_special_sections[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".magic"), 0, SHT_NOTE, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
|
|
@ -84,7 +84,16 @@
|
|||
#define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents
|
||||
#endif
|
||||
#define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers
|
||||
|
||||
/* We should be able to override this method if output file format
|
||||
is not ELF as it happens in case of EIR linkage (see Bug #59012,
|
||||
Comment # ). Take into account that calling `bfd_elf_final_link'
|
||||
is inappropriate in this case either, since it also performs some
|
||||
ELF-specific output. */
|
||||
#ifndef bfd_elfNN_write_object_contents
|
||||
#define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
|
||||
#endif
|
||||
|
||||
#define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
|
||||
|
||||
#define bfd_elfNN_get_section_contents_in_window \
|
||||
|
@ -792,6 +801,10 @@
|
|||
#define elf_backend_symbol_section_index NULL
|
||||
#endif
|
||||
|
||||
#ifndef elf_backend_r_none_info
|
||||
#define elf_backend_r_none_info 0
|
||||
#endif
|
||||
|
||||
#ifndef elf_match_priority
|
||||
#define elf_match_priority \
|
||||
(ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0)
|
||||
|
@ -953,7 +966,8 @@ static struct elf_backend_data elfNN_bed =
|
|||
elf_backend_extern_protected_data,
|
||||
elf_backend_always_renumber_dynsyms,
|
||||
elf_backend_linux_prpsinfo32_ugid16,
|
||||
elf_backend_linux_prpsinfo64_ugid16
|
||||
elf_backend_linux_prpsinfo64_ugid16,
|
||||
elf_backend_r_none_info
|
||||
};
|
||||
|
||||
/* Forward declaration for use when initialising alternative_target field. */
|
||||
|
|
35
bfd/libbfd.h
35
bfd/libbfd.h
|
@ -3392,6 +3392,41 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
|
|||
"BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4",
|
||||
"BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4",
|
||||
"BFD_RELOC_S12Z_OPR",
|
||||
"BFD_RELOC_E2K_64_ABS_LIT",
|
||||
"BFD_RELOC_E2K_DISP",
|
||||
"BFD_RELOC_E2K_GOT",
|
||||
"BFD_RELOC_E2K_TLS_GDMOD",
|
||||
"BFD_RELOC_E2K_TLS_GDREL",
|
||||
"BFD_RELOC_E2K_TLS_IE",
|
||||
"BFD_RELOC_E2K_32_TLS_LE",
|
||||
"BFD_RELOC_E2K_64_TLS_LE",
|
||||
"BFD_RELOC_E2K_32_DTPREL",
|
||||
"BFD_RELOC_E2K_64_DTPREL",
|
||||
"BFD_RELOC_E2K_PLT",
|
||||
"BFD_RELOC_E2K_GOTPLT",
|
||||
"BFD_RELOC_E2K_ISLOCAL",
|
||||
"BFD_RELOC_E2K_AP_GOT",
|
||||
"BFD_RELOC_E2K_PL_GOT",
|
||||
"BFD_RELOC_E2K_PREF",
|
||||
"BFD_RELOC_E2K_ISLOCAL32",
|
||||
"BFD_RELOC_E2K_GOTOFF64",
|
||||
"BFD_RELOC_E2K_GOTOFF64_LIT",
|
||||
"BFD_RELOC_E2K_AP",
|
||||
"BFD_RELOC_E2K_PL",
|
||||
"BFD_RELOC_E2K_DYNOPT32",
|
||||
"BFD_RELOC_E2K_DYNOPT64",
|
||||
"BFD_RELOC_ELCORE32",
|
||||
"BFD_RELOC_ELCORE16NPC",
|
||||
"BFD_RELOC_ELCORE16PC",
|
||||
"BFD_RELOC_ELCORE16S",
|
||||
"BFD_RELOC_ELCORE16",
|
||||
"BFD_RELOC_ELCORE5",
|
||||
"BFD_RELOC_ELCORE32_FAKE",
|
||||
"BFD_RELOC_ELCORE16NPC_FAKE",
|
||||
"BFD_RELOC_ELCORE16PC_FAKE",
|
||||
"BFD_RELOC_ELCORE16S_FAKE",
|
||||
"BFD_RELOC_ELCORE16_FAKE",
|
||||
"BFD_RELOC_ELCORE5_FAKE",
|
||||
"@@overflow: BFD_RELOC_UNUSED@@",
|
||||
};
|
||||
#endif
|
||||
|
|
120
bfd/reloc.c
120
bfd/reloc.c
|
@ -8133,6 +8133,126 @@ ENUM
|
|||
ENUMDOC
|
||||
S12Z relocations.
|
||||
|
||||
ENUM
|
||||
BFD_RELOC_E2K_64_ABS_LIT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_64_ABS_LIT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_DISP
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_DISP.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_GOT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_GOT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_TLS_GDMOD
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_TLS_GDMOD.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_TLS_GDREL
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_TLS_GDREL.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_TLS_IE
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_TLS_IE.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_32_TLS_LE
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_32_TLS_LE.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_64_TLS_LE
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_64_TLS_LE.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_32_DTPREL
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_TLS_32_DTPREL.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_64_DTPREL
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_TLS_64_DTPREL.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_PLT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_PLT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_GOTPLT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_GOTPLT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_ISLOCAL
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_ISLOCAL.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_AP_GOT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_AP_GOT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_PL_GOT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_PL_GOT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_PREF
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_PREF.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_ISLOCAL32
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_ISLOCAL32.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_GOTOFF64
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_GOTOFF64.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_GOTOFF64_LIT
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_GOTOFF64_LIT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_AP
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_AP.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_PL
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_PL.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_DYNOPT32
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_32_DYNOPT.
|
||||
ENUM
|
||||
BFD_RELOC_E2K_DYNOPT64
|
||||
ENUMDOC
|
||||
This one corresponds to R_E2K_64_DYNOPT.
|
||||
|
||||
ENUM
|
||||
BFD_RELOC_ELCORE32
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16NPC
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16PC
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16S
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE5
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE32_FAKE
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16NPC_FAKE
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16PC_FAKE
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16S_FAKE
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE16_FAKE
|
||||
ENUMX
|
||||
BFD_RELOC_ELCORE5_FAKE
|
||||
ENUMDOC
|
||||
Elvees Elcore relocations.
|
||||
|
||||
ENDSENUM
|
||||
BFD_RELOC_UNUSED
|
||||
CODE_FRAGMENT
|
||||
|
|
|
@ -710,9 +710,12 @@ extern const bfd_target d10v_elf32_vec;
|
|||
extern const bfd_target d30v_elf32_vec;
|
||||
extern const bfd_target dlx_elf32_be_vec;
|
||||
extern const bfd_target e2k_elf32_vec;
|
||||
extern const bfd_target e2k_elf64_vec;
|
||||
extern const bfd_target e2k_pm_elf32_vec;
|
||||
extern const bfd_target e2k_pm_uclibc_elf32_vec;
|
||||
extern const bfd_target e2k_elf64_vec;
|
||||
extern const bfd_target e2k_kpda_elf64_vec;
|
||||
extern const bfd_target e2k_pm_elf64_vec;
|
||||
extern const bfd_target e2k_uclibc_elf64_vec;
|
||||
extern const bfd_target elcore_elf32_vec;
|
||||
extern const bfd_target elcore_elf64_vec;
|
||||
extern const bfd_target elf32_be_vec;
|
||||
|
|
|
@ -15281,6 +15281,14 @@ cat >>confdefs.h <<_ACEOF
|
|||
_ACEOF
|
||||
|
||||
|
||||
case "$target" in
|
||||
e2k*)
|
||||
|
||||
$as_echo "#define INHIBIT_RAW_INSN 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
targ=$target
|
||||
. $srcdir/../bfd/config.bfd
|
||||
if test "x$targ_underscore" = "xyes"; then
|
||||
|
|
|
@ -97,7 +97,14 @@ static int no_addresses; /* --no-addresses */
|
|||
static int prefix_addresses; /* --prefix-addresses */
|
||||
static int with_line_numbers; /* -l */
|
||||
static bfd_boolean with_source_code; /* -S */
|
||||
|
||||
#ifndef INHIBIT_RAW_INSN
|
||||
static int show_raw_insn; /* --show-raw-insn */
|
||||
#else
|
||||
static int show_raw_insn = -1;
|
||||
static int show_raw_insn_fake;
|
||||
#endif
|
||||
|
||||
static int dump_dwarf_section_info; /* --dwarf */
|
||||
static int dump_stab_section_info; /* --stabs */
|
||||
static int dump_ctf_section_info; /* --ctf */
|
||||
|
@ -370,7 +377,13 @@ static struct option long_options[]=
|
|||
{"help", no_argument, NULL, 'H'},
|
||||
{"info", no_argument, NULL, 'i'},
|
||||
{"line-numbers", no_argument, NULL, 'l'},
|
||||
{"no-show-raw-insn", no_argument, &show_raw_insn, -1},
|
||||
{"no-show-raw-insn", no_argument,
|
||||
#ifndef INHIBIT_RAW_INSN
|
||||
&show_raw_insn,
|
||||
#else
|
||||
&show_raw_insn_fake,
|
||||
#endif
|
||||
-1},
|
||||
{"no-addresses", no_argument, &no_addresses, 1},
|
||||
{"prefix-addresses", no_argument, &prefix_addresses, 1},
|
||||
{"recurse-limit", no_argument, NULL, OPTION_RECURSE_LIMIT},
|
||||
|
@ -380,7 +393,13 @@ static struct option long_options[]=
|
|||
{"reloc", no_argument, NULL, 'r'},
|
||||
{"section", required_argument, NULL, 'j'},
|
||||
{"section-headers", no_argument, NULL, 'h'},
|
||||
{"show-raw-insn", no_argument, &show_raw_insn, 1},
|
||||
{"show-raw-insn", no_argument,
|
||||
#ifndef INHIBIT_RAW_INSN
|
||||
&show_raw_insn,
|
||||
#else
|
||||
&show_raw_insn_fake,
|
||||
#endif
|
||||
1},
|
||||
{"source", no_argument, NULL, 'S'},
|
||||
{"source-comment", optional_argument, NULL, OPTION_SOURCE_COMMENT},
|
||||
{"special-syms", no_argument, &dump_special_syms, 1},
|
||||
|
|
|
@ -104,6 +104,7 @@
|
|||
#include "elf/d30v.h"
|
||||
#include "elf/dlx.h"
|
||||
#include "elf/bpf.h"
|
||||
#include "elf/e2k.h"
|
||||
#include "elf/epiphany.h"
|
||||
#include "elf/fr30.h"
|
||||
#include "elf/frv.h"
|
||||
|
@ -1632,6 +1633,10 @@ dump_relocations (Filedata * filedata,
|
|||
case EM_Z80:
|
||||
rtype = elf_z80_reloc_type (type);
|
||||
break;
|
||||
|
||||
case EM_MCST_ELBRUS:
|
||||
rtype = elf_e2k_reloc_type (type);
|
||||
break;
|
||||
}
|
||||
|
||||
if (rtype == NULL)
|
||||
|
@ -2110,6 +2115,22 @@ get_nios2_dynamic_type (unsigned long type)
|
|||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_e2k_dynamic_type (unsigned long type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DT_E2K_LAZY_GOT: return "E2K_LAZY_GOT";
|
||||
case DT_PLTGOTSZ: return "PLTGOTSZ";
|
||||
case DT_INIT_GOT: return "INIT_GOT";
|
||||
case DT_EXPORT_PL: return "EXPORT_PL";
|
||||
case DT_EXPORT_PLSZ: return "EXPORT_PLSZ";
|
||||
case DT_REAL_PLTGOT: return "REAL_PLTGOT";
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
get_solaris_dynamic_type (unsigned long type)
|
||||
{
|
||||
|
@ -2268,6 +2289,9 @@ get_dynamic_type (Filedata * filedata, unsigned long type)
|
|||
case EM_ALTERA_NIOS2:
|
||||
result = get_nios2_dynamic_type (type);
|
||||
break;
|
||||
case EM_MCST_ELBRUS:
|
||||
result = get_e2k_dynamic_type (type);
|
||||
break;
|
||||
default:
|
||||
if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS)
|
||||
result = get_solaris_dynamic_type (type);
|
||||
|
@ -2387,7 +2411,10 @@ get_machine_name (unsigned e_machine)
|
|||
case EM_H8_300: return "Renesas H8/300";
|
||||
case EM_H8_300H: return "Renesas H8/300H";
|
||||
case EM_H8S: return "Renesas H8S";
|
||||
#if 0
|
||||
case EM_H8_500: return "Renesas H8/500";
|
||||
#endif /* 0 */
|
||||
case EM_E2K_OLD: return "MCST Elbrus (old)";
|
||||
/* 50 */
|
||||
case EM_IA_64: return "Intel IA-64";
|
||||
case EM_MIPS_X: return "Stanford MIPS-X";
|
||||
|
@ -3151,7 +3178,11 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
|
|||
|
||||
buf[0] = '\0';
|
||||
|
||||
if (e_flags)
|
||||
if (e_flags
|
||||
/* We may have `e_flags == 0x0' at E2K which is worth being
|
||||
described. */
|
||||
|| e_machine == EM_MCST_ELBRUS
|
||||
|| e_machine == EM_E2K_OLD)
|
||||
{
|
||||
switch (e_machine)
|
||||
{
|
||||
|
@ -3624,6 +3655,9 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
|
|||
if (e_flags & EF_SPARC_SUN_US3)
|
||||
strcat (buf, ", ultrasparcIII");
|
||||
|
||||
if (e_flags & EF_SPARC_MCST)
|
||||
strcat (buf, ", MCST Sparc");
|
||||
|
||||
if (e_flags & EF_SPARC_HAL_R1)
|
||||
strcat (buf, ", halr1");
|
||||
|
||||
|
@ -3815,6 +3849,122 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
|
|||
strcat (buf, _(", unknown")); break;
|
||||
}
|
||||
break;
|
||||
|
||||
case EM_E2K_OLD:
|
||||
case EM_MCST_ELBRUS:
|
||||
{
|
||||
unsigned mach = (e_machine == EM_MCST_ELBRUS
|
||||
? EF_E2K_FLAG_TO_MACH (e_flags)
|
||||
: EF_E2K_OLD_FLAG_TO_MACH (e_flags));
|
||||
|
||||
switch (mach)
|
||||
{
|
||||
case E_E2K_MACH_BASE:
|
||||
strcat (buf, ", generic");
|
||||
break;
|
||||
case E_E2K_MACH_EV1:
|
||||
strcat (buf, ", elbrus-v1");
|
||||
break;
|
||||
case E_E2K_MACH_EV2:
|
||||
/* Forward incompatible `elbrus-v2' ELF is currently interpreted
|
||||
as `elbrus-2c+'-specific one at least until we have got other
|
||||
processors of `elbrus-v2' family. */
|
||||
strcat (buf,
|
||||
((e_flags & EF_E2K_INCOMPAT)
|
||||
? ", elbrus-2c+" : ", elbrus-v2"));
|
||||
break;
|
||||
case E_E2K_MACH_EV3:
|
||||
/* Forward incompatible `elbrus-v3' ELF is currently interpreted
|
||||
as `elbrus-4c'-specific one at least until we have got other
|
||||
processors of `elbrus-v3' family. */
|
||||
strcat (buf,
|
||||
((e_flags & EF_E2K_INCOMPAT)
|
||||
? ", elbrus-4c" : ", elbrus-v3"));
|
||||
break;
|
||||
case E_E2K_MACH_EV4:
|
||||
strcat (buf, ", elbrus-v4");
|
||||
break;
|
||||
case E_E2K_MACH_EV5:
|
||||
/* Forward incompatible `elbrus-v5' ELF is interpreted as the
|
||||
one fine-tuned for `elbrus-8c2' as there are no other
|
||||
processors in this series. */
|
||||
strcat (buf,
|
||||
((e_flags & EF_E2K_INCOMPAT)
|
||||
? ", elbrus-8c2" : ", elbrus-v5"));
|
||||
break;
|
||||
case E_E2K_MACH_EV6:
|
||||
strcat (buf, ", elbrus-v6");
|
||||
break;
|
||||
case E_E2K_MACH_8C:
|
||||
strcat (buf, ", elbrus-8c");
|
||||
break;
|
||||
case E_E2K_MACH_1CPLUS:
|
||||
strcat (buf, ", elbrus-1c+");
|
||||
break;
|
||||
case E_E2K_MACH_12C:
|
||||
strcat (buf, ", elbrus-12c");
|
||||
break;
|
||||
case E_E2K_MACH_16C:
|
||||
strcat (buf, ", elbrus-16c");
|
||||
break;
|
||||
case E_E2K_MACH_2C3:
|
||||
strcat (buf, ", elbrus-2c3");
|
||||
break;
|
||||
default:
|
||||
strcat (buf, ", unknown elbrus processor");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Only a new-style ELF may be marked as forward incompatible As for
|
||||
`elbrus-v1' it's considered to be forward incompatible even if
|
||||
EF_E2K_INCOMPAT isn't set. A forward incompatible `elbrus-v{2,3,
|
||||
5}' ELF has already been identified as `elbrus-{2c+,4c,8c2}'
|
||||
specific above. This flag makes little sense for fine-tuned
|
||||
`elbrus-{8c,1c+}' and `elbrus-{12c,16c,2c3}' ELFs. Therefore, we
|
||||
are formally left with generic and `elbrus-v{4,6}' cases here.
|
||||
They shouldn't be met in practice, though, since there are no
|
||||
`e2k-linux-{as,ld}' options for producing them. */
|
||||
if (e_machine == EM_MCST_ELBRUS
|
||||
&& (mach == E_E2K_MACH_EV1
|
||||
|| ((e_flags & EF_E2K_INCOMPAT)
|
||||
&& (mach == E_E2K_MACH_BASE
|
||||
|| (mach == E_E2K_MACH_EV4
|
||||
|| mach == E_E2K_MACH_EV6)))))
|
||||
strcat (buf, " (forward incompatible)");
|
||||
|
||||
if (e_machine == EM_MCST_ELBRUS
|
||||
&& (e_flags & EF_E2K_PM))
|
||||
{
|
||||
strcat (buf, " (Protected Mode");
|
||||
|
||||
if (e_flags & EF_E2K_PACK_SEGMENTS)
|
||||
strcat (buf, " with packed CUD and GD");
|
||||
|
||||
strcat (buf, ")");
|
||||
}
|
||||
|
||||
switch (e_flags & EF_E2K_IPD)
|
||||
{
|
||||
case 1:
|
||||
strcat (buf, ", ipd 0");
|
||||
break;
|
||||
case 2:
|
||||
strcat (buf, ", ipd 1");
|
||||
break;
|
||||
case 3:
|
||||
strcat (buf, ", ipd 2");
|
||||
break;
|
||||
default:
|
||||
strcat (buf, ", default ipd");
|
||||
break;
|
||||
}
|
||||
|
||||
if (e_flags & EF_E2K_4MB_PAGES)
|
||||
strcat (buf, ", 4MB pages");
|
||||
if (e_flags & EF_E2K_X86APP)
|
||||
strcat (buf, ", x86 app");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3845,6 +3995,7 @@ get_osabi_name (Filedata * filedata, unsigned int osabi)
|
|||
case ELFOSABI_FENIXOS: return "FenixOS";
|
||||
case ELFOSABI_CLOUDABI: return "Nuxi CloudABI";
|
||||
case ELFOSABI_OPENVOS: return "Stratus Technologies OpenVOS";
|
||||
case ELFOSABI_KPDA: return "KPDA";
|
||||
default:
|
||||
if (osabi >= 64)
|
||||
switch (filedata->file_header.e_machine)
|
||||
|
@ -15686,6 +15837,10 @@ display_sparc_hwcaps (unsigned int mask)
|
|||
printf ("%sima", first ? "" : "|"), first = FALSE;
|
||||
if (mask & ELF_SPARC_HWCAP_ASI_CACHE_SPARING)
|
||||
printf ("%scspare", first ? "" : "|"), first = FALSE;
|
||||
if (mask & ELF_SPARC_HWCAP_R1000)
|
||||
printf ("%sr1000", first ? "" : "|"), first = FALSE;
|
||||
if (mask & ELF_SPARC_HWCAP_SAPPHIRE)
|
||||
printf ("%ssapphire", first ? "" : "|"), first = FALSE;
|
||||
}
|
||||
else
|
||||
fputc ('0', stdout);
|
||||
|
@ -15721,6 +15876,8 @@ display_sparc_hwcaps2 (unsigned int mask)
|
|||
printf ("%sfjdes", first ? "" : "|"), first = FALSE;
|
||||
if (mask & ELF_SPARC_HWCAP2_FJAES)
|
||||
printf ("%sfjaes", first ? "" : "|"), first = FALSE;
|
||||
if (mask & ELF_SPARC_HWCAP2_SAPPHIRE_PLUS)
|
||||
printf ("%ssapphire+", first ? "" : "|"), first = FALSE;
|
||||
}
|
||||
else
|
||||
fputc ('0', stdout);
|
||||
|
@ -18894,6 +19051,33 @@ print_stapsdt_note (Elf_Internal_Note *pnote)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_mcst_note_type (unsigned e_type)
|
||||
{
|
||||
static char buff[64];
|
||||
|
||||
switch (e_type)
|
||||
{
|
||||
case NT_MAGIC:
|
||||
return _("NT_MAGIC (magic conjuration used by certifiers)");
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
|
||||
return buff;
|
||||
}
|
||||
|
||||
static int
|
||||
print_mcst_note (Elf_Internal_Note *pnote)
|
||||
{
|
||||
if (pnote->type == NT_MAGIC)
|
||||
printf (_(" Secret phrase: %s\n"), pnote->descdata);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_ia64_vms_note_type (unsigned e_type)
|
||||
{
|
||||
|
@ -19603,6 +19787,9 @@ process_note (Elf_Internal_Note * pnote,
|
|||
else if (const_strneq (pnote->namedata, "stapsdt"))
|
||||
nt = get_stapsdt_note_type (pnote->type);
|
||||
|
||||
else if (const_strneq (pnote->namedata, "MCST"))
|
||||
nt = get_mcst_note_type (pnote->type);
|
||||
|
||||
else
|
||||
/* Don't recognize this note name; just use the default set of
|
||||
note type strings. */
|
||||
|
@ -19630,6 +19817,8 @@ process_note (Elf_Internal_Note * pnote,
|
|||
return print_gnu_note (filedata, pnote);
|
||||
else if (const_strneq (pnote->namedata, "stapsdt"))
|
||||
return print_stapsdt_note (pnote);
|
||||
else if (const_strneq (pnote->namedata, "MCST"))
|
||||
return print_mcst_note (pnote);
|
||||
else if (const_strneq (pnote->namedata, "CORE"))
|
||||
return print_core_note (pnote);
|
||||
else if (((const_strneq (pnote->namedata, "GA")
|
||||
|
|
|
@ -968,7 +968,7 @@ EOF
|
|||
echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
|
||||
exit ;;
|
||||
e2k:Linux:*:*)
|
||||
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
||||
echo "$UNAME_MACHINE"-mcst-linux-"$LIBC"
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
||||
|
@ -976,9 +976,6 @@ EOF
|
|||
hexagon:Linux:*:*)
|
||||
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
||||
exit ;;
|
||||
e2k:Linux:*.*)
|
||||
echo "${UNAME_MACHINE}-mcst-linux-gnu"
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
|
||||
exit ;;
|
||||
|
|
|
@ -940,6 +940,10 @@ EOF
|
|||
cpu=x86_64
|
||||
vendor=pc
|
||||
;;
|
||||
e2k | e2k64 | e2k32 | e2k128)
|
||||
cpu=$basic_machine
|
||||
vendor=mcst
|
||||
;;
|
||||
# Recognize the basic CPU types without company name.
|
||||
*)
|
||||
cpu=$basic_machine
|
||||
|
@ -1173,7 +1177,7 @@ case $cpu-$vendor in
|
|||
| c[123]* | c30 | [cjt]90 | c4x \
|
||||
| c8051 | clipper | craynv | csky | cydra \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| e2k | elxsi | epiphany \
|
||||
| e2k | e2k64 | e2k32 | e2k128 | elxsi | epiphany \
|
||||
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
|
||||
| h8300 | h8500 \
|
||||
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
|
@ -1507,6 +1511,8 @@ case $os in
|
|||
;;
|
||||
ios)
|
||||
;;
|
||||
kpda)
|
||||
;;
|
||||
none)
|
||||
;;
|
||||
*-eabi)
|
||||
|
|
|
@ -50,6 +50,7 @@ enum
|
|||
R_E2K_GOTPLT = 114,
|
||||
R_E2K_ISLOCAL = 115,
|
||||
R_E2K_ISLOCAL32 = 118,
|
||||
R_E2K_64_GOTOFF_LIT = 256,
|
||||
};
|
||||
|
||||
} // End namespace elfcpp.
|
||||
|
|
|
@ -531,6 +531,8 @@ TARGET_CPU_CFILES = \
|
|||
config/tc-d10v.c \
|
||||
config/tc-d30v.c \
|
||||
config/tc-dlx.c \
|
||||
config/tc-e2k.c \
|
||||
config/tc-stub.c \
|
||||
config/tc-epiphany.c \
|
||||
config/tc-fr30.c \
|
||||
config/tc-frv.c \
|
||||
|
@ -607,6 +609,8 @@ TARGET_CPU_HFILES = \
|
|||
config/tc-d10v.h \
|
||||
config/tc-d30v.h \
|
||||
config/tc-dlx.h \
|
||||
config/tc-e2k.h \
|
||||
config/tc-stub.h \
|
||||
config/tc-epiphany.h \
|
||||
config/tc-fr30.h \
|
||||
config/tc-frv.h \
|
||||
|
@ -914,6 +918,10 @@ config/tc-d30v.$(OBJEXT): config/$(am__dirstamp) \
|
|||
config/$(DEPDIR)/$(am__dirstamp)
|
||||
config/tc-dlx.$(OBJEXT): config/$(am__dirstamp) \
|
||||
config/$(DEPDIR)/$(am__dirstamp)
|
||||
config/tc-e2k.$(OBJEXT): config/$(am__dirstamp) \
|
||||
config/$(DEPDIR)/$(am__dirstamp)
|
||||
config/tc-stub.$(OBJEXT): config/$(am__dirstamp) \
|
||||
config/$(DEPDIR)/$(am__dirstamp)
|
||||
config/tc-epiphany.$(OBJEXT): config/$(am__dirstamp) \
|
||||
config/$(DEPDIR)/$(am__dirstamp)
|
||||
config/tc-fr30.$(OBJEXT): config/$(am__dirstamp) \
|
||||
|
@ -1163,6 +1171,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-d10v.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-d30v.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-dlx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-e2k.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-epiphany.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-fr30.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-frv.Po@am__quote@
|
||||
|
@ -1206,6 +1215,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-sh.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-sparc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-spu.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-stub.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-tic30.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-tic4x.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/tc-tic54x.Po@am__quote@
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -109,4 +109,7 @@ extern int e2k_eh_frame_alignment (void);
|
|||
#define tc_cfi_reloc_for_encoding e2k_cfi_reloc_for_encoding
|
||||
extern bfd_reloc_code_real_type e2k_cfi_reloc_for_encoding (int encoding);
|
||||
|
||||
#define CONVERT_SYMBOLIC_ATTRIBUTE(name) e2k_convert_symbolic_attribute (name)
|
||||
extern int e2k_convert_symbolic_attribute (const char *);
|
||||
|
||||
#endif /* TC_E2K */
|
||||
|
|
|
@ -278,6 +278,9 @@ static struct sparc_arch {
|
|||
/* This exists to allow configure.tgt to pass one
|
||||
value to specify both the default machine and default word size. */
|
||||
{ "v9-64", "v9", v9, 64, 0, 0, 0 },
|
||||
{ "r1000", "r1000", v9, 0, 1, 0, 0 },
|
||||
{ "r2000", "r2000", v9, 0, 1, HWCAP_SAPPHIRE, 0 },
|
||||
{ "r2000+", "r2000+", v9, 0, 1, HWCAP_SAPPHIRE, HWCAP2_SAPPHIRE_PLUS },
|
||||
{ NULL, NULL, v8, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
|
@ -494,6 +497,26 @@ md_parse_option (int c, const char *arg)
|
|||
if (opcode_arch == SPARC_OPCODE_ARCH_BAD)
|
||||
as_fatal (_("Bad opcode table, broken assembler."));
|
||||
|
||||
/* This awful hack is required to let a user override an explicitly
|
||||
specified `-Ar1000' with, say, `-Av9d' when assembling VIS3-dependent
|
||||
glibc files. */
|
||||
if (architecture_requested
|
||||
&& (max_architecture == SPARC_OPCODE_ARCH_R1000
|
||||
|| max_architecture == SPARC_OPCODE_ARCH_R2000
|
||||
|| max_architecture == SPARC_OPCODE_ARCH_R2000_PLUS))
|
||||
{
|
||||
architecture_requested = 0;
|
||||
hwcap_allowed = 0;
|
||||
}
|
||||
|
||||
/* This hack won't let `-Ar1000' override `-Av9d' if they turn out to
|
||||
be swapped by LCC. */
|
||||
if (architecture_requested
|
||||
&& (opcode_arch == SPARC_OPCODE_ARCH_R1000
|
||||
|| opcode_arch == SPARC_OPCODE_ARCH_R2000
|
||||
|| opcode_arch == SPARC_OPCODE_ARCH_R2000_PLUS))
|
||||
break;
|
||||
|
||||
if (!architecture_requested
|
||||
|| opcode_arch > max_architecture)
|
||||
max_architecture = opcode_arch;
|
||||
|
@ -1087,6 +1110,55 @@ md_begin (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* FIXME: this is a Copy/Paste of `e2k_add_magic_info ()'. What can I do to
|
||||
avoid it? */
|
||||
static void
|
||||
sparc_add_magic_info (void)
|
||||
{
|
||||
asection *magic_sec;
|
||||
char *magic, *p;
|
||||
size_t name_size, name_size_aligned;
|
||||
size_t magic_size, magic_size_aligned;
|
||||
static const char name[] = "MCST";
|
||||
|
||||
if (! (magic = getenv ("MAGIC")))
|
||||
return;
|
||||
|
||||
name_size = sizeof (name);
|
||||
name_size_aligned = (name_size + 3) & 0xfffffffc;
|
||||
magic_size = strlen (magic) + 1;
|
||||
magic_size_aligned = (magic_size + 3) & 0xfffffffc;
|
||||
|
||||
magic_sec = subseg_new (".magic", 0);
|
||||
bfd_set_section_flags (magic_sec, SEC_HAS_CONTENTS | SEC_READONLY);
|
||||
|
||||
/* Follow the standard note section layout:
|
||||
First write the length of the name string. */
|
||||
p = frag_more (4);
|
||||
md_number_to_chars (p, (valueT) name_size, 4);
|
||||
|
||||
/* Next comes the length of the "MAGIC" itself, i.e., the actual data. */
|
||||
p = frag_more (4);
|
||||
md_number_to_chars (p, (valueT) magic_size, 4);
|
||||
|
||||
/* Write the note NT_MAGIC type. */
|
||||
p = frag_more (4);
|
||||
md_number_to_chars (p, (valueT) NT_MAGIC, 4);
|
||||
|
||||
/* Write the name field. */
|
||||
p = frag_more (name_size_aligned);
|
||||
/* FIXME: I don't remember for sure if `frag_more ()' zeroes out allocated
|
||||
memory. */
|
||||
memset (p, 0, name_size_aligned);
|
||||
memcpy (p, name, name_size);
|
||||
|
||||
/* Finally, write the descriptor. */
|
||||
p = frag_more (magic_size_aligned);
|
||||
memset (p, 0, magic_size_aligned);
|
||||
memcpy (p, magic, magic_size);
|
||||
}
|
||||
|
||||
|
||||
/* Called after all assembly has been done. */
|
||||
|
||||
void
|
||||
|
@ -1095,6 +1167,24 @@ sparc_md_end (void)
|
|||
unsigned long mach;
|
||||
#ifndef TE_SOLARIS
|
||||
int hwcaps, hwcaps2;
|
||||
|
||||
if (current_architecture == SPARC_OPCODE_ARCH_R1000
|
||||
|| current_architecture == SPARC_OPCODE_ARCH_R2000
|
||||
|| current_architecture == SPARC_OPCODE_ARCH_R2000_PLUS)
|
||||
{
|
||||
/* We may introduce ourselves as ultrasparc3 without any harm. This will
|
||||
let us be executed on a natural ultrasparc3 host. FIXME: now that the
|
||||
definition for HWS_VB has been moved to `opcodes/sparc-opc.c' I have
|
||||
to instantiate it as a unification of HWCAP's. */
|
||||
if ((hwcap_seen & ~(HWCAP_MUL32 | HWCAP_DIV32 | HWCAP_FSMULD
|
||||
| HWCAP_POPC | HWCAP_VIS | HWCAP_VIS2)) == 0)
|
||||
current_architecture = SPARC_OPCODE_ARCH_V9B;
|
||||
|
||||
/* There's no point in writing out this hwcap into an output r1000 file
|
||||
because it's assumed by default. It's required within GAS to prevent
|
||||
us from mistakenly falling back to ultrasparc3 one line above. */
|
||||
hwcap_seen &= ~HWCAP_R1000;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sparc_arch_size == 64)
|
||||
|
@ -1108,6 +1198,9 @@ sparc_md_end (void)
|
|||
case SPARC_OPCODE_ARCH_V9V: mach = bfd_mach_sparc_v9v; break;
|
||||
case SPARC_OPCODE_ARCH_V9M: mach = bfd_mach_sparc_v9m; break;
|
||||
case SPARC_OPCODE_ARCH_M8: mach = bfd_mach_sparc_v9m8; break;
|
||||
case SPARC_OPCODE_ARCH_R1000: mach = bfd_mach_sparc_v9_r1000; break;
|
||||
case SPARC_OPCODE_ARCH_R2000: mach = bfd_mach_sparc_v9_r2000; break;
|
||||
case SPARC_OPCODE_ARCH_R2000_PLUS: mach = bfd_mach_sparc_v9_r2000_plus; break;
|
||||
default: mach = bfd_mach_sparc_v9; break;
|
||||
}
|
||||
else
|
||||
|
@ -1123,6 +1216,9 @@ sparc_md_end (void)
|
|||
case SPARC_OPCODE_ARCH_V9V: mach = bfd_mach_sparc_v8plusv; break;
|
||||
case SPARC_OPCODE_ARCH_V9M: mach = bfd_mach_sparc_v8plusm; break;
|
||||
case SPARC_OPCODE_ARCH_M8: mach = bfd_mach_sparc_v8plusm8; break;
|
||||
case SPARC_OPCODE_ARCH_R1000: mach = bfd_mach_sparc_v8plus_r1000; break;
|
||||
case SPARC_OPCODE_ARCH_R2000: mach = bfd_mach_sparc_v8plus_r2000; break;
|
||||
case SPARC_OPCODE_ARCH_R2000_PLUS: mach = bfd_mach_sparc_v8plus_r2000_plus; break;
|
||||
/* The sparclite is treated like a normal sparc. Perhaps it shouldn't
|
||||
be but for now it is (since that's the way it's always been
|
||||
treated). */
|
||||
|
@ -1139,6 +1235,8 @@ sparc_md_end (void)
|
|||
if (hwcaps2)
|
||||
bfd_elf_add_obj_attr_int (stdoutput, OBJ_ATTR_GNU, Tag_GNU_Sparc_HWCAPS2, hwcaps2);
|
||||
#endif
|
||||
|
||||
sparc_add_magic_info ();
|
||||
}
|
||||
|
||||
/* Return non-zero if VAL is in the range -(MAX+1) to MAX. */
|
||||
|
@ -1676,6 +1774,10 @@ get_hwcap_name (bfd_uint64_t mask)
|
|||
return "cbcond";
|
||||
if (mask & HWCAP_CRC32C)
|
||||
return "crc32c";
|
||||
if (mask & HWCAP_R1000)
|
||||
return "r1000";
|
||||
if (mask & HWCAP_SAPPHIRE)
|
||||
return "sapphire";
|
||||
|
||||
mask = mask >> 32;
|
||||
if (mask & HWCAP2_FJATHPLUS)
|
||||
|
@ -3183,10 +3285,6 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
|
|||
bfd_uint64_t hwcaps
|
||||
= (((bfd_uint64_t) insn->hwcaps2) << 32) | insn->hwcaps;
|
||||
|
||||
#ifndef TE_SOLARIS
|
||||
if (hwcaps)
|
||||
hwcap_seen |= hwcaps;
|
||||
#endif
|
||||
if (v9_arg_p)
|
||||
{
|
||||
needed_arch_mask &=
|
||||
|
@ -3236,6 +3334,24 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
|
|||
char *p;
|
||||
char required_archs[SPARC_OPCODE_ARCH_MAX * 16];
|
||||
|
||||
/* When identifying MCST-specific duplicates ensure that all
|
||||
fields that should coincide (i.e. everything except for
|
||||
`hwcaps{,2}'and `architecture') do really coincide with
|
||||
the original insn. */
|
||||
if (&insn[1] - sparc_opcodes < sparc_num_opcodes
|
||||
&& (insn->match == insn[1].match
|
||||
&& insn->lose == insn[1].lose
|
||||
&& insn->flags == insn[1].flags
|
||||
&& (insn->name == insn[1].name
|
||||
|| !strcmp (insn->name, insn[1].name))
|
||||
&& (insn->args == insn[1].args
|
||||
|| !strcmp (insn->args, insn[1].args))))
|
||||
{
|
||||
++insn;
|
||||
s = argsStart;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Create a list of the architectures that support the insn. */
|
||||
needed_arch_mask &= ~SPARC_OPCODE_SUPPORTED (max_architecture);
|
||||
p = required_archs;
|
||||
|
@ -3260,9 +3376,16 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
|
|||
return special_case;
|
||||
}
|
||||
|
||||
#ifndef TE_SOLARIS
|
||||
if (hwcaps)
|
||||
hwcap_seen |= hwcaps;
|
||||
#endif
|
||||
|
||||
|
||||
/* Make sure the hwcaps used by the instruction are
|
||||
currently enabled. */
|
||||
if (hwcaps & ~hwcap_allowed)
|
||||
if (!warn_on_bump && architecture_requested
|
||||
&& (hwcaps & ~hwcap_allowed))
|
||||
{
|
||||
const char *hwcap_name = get_hwcap_name(hwcaps & ~hwcap_allowed);
|
||||
|
||||
|
@ -4723,6 +4846,12 @@ sparc_elf_final_processing (void)
|
|||
elf_elfheader (stdoutput)->e_flags |= EF_SPARC_SUN_US1;
|
||||
else if (current_architecture == SPARC_OPCODE_ARCH_V9B)
|
||||
elf_elfheader (stdoutput)->e_flags |= EF_SPARC_SUN_US1|EF_SPARC_SUN_US3;
|
||||
else if (current_architecture == SPARC_OPCODE_ARCH_R1000
|
||||
|| current_architecture == SPARC_OPCODE_ARCH_R2000
|
||||
|| current_architecture == SPARC_OPCODE_ARCH_R2000_PLUS)
|
||||
elf_elfheader (stdoutput)->e_flags |= (EF_SPARC_SUN_US1
|
||||
| EF_SPARC_SUN_US3
|
||||
| EF_SPARC_MCST);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#include "te-linux.h"
|
||||
|
||||
# define TE_E2K_UCLIBC
|
|
@ -811,6 +811,7 @@ enable_generate_build_notes
|
|||
enable_mips_fix_loongson3_llsc
|
||||
enable_x86_used_note
|
||||
enable_default_riscv_attribute
|
||||
enable_e2k_opcodes
|
||||
enable_werror
|
||||
enable_build_warnings
|
||||
with_cpu
|
||||
|
@ -1477,6 +1478,7 @@ Optional Features:
|
|||
--enable-x86-used-note generate GNU x86 used ISA and feature properties
|
||||
--enable-default-riscv-attribute
|
||||
generate RISC-V arch attribute by default
|
||||
--enable-e2k-opcodes enable opcodes for E2K
|
||||
--enable-werror treat compile warnings as errors
|
||||
--enable-build-warnings enable build-time compiler warnings
|
||||
--disable-nls do not use Native Language Support
|
||||
|
@ -11343,7 +11345,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11346 "configure"
|
||||
#line 11348 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -11449,7 +11451,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11452 "configure"
|
||||
#line 11454 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -11836,7 +11838,7 @@ else
|
|||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
|
@ -11882,7 +11884,7 @@ else
|
|||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
|
@ -11906,7 +11908,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
|
@ -11951,7 +11953,7 @@ else
|
|||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
|
@ -11975,7 +11977,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
|
@ -12154,6 +12156,18 @@ fi
|
|||
|
||||
using_cgen=no
|
||||
|
||||
# Check whether --enable-e2k-opcodes was given.
|
||||
if test "${enable_e2k_opcodes+set}" = set; then :
|
||||
enableval=$enable_e2k_opcodes; case "${enableval}" in
|
||||
yes | no) enable_e2k_opcodes=$enableval ;;
|
||||
*) as_fn_error $? "enable-e2k-opcodes option must specify either 'yes' or 'no'" "$LINENO" 5
|
||||
;;
|
||||
esac
|
||||
else
|
||||
enable_e2k_opcodes=yes
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Set the 'development' global.
|
||||
. $srcdir/../bfd/development.sh
|
||||
|
|
|
@ -58,6 +58,15 @@ case ${cpu} in
|
|||
cr16*) cpu_type=cr16 endian=little ;;
|
||||
crisv32) cpu_type=cris arch=crisv32 ;;
|
||||
crx*) cpu_type=crx endian=little ;;
|
||||
e2k)
|
||||
if test $enable_e2k_opcodes = yes ; then
|
||||
cpu_type=e2k
|
||||
else
|
||||
cpu_type=stub
|
||||
fi
|
||||
|
||||
endian=little
|
||||
;;
|
||||
epiphany*) cpu_type=epiphany endian=little ;;
|
||||
fido) cpu_type=m68k ;;
|
||||
hppa*) cpu_type=hppa ;;
|
||||
|
@ -183,6 +192,13 @@ case ${generic_target} in
|
|||
dlx-*-*) fmt=elf ;;
|
||||
|
||||
bpf-*-*) fmt=elf ;;
|
||||
|
||||
e2k-*-linux-gnu) fmt=elf em=linux ;;
|
||||
e2k-*-linux-uclibc) fmt=elf em=e2k-uclibc ;;
|
||||
e2k-*-kpda) fmt=elf em=kpda ;;
|
||||
|
||||
stub-*-linux*) fmt=elf em=linux ;;
|
||||
|
||||
epiphany-*-*) fmt=elf ;;
|
||||
|
||||
fr30-*-*) fmt=elf ;;
|
||||
|
|
|
@ -211,7 +211,10 @@ emit_expr_encoded (expressionS *exp, int encoding, bfd_boolean emit_encoding)
|
|||
{
|
||||
reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput, code);
|
||||
char *p = frag_more (size);
|
||||
gas_assert (size == (unsigned) howto->bitsize / 8);
|
||||
gas_assert (size == (unsigned) howto->bitsize / 8
|
||||
/* Take into account that `bitsize == 128' can't be encoded
|
||||
now that HOWTOs have been packed. */
|
||||
|| (size == 16 && howto->bitsize == 0));
|
||||
md_number_to_chars (p, 0, size);
|
||||
fix_new (frag_now, p - frag_now->fr_literal, size, exp->X_add_symbol,
|
||||
exp->X_add_number, howto->pc_relative, code);
|
||||
|
@ -1868,7 +1871,7 @@ static void
|
|||
output_cie (struct cie_entry *cie, bfd_boolean eh_frame, int align)
|
||||
{
|
||||
symbolS *after_size_address, *end_address;
|
||||
symbolS *aug_start_address, *aug_end_address;
|
||||
symbolS *aug_start_address, *aug_end_address = NULL;
|
||||
expressionS exp;
|
||||
struct cfi_insn_data *i;
|
||||
int enc;
|
||||
|
@ -2019,7 +2022,7 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie,
|
|||
int align)
|
||||
{
|
||||
symbolS *after_size_address, *end_address;
|
||||
symbolS *aug_start_address, *aug_end_address;
|
||||
symbolS *aug_start_address, *aug_end_address = NULL;
|
||||
expressionS exp;
|
||||
offsetT augmentation_size;
|
||||
enum dwarf2_format fmt = DWARF2_FORMAT (now_seg);
|
||||
|
@ -2471,10 +2474,31 @@ cfi_finish (void)
|
|||
fde->end_address = fde->start_address;
|
||||
}
|
||||
|
||||
cie = select_cie_for_fde (fde, TRUE, &first, 2);
|
||||
cie = select_cie_for_fde (fde, TRUE, &first,
|
||||
#ifdef TC_E2K
|
||||
/* Treat PM case specially. */
|
||||
(EH_FRAME_ALIGNMENT == 4
|
||||
? EH_FRAME_ALIGNMENT
|
||||
:
|
||||
#endif /* defined TC_E2K */
|
||||
2
|
||||
#ifdef TC_E2K
|
||||
)
|
||||
#endif /* defined TC_E2K */
|
||||
);
|
||||
fde->eh_loc = symbol_temp_new_now ();
|
||||
output_fde (fde, cie, TRUE, first,
|
||||
fde->next == NULL ? EH_FRAME_ALIGNMENT : 2);
|
||||
#ifdef TC_E2K
|
||||
/* Treat PM case specially. */
|
||||
(EH_FRAME_ALIGNMENT == 4
|
||||
? EH_FRAME_ALIGNMENT
|
||||
:
|
||||
#endif /* defined TC_E2K */
|
||||
(fde->next == NULL ? EH_FRAME_ALIGNMENT : 2)
|
||||
#ifdef TC_E2K
|
||||
)
|
||||
#endif /* defined TC_E2K */
|
||||
);
|
||||
}
|
||||
}
|
||||
while (EH_FRAME_LINKONCE && seek_next_seg == 2);
|
||||
|
|
103
gas/expr.c
103
gas/expr.c
|
@ -58,6 +58,8 @@ struct expr_symbol_line {
|
|||
unsigned int line;
|
||||
};
|
||||
|
||||
int hack_for_e2k = 0;
|
||||
|
||||
static struct expr_symbol_line *expr_symbol_lines;
|
||||
|
||||
/* Build a dummy symbol to hold a complex expression. This is how we
|
||||
|
@ -71,7 +73,15 @@ make_expr_symbol (expressionS *expressionP)
|
|||
symbolS *symbolP;
|
||||
struct expr_symbol_line *n;
|
||||
|
||||
if (expressionP->X_op == O_symbol
|
||||
/* FIXME: I don't quite understand what this "optimization" is intended to
|
||||
do. In case `O_add' is constructed for a register and a symbol (e.g.,
|
||||
`%b[3] + dummy') it replaces the latter (i.e. `O_symbol' expression) with
|
||||
the underlying `O_constant' used to represent its `X_add_symbol' member.
|
||||
Taking into account that currently I'm unable to properly recognize symbols
|
||||
when parsing arguments of instructions unless they are `O_symbol's, undo
|
||||
it. */
|
||||
if (hack_for_e2k == 0
|
||||
&& expressionP->X_op == O_symbol
|
||||
&& expressionP->X_add_number == 0)
|
||||
return expressionP->X_add_symbol;
|
||||
|
||||
|
@ -246,6 +256,11 @@ generic_bignum_to_int64 (void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef TC_E2K
|
||||
extern const char *maybe_symbol_ptr;
|
||||
extern const char *symbol_ptr;
|
||||
#endif /* TC_E2K */
|
||||
|
||||
static void
|
||||
integer_constant (int radix, expressionS *expressionP)
|
||||
{
|
||||
|
@ -510,6 +525,28 @@ integer_constant (int radix, expressionS *expressionP)
|
|||
&& input_line_pointer - 1 == suffix)
|
||||
c = *input_line_pointer++;
|
||||
|
||||
|
||||
/* FIXME: for now stupidly support `UL', `llu', `ull' and `u' C constant
|
||||
suffixes encountered while assembling the Kernel and binary compiler for
|
||||
E2K. A more generic approach is required . . . */
|
||||
if (c == 'U' && input_line_pointer[0] == 'L')
|
||||
{
|
||||
c = input_line_pointer[1];
|
||||
input_line_pointer += 2;
|
||||
}
|
||||
else if ((c == 'l' && input_line_pointer[0] == 'l'
|
||||
&& input_line_pointer[1] == 'u')
|
||||
|| (c == 'u' && input_line_pointer[0] == 'l'
|
||||
&& input_line_pointer[1] == 'l'))
|
||||
|
||||
{
|
||||
c = input_line_pointer[2];
|
||||
input_line_pointer += 3;
|
||||
}
|
||||
else if ((c == 'u' && input_line_pointer[0] != 'l')
|
||||
|| c == 'U')
|
||||
c = *input_line_pointer++;
|
||||
|
||||
#ifndef tc_allow_U_suffix
|
||||
#define tc_allow_U_suffix 1
|
||||
#endif
|
||||
|
@ -535,6 +572,13 @@ integer_constant (int radix, expressionS *expressionP)
|
|||
|
||||
if (LOCAL_LABELS_FB && c == 'b')
|
||||
{
|
||||
#ifdef TC_E2K
|
||||
/* Now that we are certain that this is a reference to 'b' local
|
||||
label remember its position for the sake of E2K preprocessing
|
||||
mode. */
|
||||
symbol_ptr = maybe_symbol_ptr;
|
||||
#endif /* TC_E2K */
|
||||
|
||||
/* Backward ref to local label.
|
||||
Because it is backward, expect it to be defined. */
|
||||
/* Construct a local label. */
|
||||
|
@ -565,6 +609,13 @@ integer_constant (int radix, expressionS *expressionP)
|
|||
} /* case 'b' */
|
||||
else if (LOCAL_LABELS_FB && c == 'f')
|
||||
{
|
||||
#ifdef TC_E2K
|
||||
/* Now that we are certain that this is a reference to 'f' local
|
||||
label remember its position for the sake of E2K preprocessing
|
||||
mode. */
|
||||
symbol_ptr = maybe_symbol_ptr;
|
||||
#endif /* TC_E2K */
|
||||
|
||||
/* Forward reference. Expect symbol to be undefined or
|
||||
unknown. undefined: seen it before. unknown: never seen
|
||||
it before.
|
||||
|
@ -775,6 +826,12 @@ operand (expressionS *expressionP, enum expr_mode mode)
|
|||
case '9':
|
||||
input_line_pointer--;
|
||||
|
||||
#ifdef TC_E2K
|
||||
/* This may turn out to be just a constant, not a reference to a local
|
||||
'fb' label. Therefore, postpone setting SYMBOL_PTR until you are
|
||||
absolutely certain. */
|
||||
maybe_symbol_ptr = input_line_pointer;
|
||||
#endif /* TC_E2K */
|
||||
integer_constant ((NUMBERS_WITH_SUFFIX || flag_m68k_mri)
|
||||
? 0 : 10,
|
||||
expressionP);
|
||||
|
@ -826,12 +883,24 @@ operand (expressionS *expressionP, enum expr_mode mode)
|
|||
floating_constant (expressionP);
|
||||
expressionP->X_add_number = - TOLOWER (c);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: all this is for the sake of these awful `u', `ul{,}',
|
||||
`lu', `UL' . . . suffixes which may follow this "only zero".
|
||||
Ensure that they are slurped by `integer_constant ()' and don't
|
||||
confuse subsequent parsing. */
|
||||
if (hack_for_e2k != 0)
|
||||
{
|
||||
input_line_pointer--;
|
||||
integer_constant (10, expressionP);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The string was only zero. */
|
||||
expressionP->X_op = O_constant;
|
||||
expressionP->X_add_number = 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
@ -850,6 +919,14 @@ operand (expressionS *expressionP, enum expr_mode mode)
|
|||
{
|
||||
/* Parse this as a back reference to label 0. */
|
||||
input_line_pointer--;
|
||||
#ifdef TC_E2K
|
||||
/* As far as I understand, this is a special case of `0b'
|
||||
symbolic reference. The peculiarity is that such labels are
|
||||
believed to be decimal, while decimal constants don't normally
|
||||
start with '0'. */
|
||||
maybe_symbol_ptr = input_line_pointer;
|
||||
#endif /* TC_E2K */
|
||||
|
||||
integer_constant (10, expressionP);
|
||||
break;
|
||||
}
|
||||
|
@ -907,6 +984,13 @@ operand (expressionS *expressionP, enum expr_mode mode)
|
|||
if (is_label)
|
||||
{
|
||||
input_line_pointer--;
|
||||
#ifdef TC_E2K
|
||||
/* As far as I understand, this is a special case of `0f'
|
||||
symbolic reference. The peculiarity is that such labels
|
||||
are believed to be decimal, while decimal constants don't
|
||||
normally start with '0'. */
|
||||
maybe_symbol_ptr = input_line_pointer;
|
||||
#endif /* TC_E2K */
|
||||
integer_constant (10, expressionP);
|
||||
break;
|
||||
}
|
||||
|
@ -1309,6 +1393,13 @@ operand (expressionS *expressionP, enum expr_mode mode)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef TC_E2K
|
||||
/* As far as I understand, here is the place to remember the start of
|
||||
a symbol reference without an explicitly specified relocation for
|
||||
the sake of E2K preprocessing mode. */
|
||||
symbol_ptr = name;
|
||||
#endif /* TC_E2K */
|
||||
|
||||
symbolP = symbol_find_or_make (name);
|
||||
|
||||
/* If we have an absolute symbol or a reg, then we know its
|
||||
|
@ -1982,7 +2073,15 @@ expr (int rankarg, /* Larger # is higher rank. */
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (resultP->X_op == O_symbol
|
||||
|
||||
/* FIXME: this hack lets me prevent `O_add' of two `O_symbol's from being
|
||||
converted to `O_add' of two underlying `O_constant's when parsing
|
||||
arguments of LD/ST instructions. In the latter case I'd be unable to
|
||||
properly recognize the (forbidden) sum of two symbols. I suspect that
|
||||
it may very well break something when parsing `O_subtract' outside of
|
||||
instructions . . . */
|
||||
else if (hack_for_e2k == 0
|
||||
&& resultP->X_op == O_symbol
|
||||
&& right.X_op == O_symbol
|
||||
&& (op_left == O_add
|
||||
|| op_left == O_subtract
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
# Instructions stolen by r2000+ from foreign Sparc CPUs.
|
||||
|
||||
fchksm16 %f54, %f56, %f58
|
||||
|
||||
flcmps %fcc0, %f1, %f3
|
||||
flcmps %fcc1, %f3, %f5
|
||||
flcmps %fcc2, %f5, %f7
|
||||
flcmps %fcc3, %f7, %f9
|
||||
|
||||
flcmpd %fcc0, %f12, %f14
|
||||
flcmpd %fcc1, %f14, %f16
|
||||
flcmpd %fcc2, %f16, %f18
|
||||
flcmpd %fcc3, %f18, %f20
|
||||
|
||||
fmean16 %f50, %f52, %f54
|
||||
|
||||
pdistn %f48, %f50, %g1
|
||||
|
||||
xmulx %o1, %o2, %o3
|
||||
|
||||
xmulxhi %o4, %o5, %o6
|
||||
|
||||
fpadd64 %f52, %f54, %f56
|
||||
|
||||
fpsub64 %f56, %f58, %f60
|
||||
|
||||
fpadd8 %f2, %f4, %f8
|
||||
|
||||
fpadds8 %f8, %f10, %f12
|
||||
|
||||
fpaddus8 %f12, %f14, %f16
|
||||
|
||||
fpaddus16 %f16, %f18, %f20
|
||||
|
||||
fpsub8 %f2, %f4, %f6
|
||||
|
||||
fpsubs8 %f6, %f8, %f10
|
||||
|
||||
fpsubus8 %f10, %f12, %f14
|
||||
|
||||
fpsubus16 %f14, %f16, %f18
|
||||
|
||||
fpcmple8 %f2, %f4, %g1
|
||||
|
||||
fpcmpgt8 %f4, %f6, %g2
|
||||
|
||||
fpcmpule16 %f6, %f8, %g3
|
||||
|
||||
fpcmpugt16 %f8, %f10, %g4
|
||||
|
||||
fpcmpule32 %f10, %f12, %g5
|
||||
|
||||
fpcmpugt32 %f12, %f14, %g6
|
||||
|
||||
fpmax8 %f14, %f16, %f18
|
||||
|
||||
fpmax16 %f18, %f20, %f22
|
||||
|
||||
fpmax32 %f22, %f24, %f26
|
||||
|
||||
fpmaxu8 %f26, %f28, %f30
|
||||
|
||||
fpmaxu16 %f30, %f32, %f34
|
||||
|
||||
fpmaxu32 %f34, %f36, %f38
|
||||
|
||||
fpmin8 %f38, %f40, %f42
|
||||
|
||||
fpmin16 %f42, %f44, %f46
|
||||
|
||||
fpmin32 %f46, %f48, %f50
|
||||
|
||||
fpminu8 %f50, %f52, %f54
|
||||
|
||||
fpminu16 %f54, %f56, %f58
|
||||
|
||||
fpminu32 %f58, %f60, %f62
|
||||
|
||||
|
||||
# Original r2000+ instructions
|
||||
|
||||
fpcsl32 %f0, %f2, %f4
|
||||
fpcsl64 %f6, %f8, %f10
|
||||
fpcsr32 %f12, %f14, %f16
|
||||
fpcsr64 %f18, %f20, %f22
|
|
@ -792,13 +792,14 @@ DEFFILES = arm-reloc.def aarch64-reloc.def
|
|||
EXTRA_DIST = yyscript.c yyscript.h
|
||||
TARGETSOURCES = \
|
||||
i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc arm-reloc-property.cc tilegx.cc \
|
||||
mips.cc aarch64.cc aarch64-reloc-property.cc s390.cc
|
||||
mips.cc aarch64.cc aarch64-reloc-property.cc s390.cc e2k.cc
|
||||
|
||||
ALL_TARGETOBJS = \
|
||||
i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \
|
||||
arm.$(OBJEXT) arm-reloc-property.$(OBJEXT) tilegx.$(OBJEXT) \
|
||||
mips.$(OBJEXT) aarch64.$(OBJEXT) aarch64-reloc-property.$(OBJEXT) \
|
||||
s390.$(OBJEXT)
|
||||
s390.$(OBJEXT) \
|
||||
e2k.$(OBJEXT)
|
||||
|
||||
libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) $(DEFFILES)
|
||||
libgold_a_LIBADD = $(LIBOBJS)
|
||||
|
|
16
gold/e2k.cc
16
gold/e2k.cc
|
@ -25,6 +25,12 @@ public:
|
|||
protected:
|
||||
void do_write(Output_file*)
|
||||
{ }
|
||||
|
||||
// Write to a map file.
|
||||
void
|
||||
do_print_to_mapfile(Mapfile* mapfile) const
|
||||
{ mapfile->print_output_data(this, _("** GOT PLT")); }
|
||||
|
||||
};
|
||||
|
||||
// A class to handle the PLT data.
|
||||
|
@ -43,6 +49,11 @@ public:
|
|||
protected:
|
||||
void do_write(Output_file*)
|
||||
{ }
|
||||
|
||||
// Write to a map file.
|
||||
void
|
||||
do_print_to_mapfile(Mapfile* mapfile) const
|
||||
{ mapfile->print_output_data(this, _("** PLT")); }
|
||||
};
|
||||
|
||||
template<int size>
|
||||
|
@ -324,6 +335,7 @@ const Target::Target_info Target_e2k<32>::e2k_info =
|
|||
NULL, // attributes_vendor
|
||||
"_start", // entry_symbol_name
|
||||
32, // hash_entry_size
|
||||
elfcpp::SHT_PROGBITS, // unwind_section_type
|
||||
};
|
||||
|
||||
template<>
|
||||
|
@ -352,6 +364,7 @@ const Target::Target_info Target_e2k<64>::e2k_info =
|
|||
NULL, // attributes_vendor
|
||||
"_start", // entry_symbol_name
|
||||
64, // hash_entry_size
|
||||
elfcpp::SHT_PROGBITS, // unwind_section_type
|
||||
};
|
||||
|
||||
// Class for performing E2K-specific sophisticated relocations for which
|
||||
|
@ -576,6 +589,7 @@ Target_e2k<size>::Scan::local(
|
|||
case elfcpp::R_E2K_64_TLS_LE:
|
||||
case elfcpp::R_E2K_GOT:
|
||||
case elfcpp::R_E2K_GOTOFF:
|
||||
case elfcpp::R_E2K_64_GOTOFF_LIT:
|
||||
case elfcpp::R_E2K_DISP:
|
||||
case elfcpp::R_E2K_GOTPLT:
|
||||
case elfcpp::R_E2K_ISLOCAL:
|
||||
|
@ -647,6 +661,7 @@ Target_e2k<size>::Scan::global(
|
|||
break;
|
||||
|
||||
case elfcpp::R_E2K_GOTOFF:
|
||||
case elfcpp::R_E2K_64_GOTOFF_LIT:
|
||||
break;
|
||||
|
||||
case elfcpp::R_E2K_DISP:
|
||||
|
@ -781,6 +796,7 @@ Target_e2k<size>::Relocate::relocate(
|
|||
break;
|
||||
|
||||
case elfcpp::R_E2K_GOTOFF:
|
||||
case elfcpp::R_E2K_64_GOTOFF_LIT:
|
||||
{
|
||||
unsigned int got_offset;
|
||||
got_offset = psymval->value(object, 0) - target->got_address ();
|
||||
|
|
|
@ -41,6 +41,7 @@ START_RELOC_NUMBERS (elf_e2k_reloc_type)
|
|||
RELOC_NUMBER (R_E2K_32_RELATIVE, 10)
|
||||
RELOC_NUMBER (R_E2K_32_IRELATIVE, 11)
|
||||
RELOC_NUMBER (R_E2K_32_SIZE, 12)
|
||||
RELOC_NUMBER (R_E2K_32_DYNOPT, 13)
|
||||
|
||||
/* 64-bit ones. */
|
||||
RELOC_NUMBER (R_E2K_64_ABS, 50)
|
||||
|
@ -61,6 +62,7 @@ START_RELOC_NUMBERS (elf_e2k_reloc_type)
|
|||
this will make it impossible to use these relocations in 32-bit mode, but
|
||||
they shouldn't be intended for that in fact . . . */
|
||||
RELOC_NUMBER (R_E2K_64_GOTOFF_LIT, 256)
|
||||
RELOC_NUMBER (R_E2K_64_DYNOPT, 257)
|
||||
|
||||
/* All TLS-specific 32, 64-bit and common relocations are grouped here,
|
||||
which is rather inconsistent. */
|
||||
|
@ -100,6 +102,7 @@ END_RELOC_NUMBERS (R_E2K_max)
|
|||
#define EF_E2K_4MB_PAGES 8
|
||||
#define EF_E2K_INCOMPAT 16
|
||||
#define EF_E2K_PM 32
|
||||
#define EF_E2K_PACK_SEGMENTS 64
|
||||
|
||||
/* Three bit E2K machine type field. */
|
||||
|
||||
|
@ -127,6 +130,9 @@ END_RELOC_NUMBERS (R_E2K_max)
|
|||
after they are eliminated from the Kernel. */
|
||||
#define E_E2K_MACH_8C 19
|
||||
#define E_E2K_MACH_1CPLUS 20
|
||||
#define E_E2K_MACH_12C 21
|
||||
#define E_E2K_MACH_16C 22
|
||||
#define E_E2K_MACH_2C3 23
|
||||
|
||||
|
||||
|
||||
|
@ -161,4 +167,19 @@ enum
|
|||
DT_REAL_PLTGOT,
|
||||
};
|
||||
|
||||
/* Object attribute tags. */
|
||||
enum
|
||||
{
|
||||
/* For `vendor == OBJ_ATTR_GNU' 0-3 tags are generic. According to `gnu_obj_
|
||||
attrs_arg_type ()' even-numbered GNU tags take integers and odd-numbered
|
||||
ones take strings. According to a comment in this function and as.info
|
||||
`(Tag & 0x2) should be also equal to 0' for architecture dependent ones,
|
||||
which is why 5 may be used for the next E2K-specific string GNU attribute
|
||||
and 8 for the integer one. FIXME: alternatively `vendor == OBJ_ATTR_PROC'
|
||||
attributes implying no limitations on the values of Tags could be used for
|
||||
the same purpose, but they would require the implementation of an
|
||||
additional E2K-specific method to retrieve the type of the attribute. */
|
||||
Tag_GNU_E2K_UCLIBC = 4
|
||||
};
|
||||
|
||||
#endif /* _ELF_E2K_H */
|
||||
|
|
|
@ -264,5 +264,7 @@ enum
|
|||
#define ELF_SPARC_HWCAP2_FPCMPSHL 0x00400000 /* Partition compare with shifted result */
|
||||
#define ELF_SPARC_HWCAP2_RLE 0x00800000 /* Run-length encoded burst and length */
|
||||
#define ELF_SPARC_HWCAP2_SHA3 0x01000000 /* SHA3 instruction */
|
||||
#define ELF_SPARC_HWCAP2_SAPPHIRE_PLUS \
|
||||
0x02000000 /* MCST Sapphire+ inherent to R2000+ processor */
|
||||
|
||||
#endif /* _ELF_SPARC_H */
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define AAURR 23
|
||||
#define AAURW 24
|
||||
#define ALOPF17 25
|
||||
#define ALOPF19 26
|
||||
|
||||
#define ALF_PART \
|
||||
u_int8_t alopf; \
|
||||
|
@ -69,6 +70,11 @@
|
|||
/* ALES.opce values. */
|
||||
#define NONE 0xc0
|
||||
|
||||
/* See Table B.2.6 in `iset-v6.single'. */
|
||||
#define QPCHECKS 0xc0
|
||||
#define QPCHECKD 0xc1
|
||||
#define QPCHECKQ 0xc2
|
||||
|
||||
|
||||
/* It seems that LAS doesn't support %xr's, that's
|
||||
why everywhere where an x-args is supposed we
|
||||
|
@ -372,7 +378,7 @@ int parse_setcmd_args (char **, const e2k_opcode_templ *);
|
|||
int parse_setsft_args (char **, const e2k_opcode_templ *);
|
||||
int parse_wait_args (char **, const e2k_opcode_templ *);
|
||||
int parse_ct_args (char **, const e2k_opcode_templ *);
|
||||
int parse_hcall_args (char **, const e2k_opcode_templ *);
|
||||
int parse_hicall_args (char **, const e2k_opcode_templ *);
|
||||
int parse_ipd_args (char **, const e2k_opcode_templ *);
|
||||
|
||||
int parse_loop_mode_args (char **, const e2k_opcode_templ *);
|
||||
|
@ -380,6 +386,9 @@ int parse_alc_args (char **, const e2k_opcode_templ *);
|
|||
int parse_abn_args (char **, const e2k_opcode_templ *);
|
||||
int parse_abp_args (char **, const e2k_opcode_templ *);
|
||||
int parse_abg_args (char **, const e2k_opcode_templ *);
|
||||
int parse_srp_args (char **, const e2k_opcode_templ *);
|
||||
int parse_crp_args (char **, const e2k_opcode_templ *);
|
||||
int parse_slrp_args (char **, const e2k_opcode_templ *);
|
||||
int parse_bap_args (char **, const e2k_opcode_templ *);
|
||||
int parse_eap_args (char **, const e2k_opcode_templ *);
|
||||
|
||||
|
@ -388,7 +397,7 @@ int parse_pass_args (char **, const e2k_opcode_templ *);
|
|||
int parse_andp_args (char **, const e2k_opcode_templ *);
|
||||
int parse_landp_args (char **, const e2k_opcode_templ *);
|
||||
int parse_ibranch_args (char **, const e2k_opcode_templ *);
|
||||
int parse_done_hret_glaunch_args (char **, const e2k_opcode_templ *);
|
||||
int parse_done_hiret_glaunch_args (char **, const e2k_opcode_templ *);
|
||||
|
||||
int parse_incr_args (char **, const e2k_opcode_templ *);
|
||||
int parse_mova_args (char **, const e2k_opcode_templ *);
|
||||
|
|
|
@ -13,7 +13,7 @@ ENTRY (1, "%root_ptb", 0x40, 0x8, 2, 1)
|
|||
ENTRY (6, "%u_pptb", 0x40, 0x8, 2, 1)
|
||||
|
||||
ENTRY (1, "%trap_point", 0x50, 0x8, 2, 1)
|
||||
ENTRY (1, "%trap_count", 0x60, 0x8, 2, 0)
|
||||
ENTRY (1, "%trap_count", 0x60, 0x8, 2, 6)
|
||||
ENTRY (1, "%mpt_b", 0x70, 0x8, 2, 1)
|
||||
ENTRY (1, "%pci_l_b", 0x80, 0x8, 2, 1)
|
||||
ENTRY (1, "%us_cl_d", 0x90, 0x8, 2, 1)
|
||||
|
@ -104,12 +104,12 @@ ENTRY (6, "%sh_mmu_cr", 0x4a0, 0x8, 2, 1)
|
|||
ENTRY (6, "%os_vab", 0x4c0, 0x8, 2, 1)
|
||||
ENTRY (6, "%sh_os_vab", 0x4d0, 0x8, 2, 1)
|
||||
|
||||
ENTRY (1, "%us_cl_b", 0x24, 0xd, 5, 0)
|
||||
ENTRY (1, "%us_cl_up", 0x124, 0xd, 5, 0)
|
||||
ENTRY (1, "%us_cl_m0", 0x4, 0xd, 5, 0)
|
||||
ENTRY (1, "%us_cl_m1", 0x84, 0xd, 5, 0)
|
||||
ENTRY (1, "%us_cl_m2", 0x104, 0xd, 5, 0)
|
||||
ENTRY (1, "%us_cl_m3", 0x184, 0xd, 5, 0)
|
||||
ENTRY (1, "%us_cl_b", 0x24, 0xd, 5, 6)
|
||||
ENTRY (1, "%us_cl_up", 0x124, 0xd, 5, 6)
|
||||
ENTRY (1, "%us_cl_m0", 0x4, 0xd, 5, 6)
|
||||
ENTRY (1, "%us_cl_m1", 0x84, 0xd, 5, 6)
|
||||
ENTRY (1, "%us_cl_m2", 0x104, 0xd, 5, 6)
|
||||
ENTRY (1, "%us_cl_m3", 0x184, 0xd, 5, 6)
|
||||
|
||||
ENTRY (1, "%mlta0", 0x5, 0xd, 2, 0)
|
||||
DIS_ENTRY (1, "%mlta0", 0x6, 0xd, 2, 0)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
ENTRY(1, "%psr", 0x00, 1, 0)
|
||||
ENTRY(1, "%wd", 0x01, 0, 0)
|
||||
ENTRY(1, "%core_mode", 0x04, 0, 0)
|
||||
ENTRY(3, "%core_mode", 0x04, 0, 0)
|
||||
ENTRY(1, "%cwd", 0x06, 1, 0)
|
||||
ENTRY(1, "%psp.hi", 0x07, 1, 0)
|
||||
ENTRY(1, "%psp.lo", 0x09, 1, 0)
|
||||
|
@ -72,6 +72,10 @@
|
|||
ENTRY(1, "%dimcr", 0x41, 0, 0)
|
||||
ENTRY(1, "%dibsr", 0x42, 0, 0)
|
||||
ENTRY(1, "%dtcr", 0x43, 0, 0)
|
||||
|
||||
ENTRY(6, "%dimtp.hi", 0x46, 0, 0)
|
||||
ENTRY(6, "%dimtp.lo", 0x47, 0, 0)
|
||||
|
||||
ENTRY(1, "%dibar0", 0x48, 0, 0)
|
||||
ENTRY(1, "%dibar1", 0x49, 0, 0)
|
||||
ENTRY(1, "%dibar2", 0x4a, 0, 0)
|
||||
|
@ -117,6 +121,8 @@
|
|||
ENTRY(6, "%bu_pcsp.hi", 0x74, 0, 0)
|
||||
ENTRY(6, "%bu_pcsp.lo", 0x75, 0, 0)
|
||||
|
||||
ENTRY(6, "%sh_wd", 0x76, 0, 0)
|
||||
|
||||
ENTRY(2, "%cu_hw0", 0x78, 0, 0)
|
||||
ENTRY(5, "%cu_hw1", 0x79, 0, 0)
|
||||
|
||||
|
@ -130,7 +136,7 @@
|
|||
ENTRY(1, "%ilcr", 0x87, 0, 0)
|
||||
ENTRY(1, "%br", 0x88, 0, 0)
|
||||
ENTRY(1, "%bgr", 0x89, 0, 0)
|
||||
ENTRY(1, "%idr", 0x8a, 0, 0)
|
||||
ENTRY(2, "%idr", 0x8a, 0, 0)
|
||||
ENTRY(1, "%clkr", 0x90, 0, 0)
|
||||
ENTRY(3, "%rndpr", 0x91, 0, 0)
|
||||
ENTRY(3, "%sclkr", 0x92, 0, 0)
|
||||
|
|
|
@ -59,8 +59,10 @@ enum sparc_opcode_arch_val
|
|||
multiply and Fujitsu fp multiply-add. */
|
||||
SPARC_OPCODE_ARCH_V9M, /* V9 with OSA2015 and M7 additions. */
|
||||
SPARC_OPCODE_ARCH_M8, /* V9 with OSA2017 and M8 additions. */
|
||||
SPARC_OPCODE_ARCH_V9_MCST, /* V9B with MCST additions. */
|
||||
SPARC_OPCODE_ARCH_MAX = SPARC_OPCODE_ARCH_V9_MCST,
|
||||
SPARC_OPCODE_ARCH_R1000, /* V9B with R1000 additions. */
|
||||
SPARC_OPCODE_ARCH_R2000, /* V9B with R{1,2}000 additions. */
|
||||
SPARC_OPCODE_ARCH_R2000_PLUS, /* V9B with R{1,2}000 and R2000+ additions. */
|
||||
SPARC_OPCODE_ARCH_MAX = SPARC_OPCODE_ARCH_R2000_PLUS,
|
||||
SPARC_OPCODE_ARCH_BAD /* Error return from sparc_opcode_lookup_arch. */
|
||||
};
|
||||
|
||||
|
@ -81,7 +83,7 @@ typedef struct sparc_opcode_arch
|
|||
EG: For v7 this would be
|
||||
(SPARC_OPCODE_ARCH_MASK (..._V6) | SPARC_OPCODE_ARCH_MASK (..._V7)).
|
||||
These are short's because sparc_opcode.architecture is. */
|
||||
short supported;
|
||||
int supported;
|
||||
/* Bitmaps describing the set of hardware capabilities implemented
|
||||
by the opcode arch. */
|
||||
int hwcaps;
|
||||
|
@ -116,7 +118,11 @@ typedef struct sparc_opcode
|
|||
unsigned int flags;
|
||||
unsigned int hwcaps;
|
||||
unsigned int hwcaps2;
|
||||
short architecture; /* Bitmask of sparc_opcode_arch_val's. */
|
||||
int architecture; /* Bitmask of sparc_opcode_arch_val's. FIXME: while
|
||||
the original short is still wide enough for
|
||||
`SPARC_OPCODE_ARCH_V9_MCST == 15'th bit to fit into
|
||||
it, its signed nature breaks `(1 << arch) <=
|
||||
needed_arch_mask' comparison in `sparc_ip ()'. */
|
||||
} sparc_opcode;
|
||||
|
||||
/* Struct for ASIs - to handle ASIs introduced in a specific architecture */
|
||||
|
@ -124,7 +130,7 @@ typedef struct
|
|||
{
|
||||
int value;
|
||||
const char *name;
|
||||
short architecture;
|
||||
int architecture;
|
||||
} sparc_asi;
|
||||
|
||||
/* FIXME: Add F_ANACHRONISTIC flag for v9. */
|
||||
|
@ -201,6 +207,11 @@ typedef struct
|
|||
#define HWCAP2_SHA3 0x01000000 /* SHA3 instruction */
|
||||
|
||||
|
||||
/* Intended for R2000+ (Bug #117014). */
|
||||
#define HWCAP2_SAPPHIRE_PLUS \
|
||||
0x02000000
|
||||
|
||||
|
||||
/* All sparc opcodes are 32 bits, except for the `set' instruction (really a
|
||||
macro), which is 64 bits. It is handled as a special case.
|
||||
|
||||
|
|
|
@ -213,6 +213,9 @@ ALL_EMULATION_SOURCES = \
|
|||
ed30v_o.c \
|
||||
ed30velf.c \
|
||||
eelf32_dlx.c \
|
||||
eelf32_e2k.c \
|
||||
eelf32_e2k_pm.c \
|
||||
eelf32_e2k_pm_uclibc.c \
|
||||
eelf32_sparc.c \
|
||||
eelf32_sparc_sol2.c \
|
||||
eelf32_sparc_vxworks.c \
|
||||
|
@ -418,6 +421,10 @@ ALL_64_EMULATION_SOURCES = \
|
|||
eelf32mipswindiss.c \
|
||||
eelf64_aix.c \
|
||||
eelf64bpf.c \
|
||||
eelf64_e2k.c \
|
||||
eelf64_e2k_pm.c \
|
||||
eelf64_e2k_kpda.c \
|
||||
eelf64_e2k_uclibc.c \
|
||||
eelf64_ia64.c \
|
||||
eelf64_ia64_fbsd.c \
|
||||
eelf64_ia64_vms.c \
|
||||
|
@ -613,7 +620,7 @@ if AMDEP
|
|||
else
|
||||
GENDEPDIR=
|
||||
endif
|
||||
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
|
||||
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@ @enable_debian_multiarch@
|
||||
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
|
||||
|
||||
@TDIRS@
|
||||
|
@ -937,6 +944,13 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ehppa64linux.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386pep.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emmo.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k_pm.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k_pm_uclibc.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_pm.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_kpda.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_uclibc.Pc@am__quote@
|
||||
|
||||
# We need this for automake to use YLWRAP.
|
||||
EXTRA_ld_new_SOURCES = deffilep.y ldlex.l
|
||||
|
@ -985,13 +999,13 @@ development.exp: $(BFDDIR)/development.sh
|
|||
noinst_LTLIBRARIES = libldtestplug.la libldtestplug2.la \
|
||||
libldtestplug3.la libldtestplug4.la
|
||||
libldtestplug_la_SOURCES = testplug.c
|
||||
libldtestplug_la_CFLAGS= -g -O2
|
||||
libldtestplug_la_CFLAGS= -g -O0
|
||||
libldtestplug_la_LDFLAGS = -no-undefined -rpath /nowhere
|
||||
libldtestplug2_la_SOURCES = testplug2.c
|
||||
libldtestplug2_la_CFLAGS= -g -O2
|
||||
libldtestplug2_la_CFLAGS= -g -O0
|
||||
libldtestplug2_la_LDFLAGS = -no-undefined -rpath /nowhere
|
||||
libldtestplug3_la_SOURCES = testplug3.c
|
||||
libldtestplug3_la_CFLAGS= -g -O2
|
||||
libldtestplug3_la_CFLAGS= -g -O0
|
||||
libldtestplug3_la_LDFLAGS = -no-undefined -rpath /nowhere
|
||||
libldtestplug4_la_SOURCES = testplug4.c
|
||||
libldtestplug4_la_CFLAGS= -g -O2
|
||||
|
|
|
@ -491,6 +491,7 @@ dvidir = @dvidir@
|
|||
elf_list_options = @elf_list_options@
|
||||
elf_plt_unwind_list_options = @elf_plt_unwind_list_options@
|
||||
elf_shlib_list_options = @elf_shlib_list_options@
|
||||
enable_debian_multiarch = @enable_debian_multiarch@
|
||||
enable_initfini_array = @enable_initfini_array@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
|
@ -696,6 +697,9 @@ ALL_EMULATION_SOURCES = \
|
|||
ed30v_o.c \
|
||||
ed30velf.c \
|
||||
eelf32_dlx.c \
|
||||
eelf32_e2k.c \
|
||||
eelf32_e2k_pm.c \
|
||||
eelf32_e2k_pm_uclibc.c \
|
||||
eelf32_sparc.c \
|
||||
eelf32_sparc_sol2.c \
|
||||
eelf32_sparc_vxworks.c \
|
||||
|
@ -900,6 +904,10 @@ ALL_64_EMULATION_SOURCES = \
|
|||
eelf32mipswindiss.c \
|
||||
eelf64_aix.c \
|
||||
eelf64bpf.c \
|
||||
eelf64_e2k.c \
|
||||
eelf64_e2k_pm.c \
|
||||
eelf64_e2k_kpda.c \
|
||||
eelf64_e2k_uclibc.c \
|
||||
eelf64_ia64.c \
|
||||
eelf64_ia64_fbsd.c \
|
||||
eelf64_ia64_vms.c \
|
||||
|
@ -975,7 +983,7 @@ SRC_POTFILES = $(CFILES) $(HFILES)
|
|||
BLD_POTFILES = $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
|
||||
@AMDEP_FALSE@GENDEPDIR =
|
||||
@AMDEP_TRUE@GENDEPDIR = $(DEPDIR)
|
||||
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
|
||||
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@ @enable_debian_multiarch@
|
||||
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
|
||||
|
||||
# We need this for automake to use YLWRAP.
|
||||
|
@ -1001,13 +1009,13 @@ noinst_LTLIBRARIES = libldtestplug.la libldtestplug2.la \
|
|||
libldtestplug3.la libldtestplug4.la
|
||||
|
||||
libldtestplug_la_SOURCES = testplug.c
|
||||
libldtestplug_la_CFLAGS = -g -O2
|
||||
libldtestplug_la_CFLAGS = -g -O0
|
||||
libldtestplug_la_LDFLAGS = -no-undefined -rpath /nowhere
|
||||
libldtestplug2_la_SOURCES = testplug2.c
|
||||
libldtestplug2_la_CFLAGS = -g -O2
|
||||
libldtestplug2_la_CFLAGS = -g -O0
|
||||
libldtestplug2_la_LDFLAGS = -no-undefined -rpath /nowhere
|
||||
libldtestplug3_la_SOURCES = testplug3.c
|
||||
libldtestplug3_la_CFLAGS = -g -O2
|
||||
libldtestplug3_la_CFLAGS = -g -O0
|
||||
libldtestplug3_la_LDFLAGS = -no-undefined -rpath /nowhere
|
||||
libldtestplug4_la_SOURCES = testplug4.c
|
||||
libldtestplug4_la_CFLAGS = -g -O2
|
||||
|
@ -1249,6 +1257,9 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ed30v_o.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ed30velf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_dlx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k_pm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k_pm_uclibc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_sparc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_sparc_sol2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_sparc_vxworks.Po@am__quote@
|
||||
|
@ -1339,6 +1350,10 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_kpda.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_pm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_uclibc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_vms.Po@am__quote@
|
||||
|
@ -2532,6 +2547,13 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ehppa64linux.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386pep.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emmo.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k_pm.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_e2k_pm_uclibc.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_pm.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_kpda.Pc@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_e2k_uclibc.Pc@am__quote@
|
||||
|
||||
check-DEJAGNU: site.exp
|
||||
srcroot=`cd $(srcdir) && pwd`; export srcroot; \
|
||||
|
|
|
@ -243,6 +243,9 @@
|
|||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to inhibit searching native /etc/ld.so.conf */
|
||||
#undef WITH_CROSS_HOST
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
|
|
@ -649,6 +649,7 @@ STRINGIFY
|
|||
zlibinc
|
||||
zlibdir
|
||||
enable_initfini_array
|
||||
enable_debian_multiarch
|
||||
NATIVE_LIB_DIRS
|
||||
HDEFINES
|
||||
do_compare
|
||||
|
@ -826,6 +827,7 @@ with_lib_path
|
|||
enable_targets
|
||||
enable_64_bit_bfd
|
||||
with_sysroot
|
||||
with_cross_host
|
||||
enable_gold
|
||||
enable_got
|
||||
enable_compressed_debug_sections
|
||||
|
@ -838,6 +840,7 @@ enable_libctf
|
|||
enable_werror
|
||||
enable_build_warnings
|
||||
enable_nls
|
||||
enable_debian_multiarch
|
||||
enable_initfini_array
|
||||
with_system_zlib
|
||||
'
|
||||
|
@ -1509,6 +1512,7 @@ Optional Features:
|
|||
--enable-werror treat compile warnings as errors
|
||||
--enable-build-warnings enable build-time compiler warnings
|
||||
--disable-nls do not use Native Language Support
|
||||
--enable-debian-multiarch use debian multiarch library search paths
|
||||
--disable-initfini-array do not use .init_array/.fini_array sections
|
||||
|
||||
Optional Packages:
|
||||
|
@ -1519,6 +1523,7 @@ Optional Packages:
|
|||
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
|
||||
--with-lib-path=dir1:dir2... set default LIB_PATH
|
||||
--with-sysroot=DIR Search for usr/lib et al within DIR.
|
||||
--with-cross-host make native ld behave as if it were cross
|
||||
--with-system-zlib use installed libz
|
||||
|
||||
Some influential environment variables:
|
||||
|
@ -12037,7 +12042,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12040 "configure"
|
||||
#line 12045 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -12143,7 +12148,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12146 "configure"
|
||||
#line 12151 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -15793,6 +15798,19 @@ fi
|
|||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-cross-host was given.
|
||||
if test "${with_cross_host+set}" = set; then :
|
||||
withval=$with_cross_host;
|
||||
fi
|
||||
|
||||
|
||||
if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
|
||||
|
||||
$as_echo "#define WITH_CROSS_HOST 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check whether --enable-gold was given.
|
||||
if test "${enable_gold+set}" = set; then :
|
||||
enableval=$enable_gold; case "${enableval}" in
|
||||
|
@ -17315,6 +17333,18 @@ if test "$ac_res" != no; then :
|
|||
fi
|
||||
|
||||
|
||||
# Check whether --enable-debian-multiarch was given.
|
||||
if test "${enable_debian_multiarch+set}" = set; then :
|
||||
enableval=$enable_debian_multiarch; case "${enableval}" in
|
||||
yes|no) ;;
|
||||
*) as_fn_error $? "invalid --enable-debian-multiarch argument" "$LINENO" 5 ;;
|
||||
esac
|
||||
else
|
||||
enable_debian_multiarch=no
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-initfini-array was given.
|
||||
if test "${enable_initfini_array+set}" = set; then :
|
||||
enableval=$enable_initfini_array; case "${enableval}" in
|
||||
|
|
|
@ -94,6 +94,13 @@ AC_SUBST(use_sysroot)
|
|||
AC_SUBST(TARGET_SYSTEM_ROOT)
|
||||
AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
|
||||
|
||||
AC_ARG_WITH(cross-host, [ --with-cross-host make native ld behave as if it were cross])
|
||||
|
||||
if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
|
||||
AC_DEFINE([WITH_CROSS_HOST], 1,
|
||||
[Define to inhibit searching native /etc/ld.so.conf])
|
||||
fi
|
||||
|
||||
dnl Use --enable-gold to decide if this linker should be the default.
|
||||
dnl "install_as_default" is set to false if gold is the default linker.
|
||||
dnl "installed_linker" is the installed BFD linker name.
|
||||
|
@ -281,6 +288,14 @@ AC_FUNC_MMAP
|
|||
|
||||
AC_SEARCH_LIBS([dlopen], [dl])
|
||||
|
||||
AC_ARG_ENABLE(debian-multiarch,
|
||||
[ --enable-debian-multiarch use debian multiarch library search paths],
|
||||
[case "${enableval}" in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([invalid --enable-debian-multiarch argument]) ;;
|
||||
esac], [enable_debian_multiarch=no])
|
||||
AC_SUBST(enable_debian_multiarch)
|
||||
|
||||
AC_ARG_ENABLE(initfini-array,
|
||||
[ --disable-initfini-array do not use .init_array/.fini_array sections],
|
||||
[case "${enableval}" in
|
||||
|
|
|
@ -257,7 +257,10 @@ dlx-*-elf*) targ_emul=elf32_dlx
|
|||
targ_extra_ofiles=ldelfgen.o
|
||||
;;
|
||||
e2k-mcst-linux-gnu) targ_emul=elf64_e2k
|
||||
targ_extra_emuls="elf32_e2k elf32_e2k_pm_latest"
|
||||
targ_extra_emuls="elf32_e2k elf32_e2k_pm elf64_e2k_pm"
|
||||
;;
|
||||
e2k-mcst-linux-uclibc) targ_emul=elf64_e2k_uclibc
|
||||
targ_extra_emuls="elf32_e2k_pm_uclibc"
|
||||
;;
|
||||
e2k-mcst-kpda) targ_emul=elf64_e2k_kpda
|
||||
;;
|
||||
|
@ -1076,6 +1079,10 @@ alpha*-*-*)
|
|||
NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
|
||||
;;
|
||||
|
||||
e2k-mcst-kpda)
|
||||
NATIVE_LIB_DIRS='/e2kle/lib /e2kle/usr/lib'
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
case "${target}" in
|
||||
|
|
|
@ -11,4 +11,4 @@ OUTPUT_FORMAT="elf32-e2k"
|
|||
LIBPATH_SUFFIX=32
|
||||
|
||||
|
||||
. ${srcdir}/emulparams/elf_e2k.sh
|
||||
source_sh ${srcdir}/emulparams/elf_e2k.sh
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
OUTPUT_FORMAT="elf32-e2k-pm"
|
||||
source_sh ${srcdir}/emulparams/elf_e2k_pm.sh
|
|
@ -0,0 +1,4 @@
|
|||
source_sh ${srcdir}/emulparams/elf32_e2k_pm.sh
|
||||
E2K_UCLIBC=1
|
||||
# Override BFD target name provided by the above script.
|
||||
OUTPUT_FORMAT="elf32-e2k-pm-uclibc"
|
|
@ -11,8 +11,36 @@ ALIGNMENT=8
|
|||
ARCH=sparc
|
||||
MACHINE=
|
||||
TEMPLATE_NAME=elf
|
||||
EXTRA_EM_FILE=sparcelf
|
||||
DATA_PLT=
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
NOP=0x01000000
|
||||
NO_SMALL_DATA=yes
|
||||
|
||||
# Configurations with `--host=sparc-linux' and `--target=sparc-linux-elf'
|
||||
# (see Bug #60990 for motivations which make us configure binutils this way)
|
||||
# should be considered native so that `/usr/local/lib /lib /usr/lib' can find
|
||||
# their way to SEARCH_DIR (". . .") as it happens when both
|
||||
# `--{host,target}=sparc-linux'. The absence of the aforementioned paths in
|
||||
# SEARCH_DIR (". . .") led to Bug #65304.
|
||||
# Fix this problem in the most primitive way: if the host seems to be Sparc of
|
||||
# any kind, treat this configuration as native.
|
||||
case "$host" in
|
||||
sparc*-*)
|
||||
NATIVE=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
# Support EIR linkage. This variable is used in `ldelf.c' to emit the code
|
||||
# which prevents us from customizing `__ehdr_start' when linking EIR.
|
||||
SUPPORT_EIR=yes
|
||||
|
||||
# On modern Sparc64 Debian sid 32-bit glibc is installed into `{,/usr}/lib32'.
|
||||
# Ensure that `sparc64-linux-ld' is capable of finding it without the help of
|
||||
# `-L/lib/../lib32 -L/usr/lib/../lib32' options which are explicitly passed to
|
||||
# it by GCC on such systems as I'm reluctant to replicate this idiotic
|
||||
# behaviour.
|
||||
if [ "x${enable_debian_multiarch}" = "xyes" ]; then
|
||||
LIBPATH_SUFFIX=32
|
||||
fi
|
||||
|
|
|
@ -11,4 +11,4 @@ OUTPUT_FORMAT="elf64-e2k"
|
|||
LIBPATH_SUFFIX=64
|
||||
|
||||
|
||||
. ${srcdir}/emulparams/elf_e2k.sh
|
||||
source_sh ${srcdir}/emulparams/elf_e2k.sh
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Prevent e2k_set_output_arch () in e2kelf.em from referencing 32 and Protected
|
||||
# Mode target vectors which are not supported for KPDA meanwhile.
|
||||
KPDA=1
|
||||
. ${srcdir}/emulparams/elf64_e2k.sh
|
||||
source_sh ${srcdir}/emulparams/elf64_e2k.sh
|
||||
|
||||
# Ensure that a KPDA-specific BFD target is used.
|
||||
OUTPUT_FORMAT="elf64-e2k-kpda"
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
OUTPUT_FORMAT="elf64-e2k-pm"
|
||||
source_sh ${srcdir}/emulparams/elf_e2k_pm.sh
|
|
@ -0,0 +1,4 @@
|
|||
source_sh ${srcdir}/emulparams/elf64_e2k.sh
|
||||
E2K_UCLIBC=1
|
||||
# Override BFD target name provided by the above script.
|
||||
OUTPUT_FORMAT="elf64-e2k-uclibc"
|
|
@ -1,6 +1,7 @@
|
|||
SCRIPT_NAME=elf
|
||||
ELFSIZE=64
|
||||
TEMPLATE_NAME=elf
|
||||
EXTRA_EM_FILE=sparcelf
|
||||
OUTPUT_FORMAT="elf64-sparc"
|
||||
NO_REL_RELOCS=yes
|
||||
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
|
@ -48,3 +49,7 @@ case "$EMULATION_NAME" in
|
|||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# Support EIR linkage. This variable is used in `ldelf.c' to emit the code
|
||||
# which prevents us from customizing `__ehdr_start' when linking EIR.
|
||||
SUPPORT_EIR=yes
|
||||
|
|
|
@ -5,14 +5,14 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
|||
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
|
||||
ALIGNMENT=8
|
||||
ARCH=e2k
|
||||
TEMPLATE_NAME=elf32
|
||||
TEMPLATE_NAME=elf
|
||||
EXTRA_EM_FILE=e2kelf
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
NO_SMALL_DATA=yes
|
||||
|
||||
# I'd like '-rpath' option to take effect when performing the link
|
||||
# (see the implementation of after_open () in elf32.em).
|
||||
# (see the splitted implementation of after_open () in elf.em and ldelf.c).
|
||||
# Am not I going to break anything . . . ?
|
||||
|
||||
# . . . as a consequence directories coming from the NATIVE_LIB_DIRS parameter
|
||||
|
@ -36,8 +36,8 @@ LDEMUL_PLACE_ORPHAN=${EMULATION_NAME}_place_orphan
|
|||
LDEMUL_AFTER_ALLOCATION=${EMULATION_NAME}_after_allocation;
|
||||
|
||||
|
||||
# Support EIR linkage. This variable is used in `elf32.em' to emit the code
|
||||
# which prevents us from customizing `__ehdr_start' when linking EIR.
|
||||
# Support EIR linkage. This variable is used in `elf.em' to enable the code
|
||||
# in ldelf.c preventing us from customizing `__ehdr_start' when linking EIR.
|
||||
SUPPORT_EIR=yes
|
||||
|
||||
# Delay checking ELF relocations until opening all input files
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
# At present I'd prefer to have `OUTPUT_ARCH(e2k:pm)' rather than just
|
||||
# `OUTPUT_ARCH (e2k)' inside the corresponding LD script (see elf.sc).
|
||||
MACHINE=pm
|
||||
ENABLE_BUG_89922=yes
|
||||
|
||||
# Avoid placing read-only data sections into the code segment in E2K
|
||||
# Protected Mode this way:
|
||||
SEPARATE_CODE=yes
|
||||
|
||||
# Ensure that `/{,usr/,...}lib128' libraries are inserted at the start
|
||||
# of SEARCH_DIRs.
|
||||
LIBPATH_SUFFIX=128
|
||||
|
||||
source_sh ${srcdir}/emulparams/elf_e2k.sh
|
||||
|
||||
# Unlike ordinary modes I'd prefer a shared library's text segment to start
|
||||
# from a non-zero address since zero link-time relocation values are currently
|
||||
# used to distinguish weak undefined symbols when generating `__selfinit ()' in
|
||||
# my PM BFD backend.
|
||||
SHLIB_TEXT_START_ADDR=$TEXT_START_ADDR
|
||||
|
||||
# Taking into account that 'SEGMENT_SIZE == MAXPAGESIZE' by default this
|
||||
# ensures that RO segment has a suitable alignment for placing ELF and Program
|
||||
# Headers in the very beginning of it. Sufficient space for them is allocated
|
||||
# in ld/scripttempl/elf.sc by means of SIZEOF_HEADERS.
|
||||
RODATA_ADDR="ALIGN(${SEGMENT_SIZE})"
|
||||
SHLIB_RODATA_ADDR=$RODATA_ADDR
|
||||
|
||||
TEXT_START_SYMBOLS="
|
||||
PROVIDE_HIDDEN (__selfinit = .);
|
||||
*(.text.selfinit)"
|
|
@ -19,14 +19,23 @@
|
|||
# MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
# This file is sourced from elf32.em, and defines extra e2k-elf
|
||||
# This file is sourced from elf.em, and defines extra e2k-elf
|
||||
# specific routines.
|
||||
#
|
||||
# Define some shell vars to insert bits of code into the standard elf
|
||||
# parse_args and list_options functions.
|
||||
#
|
||||
|
||||
# Create packed PM ELFs for glibc by default and never for uclibc.
|
||||
if test -z "$E2K_UCLIBC"; then
|
||||
PACK_CG=TRUE
|
||||
else
|
||||
PACK_CG=FALSE
|
||||
fi
|
||||
|
||||
fragment <<EOF
|
||||
|
||||
#include "safe-ctype.h"
|
||||
#include "elfxx-e2k.h"
|
||||
|
||||
static int e2k_ipd;
|
||||
|
@ -54,6 +63,9 @@ static bfd_boolean inside_marked_objects;
|
|||
assemblers. */
|
||||
static bfd_boolean simulate;
|
||||
|
||||
/* Use the default based on the above PACK_CG setting. */
|
||||
static bfd_boolean pack_cg = $PACK_CG;
|
||||
|
||||
static bfd_boolean ignore_pure_eir_files;
|
||||
|
||||
/* Placeholders used to restore the corresponding values set
|
||||
|
@ -83,6 +95,12 @@ PARSE_AND_LIST_PROLOGUE='
|
|||
#define OPTION_IGNORE_PURE_EIR_FILES 315
|
||||
'
|
||||
|
||||
if test -z "$E2K_UCLIBC" ; then
|
||||
PARSE_AND_LIST_PROLOGUE=$PARSE_AND_LIST_PROLOGUE'
|
||||
#define OPTION_UNPACKED_CUD_GD 316
|
||||
'
|
||||
fi
|
||||
|
||||
PARSE_AND_LIST_LONGOPTS='
|
||||
{ "e2k-ipd", required_argument, NULL, OPTION_E2K_IPD },
|
||||
{ "e2k-x86app", no_argument, NULL, OPTION_E2K_X86APP },
|
||||
|
@ -101,6 +119,12 @@ PARSE_AND_LIST_LONGOPTS='
|
|||
{ "ignore-pure-eir-files", no_argument, NULL, OPTION_IGNORE_PURE_EIR_FILES},
|
||||
'
|
||||
|
||||
if test -z "$E2K_UCLIBC" ; then
|
||||
PARSE_AND_LIST_LONGOPTS=$PARSE_AND_LIST_LONGOPTS'
|
||||
{ "dont-pack-cud-gd", no_argument, NULL, OPTION_UNPACKED_CUD_GD},
|
||||
'
|
||||
fi
|
||||
|
||||
PARSE_AND_LIST_OPTIONS='
|
||||
fprintf (file, _(" --link-mixed-eir={1,2,3}\n"));
|
||||
fprintf (file, _("\t\t\tLink mixed EIR\n"));
|
||||
|
@ -190,7 +214,7 @@ PARSE_AND_LIST_ARGS_CASES='
|
|||
break;
|
||||
|
||||
case OPTION_SIMULATE:
|
||||
simulate = 1;
|
||||
simulate = TRUE;
|
||||
break;
|
||||
|
||||
case OPTION_IGNORE_PURE_EIR_FILES:
|
||||
|
@ -233,6 +257,14 @@ PARSE_AND_LIST_ARGS_CASES='
|
|||
break;
|
||||
'
|
||||
|
||||
if test -z "$E2K_UCLIBC" ; then
|
||||
PARSE_AND_LIST_ARGS_CASES=$PARSE_AND_LIST_ARGS_CASES'
|
||||
case OPTION_UNPACKED_CUD_GD:
|
||||
pack_cg = FALSE;
|
||||
break;
|
||||
'
|
||||
fi
|
||||
|
||||
fragment <<EOF
|
||||
|
||||
/* This is called before the hash table is allocated. */
|
||||
|
@ -254,11 +286,9 @@ e2k_after_parse (void)
|
|||
/* LINK_MIXED_EIR should be available by the time we open each input
|
||||
file. */
|
||||
_bfd_e2k_elf_after_parse (link_mixed_eir);
|
||||
gld${EMULATION_NAME}_after_parse ();
|
||||
ldelf_after_parse ();
|
||||
}
|
||||
|
||||
static bfd_boolean gld${EMULATION_NAME}_load_symbols
|
||||
(lang_input_statement_type *);
|
||||
|
||||
static bfd_boolean
|
||||
pure_eir_finder (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
|
@ -279,8 +309,8 @@ e2k_recognized_file (lang_input_statement_type *entry)
|
|||
&& bfd_sections_find_if (entry->the_bfd, pure_eir_finder, NULL))
|
||||
return TRUE;
|
||||
|
||||
/* Otherwise, the standard implementation from 'elf32.em' will do. */
|
||||
return gld${EMULATION_NAME}_load_symbols (entry);
|
||||
/* Otherwise, the standard implementation from 'elf.em' will do. */
|
||||
return ldelf_load_symbols (entry);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
|
@ -306,7 +336,7 @@ e2k_after_open (void)
|
|||
_bfd_e2k_elf_after_open (e2k_ipd, e2k_is_x86app, e2k_is_4mpages,
|
||||
arch_set_via_cmdline, restrict_to_arch,
|
||||
relaxed_e2k_machine_check, output_new_e_machine,
|
||||
simulate);
|
||||
simulate, pack_cg);
|
||||
|
||||
gld${EMULATION_NAME}_after_open ();
|
||||
}
|
||||
|
@ -374,7 +404,7 @@ EOF
|
|||
|
||||
if test -z "$KPDA"; then
|
||||
fragment <<EOF
|
||||
ldfile_output_machine = (ldfile_output_machine / 3) * 3 + addend;
|
||||
ldfile_output_machine = (ldfile_output_machine / 4) * 4 + addend;
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
@ -415,7 +445,7 @@ place_dsp_section (asection *s, const char *os_name)
|
|||
maximal possible alignment at DSP side. This is probably the only way
|
||||
to ensure that the section and its symbols are aligned appropriately
|
||||
from the point of view of DSP. */
|
||||
os->section_alignment = 17;
|
||||
os->section_alignment = exp_intop (1U << 17);
|
||||
}
|
||||
|
||||
lang_add_section (&os->children, s, NULL, os);
|
||||
|
@ -465,7 +495,7 @@ ${LDEMUL_PLACE_ORPHAN} (asection *s, const char *secname, int constraint)
|
|||
return place_dsp_section (s, os_name);
|
||||
}
|
||||
|
||||
return gld${EMULATION_NAME}_place_orphan (s, secname, constraint);
|
||||
return ldelf_place_orphan (s, secname, constraint);
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
@ -567,3 +597,4 @@ LDEMUL_ALLOW_DYNAMIC_ENTRIES_IN_RELOCATABLE_LINK=\
|
|||
e2k_allow_dynamic_entries_in_relocatable_link
|
||||
LDEMUL_AFTER_OPEN=e2k_after_open
|
||||
LDEMUL_SET_OUTPUT_ARCH=e2k_set_output_arch
|
||||
LDEMUL_DISABLE_STANDARD_COMPATIBILITY_TESTS=TRUE
|
||||
|
|
|
@ -149,7 +149,19 @@ fragment <<EOF
|
|||
static void
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
ldelf_before_allocation (audit, depaudit, ${ELF_INTERPRETER_NAME});
|
||||
ldelf_before_allocation (audit, depaudit, ${ELF_INTERPRETER_NAME},
|
||||
EOF
|
||||
if [ -n "$SUPPORT_EIR" ]; then
|
||||
fragment <<EOF
|
||||
link_mixed_eir
|
||||
EOF
|
||||
else
|
||||
fragment <<EOF
|
||||
0
|
||||
EOF
|
||||
fi
|
||||
fragment <<EOF
|
||||
);
|
||||
}
|
||||
|
||||
EOF
|
||||
|
@ -928,6 +940,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
|||
${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL},
|
||||
${LDEMUL_EMIT_CTF_EARLY-NULL},
|
||||
${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL},
|
||||
${LDEMUL_PRINT_SYMBOL-NULL}
|
||||
${LDEMUL_PRINT_SYMBOL-NULL},
|
||||
${LDEMUL_ALLOW_DYNAMIC_ENTRIES_IN_RELOCATABLE_LINK-NULL},
|
||||
${LDEMUL_DISABLE_STANDARD_COMPATIBILITY_TESTS-FALSE}
|
||||
};
|
||||
EOF
|
||||
|
|
|
@ -220,6 +220,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
|||
NULL, /* extra_map_file_text */
|
||||
${LDEMUL_EMIT_CTF_EARLY-NULL},
|
||||
${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL},
|
||||
${LDEMUL_PRINT_SYMBOL-NULL}
|
||||
${LDEMUL_PRINT_SYMBOL-NULL},
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
EOF
|
||||
|
|
|
@ -9,6 +9,7 @@ ${EMULATION_NAME}_allow_dynamic_entries_in_relocatable_link
|
|||
|
||||
fragment <<EOF
|
||||
|
||||
#include "hashtab.h"
|
||||
#include "elfxx-sparc.h"
|
||||
|
||||
static int link_mixed_eir = 0;
|
||||
|
@ -39,12 +40,9 @@ static void
|
|||
${LDEMUL_AFTER_PARSE} (void)
|
||||
{
|
||||
_bfd_sparc_elf_after_parse (link_mixed_eir);
|
||||
gld${EMULATION_NAME}_after_parse ();
|
||||
ldelf_after_parse ();
|
||||
}
|
||||
|
||||
static bfd_boolean gld${EMULATION_NAME}_load_symbols
|
||||
(lang_input_statement_type *);
|
||||
|
||||
static bfd_boolean
|
||||
pure_eir_finder (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
asection *section,
|
||||
|
@ -64,8 +62,8 @@ ${LDEMUL_RECOGNIZED_FILE} (lang_input_statement_type *entry)
|
|||
&& bfd_sections_find_if (entry->the_bfd, pure_eir_finder, NULL))
|
||||
return TRUE;
|
||||
|
||||
/* Otherwise, the standard implementation from 'elf32.em' will do. */
|
||||
return gld${EMULATION_NAME}_load_symbols (entry);
|
||||
/* Otherwise, the standard implementation from 'ldelf.c' will do. */
|
||||
return ldelf_load_symbols (entry);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
|
|
163
ld/genscripts.sh
163
ld/genscripts.sh
|
@ -123,7 +123,8 @@ EMULATION_LIBPATH=$2
|
|||
NATIVE_LIB_DIRS=$3
|
||||
use_sysroot=$4
|
||||
ENABLE_INITFINI_ARRAY=$5
|
||||
shift 5
|
||||
enable_debian_multiarch=$6
|
||||
shift 6
|
||||
EMULATION_NAME=$1
|
||||
TOOL_LIB=$2
|
||||
|
||||
|
@ -157,10 +158,11 @@ fi
|
|||
|
||||
case " $EMULATION_LIBPATH " in
|
||||
*" ${EMULATION_NAME} "*)
|
||||
if [ "x${host}" = "x${target}" ] ; then
|
||||
NATIVE=yes
|
||||
USE_LIBPATH=yes
|
||||
elif [ "x${use_sysroot}" = "xyes" ] ; then
|
||||
# if [ "x${host}" = "x${target}" ] ; then
|
||||
# NATIVE=yes
|
||||
# USE_LIBPATH=yes
|
||||
# el
|
||||
if [ "x${use_sysroot}" = "xyes" ] ; then
|
||||
USE_LIBPATH=yes
|
||||
fi
|
||||
;;
|
||||
|
@ -235,6 +237,63 @@ append_to_lib_path()
|
|||
fi
|
||||
}
|
||||
|
||||
if [ "x${enable_debian_multiarch}" = "xyes" ]; then
|
||||
# set the multiarch tuples
|
||||
multiarch_name=
|
||||
multiarch_name_32=
|
||||
multiarch_name_64=
|
||||
|
||||
# In the absence of DEB_TARGET_MULTIARCH* provided by debian build scripts do so
|
||||
# based on the emulation name; using TOOL_LIB seems to unreliable, when
|
||||
# configuring with --enable-targets=powerpc-linux-gnu,powerpc64-linux-gnu
|
||||
# only the first one (?) wins.
|
||||
# FIXME: should this go into ld/emulparams/*.sh ?
|
||||
case "$EMULATION_NAME" in
|
||||
elf32_sparc)
|
||||
multiarch_name=sparc-linux-gnu
|
||||
multiarch_name_64=sparc64-linux-gnu
|
||||
;;
|
||||
elf64_sparc)
|
||||
# The above settings for elf32_sparc have been borrowed from the original
|
||||
# Debian patch intact. This one is added by me as it's incomprehensibly
|
||||
# missing from that patch. Don't they want multiarch support for sparc64?
|
||||
# As for "multiarch_name_64" I don't see any point in it both for "elf{32,
|
||||
# 64}_sparc". See how these rather obscure settings are used to generate
|
||||
# library search paths below: "multiarch_name_64" won't have any chance
|
||||
# to contribute to them for "elf32_sparc" emulation.
|
||||
multiarch_name=sparc64-linux-gnu
|
||||
;;
|
||||
elf32_e2k)
|
||||
multiarch_name=e2k32-linux-gnu
|
||||
;;
|
||||
elf64_e2k)
|
||||
multiarch_name=e2k-linux-gnu
|
||||
;;
|
||||
elf32_e2k_pm | elf64_e2k_pm)
|
||||
multiarch_name=e2k128-linux-gnu
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
|
||||
libs=${NATIVE_LIB_DIRS}
|
||||
if [ "x${NATIVE}" = "xyes" ] ; then
|
||||
case " ${libs} " in
|
||||
*" ${libdir} "*) ;;
|
||||
*) libs="${libdir} ${libs}" ;;
|
||||
esac
|
||||
fi
|
||||
append_to_lib_path ${libs}
|
||||
fi
|
||||
|
||||
case :${lib_path1}:${lib_path2}: in
|
||||
*:: | ::*) LIB_PATH=${lib_path1}${lib_path2} ;;
|
||||
*) LIB_PATH=${lib_path1}:${lib_path2} ;;
|
||||
esac
|
||||
lib_path1=
|
||||
lib_path2=
|
||||
|
||||
fi # enable_debian_multiarch
|
||||
|
||||
# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib when native
|
||||
# except when LIBPATH=":".
|
||||
if [ "${LIB_PATH}" != ":" ] ; then
|
||||
|
@ -260,6 +319,9 @@ if [ "${LIB_PATH}" != ":" ] ; then
|
|||
append_to_lib_path ${libs}
|
||||
fi
|
||||
|
||||
if [ "x${enable_debian_multiarch}" = "xno" ] ; then
|
||||
|
||||
# Note that for multiarch case the following actions have been moved above.
|
||||
if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
|
||||
libs=${NATIVE_LIB_DIRS}
|
||||
if [ "x${NATIVE}" = "xyes" ] ; then
|
||||
|
@ -276,8 +338,99 @@ case :${lib_path1}:${lib_path2}: in
|
|||
*) LIB_PATH=${lib_path1}:${lib_path2} ;;
|
||||
esac
|
||||
|
||||
else # enable_debian_multiarch = yes
|
||||
case :${lib_path1}:${lib_path2}: in
|
||||
*:: | ::*) LIB_PATH=${LIB_PATH}:${lib_path1}${lib_path2} ;;
|
||||
*) LIB_PATH=${LIB_PATH}:${lib_path1}:${lib_path2} ;;
|
||||
esac
|
||||
|
||||
# We use the $tool_lib variable in our multiarch mangling:
|
||||
if [ "x${TOOL_LIB}" = "x" ] ; then
|
||||
tool_lib=${exec_prefix}/${target_alias}/lib
|
||||
else
|
||||
tool_lib=${exec_prefix}/${TOOL_LIB}/lib
|
||||
fi
|
||||
|
||||
# FIXME: why again? These already should be in LIBPATH
|
||||
if [ "x${APPEND_TOOLLIBDIR}" = "xyes" ] ; then
|
||||
LIB_PATH=${LIB_PATH}:${tool_lib}
|
||||
# For multilib targets, search both $tool_lib dirs
|
||||
if [ "x${LIBPATH_SUFFIX}" != "x" ] ; then
|
||||
LIB_PATH=${LIB_PATH}:${tool_lib}${LIBPATH_SUFFIX}
|
||||
fi
|
||||
fi
|
||||
|
||||
fi # enable_debian_multiarch = yes
|
||||
|
||||
LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
|
||||
|
||||
# The underlying trickery is purely multiarch-specific.
|
||||
if [ "x${enable_debian_multiarch}" = "xyes" ] ; then
|
||||
if [ -n "$multiarch_name" ]; then
|
||||
temp_dirs=' '
|
||||
ma_dirs=' '
|
||||
for dir in `echo ${LIB_PATH} | sed -e 's/:/ /g'`; do
|
||||
case "$dir" in
|
||||
*${tool_lib}*|*/${target_alias}/*)
|
||||
;;
|
||||
*/lib)
|
||||
if [ -n "$multiarch_name_32" ]; then
|
||||
case $EMULATION_NAME in
|
||||
elf_i386|elf32*)
|
||||
ma_dirs="${ma_dirs}${dir}/$multiarch_name_32 ";;
|
||||
*)
|
||||
ma_dirs="${ma_dirs}${dir}/$multiarch_name "
|
||||
esac
|
||||
elif [ -n "$multiarch_name_64" ]; then
|
||||
case $EMULATION_NAME in
|
||||
elf*_64|elf64*)
|
||||
ma_dirs="${ma_dirs}${dir}/$multiarch_name_64 ";;
|
||||
*)
|
||||
ma_dirs="${ma_dirs}${dir}/$multiarch_name "
|
||||
esac
|
||||
else
|
||||
ma_dirs="${ma_dirs}${dir}/$multiarch_name "
|
||||
fi
|
||||
;;
|
||||
*/lib32)
|
||||
if [ -n "$multiarch_name_32" ]; then
|
||||
dir2=$(echo $dir | sed "s,32$,,")
|
||||
ma_dirs="${ma_dirs}${dir2}/$multiarch_name_32 "
|
||||
fi
|
||||
;;
|
||||
*/lib64)
|
||||
case "${target}" in
|
||||
aarch64*-*-*|powerpc64-*-*|s390x-*-*|sparc64-*-*|x86_64-*-linux-gnu|mips64-*-gnuabi64)
|
||||
#dir=$(echo $dir | sed "s,64$,,")
|
||||
dir2=$(echo $dir | sed "s,64$,,")
|
||||
ma_dirs="${ma_dirs}${dir2}/$multiarch_name "
|
||||
;;
|
||||
*)
|
||||
if [ -n "$multiarch_name_64" ]; then
|
||||
dir2=$(echo $dir | sed "s,64$,,")
|
||||
ma_dirs="${ma_dirs}${dir2}/$multiarch_name_64 "
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
temp_dirs="${temp_dirs}${dir} "
|
||||
done
|
||||
LIB_SEARCH_DIRS=
|
||||
for dir in $ma_dirs $temp_dirs; do
|
||||
if echo "$LIB_SEARCH_DIRS" | fgrep -q "\"$dir\""; then
|
||||
continue
|
||||
fi
|
||||
LIB_SEARCH_DIRS="${LIB_SEARCH_DIRS}SEARCH_DIR(\"$dir\"); "
|
||||
done
|
||||
fi
|
||||
|
||||
# What's this idiotism needed for ? ? ?
|
||||
echo X3: $LIB_PATH
|
||||
fi # enable_debian_multiarch = yes
|
||||
|
||||
# We need it for testsuite.
|
||||
set $EMULATION_LIBPATH
|
||||
if [ "x$1" = "x$EMULATION_NAME" ]; then
|
||||
|
|
14
ld/ldelf.c
14
ld/ldelf.c
|
@ -915,10 +915,17 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force,
|
|||
(const char *) NULL);
|
||||
if (!ldelf_parse_ld_so_conf (&info, tmppath))
|
||||
{
|
||||
/* FIXME: the original stupid logic makes the host's /etc/ld.so.conf
|
||||
be parsed even when cross LD is used! I need the means to prevent
|
||||
this for the sake of my isolated native e2k-linux-gcc based
|
||||
distribution. This is achieved via --with-cross-host configure
|
||||
option for now. */
|
||||
#ifndef WITH_CROSS_HOST
|
||||
free (tmppath);
|
||||
tmppath = concat (ld_sysroot, "/etc/ld.so.conf",
|
||||
(const char *) NULL);
|
||||
ldelf_parse_ld_so_conf (&info, tmppath);
|
||||
#endif /* WITH_CROSS_HOST */
|
||||
}
|
||||
free (tmppath);
|
||||
|
||||
|
@ -1543,7 +1550,8 @@ ldelf_append_to_separated_string (char **to, char *op_arg)
|
|||
|
||||
void
|
||||
ldelf_before_allocation (char *audit, char *depaudit,
|
||||
const char *default_interpreter_name)
|
||||
const char *default_interpreter_name,
|
||||
int link_mixed_eir)
|
||||
{
|
||||
const char *rpath;
|
||||
asection *sinterp;
|
||||
|
@ -1556,7 +1564,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
|
|||
if (is_elf_hash_table (link_info.hash))
|
||||
{
|
||||
_bfd_elf_tls_setup (link_info.output_bfd, &link_info);
|
||||
|
||||
if (link_mixed_eir == 0)
|
||||
{
|
||||
/* Make __ehdr_start hidden if it has been referenced, to
|
||||
prevent the symbol from being dynamic. */
|
||||
if (!bfd_link_relocatable (&link_info))
|
||||
|
@ -1599,6 +1608,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
|
|||
referred to by dynamic objects. */
|
||||
lang_for_each_statement (ldelf_find_statement_assignment);
|
||||
}
|
||||
}
|
||||
|
||||
/* Let the ELF backend work out the sizes of any sections required
|
||||
by dynamic linking. */
|
||||
|
|
|
@ -25,7 +25,7 @@ extern bfd_boolean ldelf_load_symbols (lang_input_statement_type *);
|
|||
extern void ldelf_after_open (int, int, int, int, int, const char *);
|
||||
extern bfd_boolean ldelf_setup_build_id (bfd *);
|
||||
extern void ldelf_append_to_separated_string (char **, char *);
|
||||
extern void ldelf_before_allocation (char *, char *, const char *);
|
||||
extern void ldelf_before_allocation (char *, char *, const char *, int);
|
||||
extern bfd_boolean ldelf_open_dynamic_archive
|
||||
(const char *, search_dirs_type *, lang_input_statement_type *);
|
||||
extern lang_output_section_statement_type *ldelf_place_orphan
|
||||
|
|
15
ld/ldemul.c
15
ld/ldemul.c
|
@ -436,3 +436,18 @@ ldemul_print_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr)
|
|||
return ld_emulation->print_symbol (hash_entry, ptr);
|
||||
return print_one_symbol (hash_entry, ptr);
|
||||
}
|
||||
|
||||
bfd_boolean
|
||||
ldemul_allow_dynamic_entries_in_relocatable_link (void)
|
||||
{
|
||||
if (ld_emulation->allow_dynamic_entries_in_relocatable_link)
|
||||
return ld_emulation->allow_dynamic_entries_in_relocatable_link ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bfd_boolean
|
||||
ldemul_disable_standard_compatibility_tests (void)
|
||||
{
|
||||
return ld_emulation->disable_standard_compatibility_tests;
|
||||
}
|
||||
|
|
19
ld/ldemul.h
19
ld/ldemul.h
|
@ -115,6 +115,11 @@ extern void ldemul_examine_strtab_for_ctf
|
|||
extern bfd_boolean ldemul_print_symbol
|
||||
(struct bfd_link_hash_entry *hash_entry, void *ptr);
|
||||
|
||||
extern bfd_boolean ldemul_allow_dynamic_entries_in_relocatable_link
|
||||
(void);
|
||||
extern bfd_boolean ldemul_disable_standard_compatibility_tests
|
||||
(void);
|
||||
|
||||
typedef struct ld_emulation_xfer_struct {
|
||||
/* Run before parsing the command line and script file.
|
||||
Set the architecture, maybe other things. */
|
||||
|
@ -244,6 +249,20 @@ typedef struct ld_emulation_xfer_struct {
|
|||
bfd_boolean (*print_symbol)
|
||||
(struct bfd_link_hash_entry *hash_entry, void *ptr);
|
||||
|
||||
bfd_boolean (*allow_dynamic_entries_in_relocatable_link)
|
||||
(void);
|
||||
|
||||
/* For E2K we have got our own compatibility tests in "merge_private_bfd_data
|
||||
()" handler capable of recognizing EF_E2K_INCOMPAT in addition to `bfd_arch
|
||||
_info'. Therefore, inhibit the standard compatibility tests in e2k-linux-ld
|
||||
making use of `abfd->arch_info->compatible (bfd_arch_info_1, bfd_arch_info
|
||||
_2)' that may result in a false success. On the other hand, if they
|
||||
resulted in a true failure, their error messages would be output instead
|
||||
of e2k-specific ones which would look rather inconsistent. TODO: if
|
||||
EF_E2K_INCOMPAT was encoded in `bfd_arch_info.mach' the standard
|
||||
compatibility tests could be revived presumably along with the removal of
|
||||
the analogous ones from E2K-specific "merge_private_bfd_data ()". */
|
||||
bfd_boolean disable_standard_compatibility_tests;
|
||||
} ld_emulation_xfer_type;
|
||||
|
||||
typedef enum {
|
||||
|
|
11
ld/ldfile.c
11
ld/ldfile.c
|
@ -284,9 +284,16 @@ ldfile_try_open_bfd (const char *attempt,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* FIXME: the check for compatibility may be unduly skipped here for
|
||||
E2K, however we have implicitly skipped it for years because of a
|
||||
deficient `bfd_e2k_compatible ()' implementation. Now that the
|
||||
latter is being fixed for the sake of GDB ensure that the old
|
||||
behaviour is preserved for safety until `bfd_e2k_compatible ()'
|
||||
becomes capable of recognizing EF_E2K_INCOMPAT at least. */
|
||||
if (entry->flags.search_dirs
|
||||
&& !bfd_arch_get_compatible (check, link_info.output_bfd,
|
||||
command_line.accept_unknown_input_arch)
|
||||
&& !(ldemul_disable_standard_compatibility_tests ()
|
||||
|| bfd_arch_get_compatible (check, link_info.output_bfd,
|
||||
command_line.accept_unknown_input_arch))
|
||||
/* XCOFF archives can have 32 and 64 bit objects. */
|
||||
&& !(bfd_get_flavour (check) == bfd_target_xcoff_flavour
|
||||
&& (bfd_get_flavour (link_info.output_bfd)
|
||||
|
|
12
ld/ldlang.c
12
ld/ldlang.c
|
@ -6952,7 +6952,11 @@ lang_check (void)
|
|||
relocs for other link purposes than a final link). */
|
||||
if ((bfd_link_relocatable (&link_info)
|
||||
|| link_info.emitrelocations)
|
||||
&& (compatible == NULL
|
||||
&& (/* For E2K we may have more appropriate compatibility tests in
|
||||
"merge_private_bfd_data ()" along with more meaningful error
|
||||
messages. */
|
||||
(! ldemul_disable_standard_compatibility_tests ()
|
||||
&& compatible == NULL)
|
||||
|| (bfd_get_flavour (input_bfd)
|
||||
!= bfd_get_flavour (link_info.output_bfd)))
|
||||
&& (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
|
||||
|
@ -6964,7 +6968,11 @@ lang_check (void)
|
|||
/* einfo with %F exits. */
|
||||
}
|
||||
|
||||
if (compatible == NULL)
|
||||
/* For E2K we have got more appropriate compatibility tests in
|
||||
"merge_private_bfd_data ()" along with more meaningful error
|
||||
messages. */
|
||||
if (! ldemul_disable_standard_compatibility_tests ()
|
||||
&& compatible == NULL)
|
||||
{
|
||||
if (command_line.warn_mismatch)
|
||||
einfo (_("%X%P: %s architecture of input file `%pB'"
|
||||
|
|
|
@ -253,6 +253,14 @@ main (int argc, char **argv)
|
|||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
#if 0
|
||||
/* FIXME: without this hack bfd.mo will be searched in `/usr/share/locale/.../
|
||||
LC_MESSAGES/' ignoring the prefix at which it's actually installed! The
|
||||
same probably applies to other ld dependencies: libiberty, libopcodes,
|
||||
. . . What a drawback in localization it is! */
|
||||
bindtextdomain ("bfd", LOCALEDIR);
|
||||
#endif /* 0 */
|
||||
|
||||
program_name = argv[0];
|
||||
xmalloc_set_program_name (program_name);
|
||||
|
||||
|
|
10
ld/lexsup.c
10
ld/lexsup.c
|
@ -1758,6 +1758,16 @@ parse_args (unsigned argc, char **argv)
|
|||
/* Fall through. */
|
||||
case dynamic_list:
|
||||
link_info.dynamic = TRUE;
|
||||
/* The unconditional reset of OPT_SYMBOLIC here that appeared as a result
|
||||
of PR ld/26018 makes --dynamic-list* override both `-Bsymbolic{,
|
||||
-functions}'. Whereas it probably makes sense to override the former
|
||||
(prior to the fix it was -Bsymbolic that overrode --dynamic-list*),
|
||||
-Bsymbolic-functions could still be successfully combined with
|
||||
--dynamic-list* as it used to be. The failure to support such a
|
||||
combination implying that .so-library should be bound to NONE of its
|
||||
non-function symbols and the ones in the list resulted in
|
||||
Bug #126194. */
|
||||
if (opt_symbolic == symbolic)
|
||||
opt_symbolic = symbolic_unset;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -61,10 +61,7 @@ template <class type> struct alignof_helper { char __slot1; type __slot2; };
|
|||
# endif
|
||||
# endif
|
||||
# include <stdlib.h>
|
||||
|
||||
#ifdef __linux__
|
||||
# include <stdint.h>
|
||||
#endif /* __linux__ */
|
||||
|
||||
# ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
|
415
missing
415
missing
|
@ -1,11 +1,10 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
scriptversion=2013-10-28.13; # UTC
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2008, 2009 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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
|
||||
|
@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC
|
|||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||
\`g' are ignored when checking the name.
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
|
@ -100,278 +70,141 @@ Send bug reports to <bug-automake@gnu.org>."
|
|||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# normalize program name to check for.
|
||||
program=`echo "$1" | sed '
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program). This is about non-GNU programs, so use $1 not
|
||||
# $program.
|
||||
case $1 in
|
||||
lex*|yacc*)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar*)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $program in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
|
||||
autoheader*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
|
||||
autom4te*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'autom4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
|
||||
bison*|yacc*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex*|flex*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit $?
|
||||
fi
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
|
||||
makeinfo*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
|
||||
# Personally I disagree with the preceding statement. The failure to build
|
||||
# `.info' files shouldn't prevent us from building everything else. This is
|
||||
# especially true for Solaris where we have an ancient makeinfo. Moreover,
|
||||
# I cannot understand the logic of this check. Where are we going to take
|
||||
# a ready-made output `.info' file from in a build tree?
|
||||
# test -f $file || exit 1
|
||||
touch $file
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
|
||||
tar*)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
exit 0
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
|
|
|
@ -62,6 +62,7 @@ HFILES = \
|
|||
bpf-desc.h bpf-opc.h \
|
||||
epiphany-desc.h epiphany-opc.h \
|
||||
fr30-desc.h fr30-opc.h \
|
||||
e2k-opc.h \
|
||||
frv-desc.h frv-opc.h \
|
||||
i386-init.h \
|
||||
i386-opc.h \
|
||||
|
@ -123,6 +124,8 @@ TARGET_LIBOPCODES_CFILES = \
|
|||
bpf-dis.c \
|
||||
bpf-ibld.c \
|
||||
bpf-opc.c \
|
||||
e2k-dis.c \
|
||||
e2k-opc.c \
|
||||
epiphany-asm.c \
|
||||
epiphany-desc.c \
|
||||
epiphany-dis.c \
|
||||
|
|
|
@ -451,6 +451,7 @@ HFILES = \
|
|||
bpf-desc.h bpf-opc.h \
|
||||
epiphany-desc.h epiphany-opc.h \
|
||||
fr30-desc.h fr30-opc.h \
|
||||
e2k-opc.h \
|
||||
frv-desc.h frv-opc.h \
|
||||
i386-init.h \
|
||||
i386-opc.h \
|
||||
|
@ -513,6 +514,8 @@ TARGET_LIBOPCODES_CFILES = \
|
|||
bpf-dis.c \
|
||||
bpf-ibld.c \
|
||||
bpf-opc.c \
|
||||
e2k-dis.c \
|
||||
e2k-opc.c \
|
||||
epiphany-asm.c \
|
||||
epiphany-desc.c \
|
||||
epiphany-dis.c \
|
||||
|
@ -927,6 +930,8 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis-init.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disassemble.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlx-dis.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/e2k-dis.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/e2k-opc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epiphany-asm.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epiphany-desc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epiphany-dis.Plo@am__quote@
|
||||
|
|
|
@ -800,6 +800,8 @@ enable_fast_install
|
|||
with_gnu_ld
|
||||
enable_libtool_lock
|
||||
enable_targets
|
||||
enable_e2k_opcodes
|
||||
enable_e2k_encodings
|
||||
enable_werror
|
||||
enable_build_warnings
|
||||
enable_maintainer_mode
|
||||
|
@ -1447,6 +1449,8 @@ Optional Features:
|
|||
optimize for fast installation [default=yes]
|
||||
--disable-libtool-lock avoid locking (might break parallel builds)
|
||||
--enable-targets alternative target configurations
|
||||
--enable-e2k-opcodes enable opcodes for E2K
|
||||
--enable-e2k-encodings enable raw instruction encodings in disassembly for E2K
|
||||
--enable-werror treat compile warnings as errors
|
||||
--enable-build-warnings enable build-time compiler warnings
|
||||
--enable-maintainer-mode
|
||||
|
@ -11439,7 +11443,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11442 "configure"
|
||||
#line 11446 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -11545,7 +11549,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11548 "configure"
|
||||
#line 11552 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -11794,6 +11798,37 @@ esac
|
|||
fi
|
||||
|
||||
|
||||
# Check whether --enable-e2k-opcodes was given.
|
||||
if test "${enable_e2k_opcodes+set}" = set; then :
|
||||
enableval=$enable_e2k_opcodes; case "${enableval}" in
|
||||
yes | no) enable_e2k_opcodes=$enableval ;;
|
||||
*) as_fn_error $? "enable-e2k-opcodes option must specify either 'yes' or 'no'" "$LINENO" 5
|
||||
;;
|
||||
esac
|
||||
else
|
||||
enable_e2k_opcodes=yes
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-e2k-encodings was given.
|
||||
if test "${enable_e2k_encodings+set}" = set; then :
|
||||
enableval=$enable_e2k_encodings; case "${enableval}" in
|
||||
yes | no) enable_e2k_encodings=$enableval ;;
|
||||
*) as_fn_error $? "enable-e2k-encodings option must specify either 'yes' or 'no'" "$LINENO" 5
|
||||
;;
|
||||
esac
|
||||
else
|
||||
enable_e2k_encodings=no
|
||||
fi
|
||||
|
||||
if test $enable_e2k_encodings = yes ; then
|
||||
|
||||
$as_echo "#define ENABLE_E2K_ENCODINGS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Set the 'development' global.
|
||||
. $srcdir/../bfd/development.sh
|
||||
|
||||
|
@ -12877,6 +12912,13 @@ if test x${all_targets} = xfalse ; then
|
|||
bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;;
|
||||
bfd_d30v_arch) ta="$ta d30v-dis.lo d30v-opc.lo" ;;
|
||||
bfd_dlx_arch) ta="$ta dlx-dis.lo" ;;
|
||||
bfd_e2k_arch)
|
||||
if test $enable_e2k_opcodes = yes ; then
|
||||
ta="$ta e2k-dis.lo e2k-opc.lo"
|
||||
else
|
||||
archdefs="$archdefs -UARCH_$ad"
|
||||
fi
|
||||
;;
|
||||
bfd_fr30_arch) ta="$ta fr30-asm.lo fr30-desc.lo fr30-dis.lo fr30-ibld.lo fr30-opc.lo" using_cgen=yes ;;
|
||||
bfd_frv_arch) ta="$ta frv-asm.lo frv-desc.lo frv-dis.lo frv-ibld.lo frv-opc.lo" using_cgen=yes ;;
|
||||
bfd_ft32_arch) ta="$ta ft32-opc.lo ft32-dis.lo" ;;
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#define ARCH_d30v
|
||||
#define ARCH_dlx
|
||||
#define ARCH_bpf
|
||||
#define ARCH_e2k
|
||||
#define ARCH_epiphany
|
||||
#define ARCH_fr30
|
||||
#define ARCH_frv
|
||||
|
@ -205,6 +206,11 @@ disassembler (enum bfd_architecture a,
|
|||
disassemble = print_insn_dlx;
|
||||
break;
|
||||
#endif
|
||||
#ifdef ARCH_e2k
|
||||
case bfd_arch_e2k:
|
||||
disassemble = print_insn_e2k;
|
||||
break;
|
||||
#endif
|
||||
#ifdef ARCH_h8300
|
||||
case bfd_arch_h8300:
|
||||
if (mach == bfd_mach_h8300h || mach == bfd_mach_h8300hn)
|
||||
|
|
|
@ -37,6 +37,8 @@ extern int print_insn_d10v (bfd_vma, disassemble_info *);
|
|||
extern int print_insn_d30v (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_dlx (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_bpf (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_e2k (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_dsp (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_epiphany (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_fr30 (bfd_vma, disassemble_info *);
|
||||
extern int print_insn_frv (bfd_vma, disassemble_info *);
|
||||
|
|
|
@ -624,10 +624,58 @@ print_predicates (disassemble_info *info,
|
|||
question sign, for MRGC - a comma. */
|
||||
int first_separator = 0;
|
||||
const struct unpacked_instr *instr = &unpacked_instr;
|
||||
/* Bit numbers in `{MASK,NEG}[]'. */
|
||||
int mask_bit, neg_bit;
|
||||
/* Required RLP for this ALC. */
|
||||
unsigned short req_rlp = chn <= 2 ? 0 : 1;
|
||||
unsigned short req_rlp;
|
||||
/* Required MRGC for this ALC in case ALF proves to be `merge{s,d}'. */
|
||||
unsigned short req_mrgc = chn <= 2 ? 2 : 3;
|
||||
unsigned short req_mrgc;
|
||||
|
||||
/* Get MASK[] and NEG[] bit numbers along with RLPx and MRGCy. When doing so
|
||||
note that `CHN < 6' matches the respective ALC, whereas `CHN == {6,7}'
|
||||
AM{2,5}. */
|
||||
if (chn <= 2 || chn == 6)
|
||||
{
|
||||
if (chn == 6)
|
||||
{
|
||||
mask_bit = 3;
|
||||
neg_bit = 2;
|
||||
}
|
||||
else
|
||||
mask_bit = neg_bit = chn;
|
||||
|
||||
if (! mrgc)
|
||||
req_rlp = 0;
|
||||
}
|
||||
else if ((chn >= 3 && chn <= 5) || chn == 7)
|
||||
{
|
||||
/* Note that chn >= 3 here. */
|
||||
if (chn <= 5)
|
||||
mask_bit = neg_bit = chn - 3;
|
||||
else /* chn == 7 */
|
||||
{
|
||||
mask_bit = 3;
|
||||
neg_bit = 2;
|
||||
}
|
||||
|
||||
if (! mrgc)
|
||||
req_rlp = 1;
|
||||
}
|
||||
else
|
||||
assert (0);
|
||||
|
||||
if (mrgc)
|
||||
{
|
||||
if (chn <= 2)
|
||||
req_mrgc = 2;
|
||||
else if (chn <= 5)
|
||||
req_mrgc = 3;
|
||||
else
|
||||
/* No MRGC should ever act on anything than ALCx. FIXME: `RPC == MRGC0'
|
||||
acting on {S,L,C}RP is to be considered yet. */
|
||||
assert (0);
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
@ -645,7 +693,7 @@ print_predicates (disassemble_info *info,
|
|||
/* Is this RLP suitable for CHN and is CHN present in its mask? */
|
||||
if (((! mrgc && opc == req_rlp)
|
||||
|| (mrgc && opc == req_mrgc))
|
||||
&& (mask & (1 << (chn - 3 * req_rlp))))
|
||||
&& (mask & (1 << mask_bit)))
|
||||
{
|
||||
unsigned short neg = (cds[j] & 0x0380) >> 7;
|
||||
unsigned short pred = cds[j] & 0x7f;
|
||||
|
@ -662,7 +710,7 @@ print_predicates (disassemble_info *info,
|
|||
the same ALC are inappropriate in fact . . . */
|
||||
my_printf (mrgc ? " " : ", ");
|
||||
|
||||
if (neg & (1 << (chn - 3 * req_rlp)))
|
||||
if (neg & (1 << neg_bit))
|
||||
my_printf ("~");
|
||||
|
||||
if ((pred & 0x60) == 0x40)
|
||||
|
@ -676,6 +724,8 @@ print_predicates (disassemble_info *info,
|
|||
}
|
||||
}
|
||||
|
||||
static void print_ctcond (disassemble_info *info, unsigned int ctcond);
|
||||
|
||||
static void
|
||||
print_alf (disassemble_info *info, int chn)
|
||||
{
|
||||
|
@ -775,12 +825,17 @@ print_alf (disassemble_info *info, int chn)
|
|||
continue;
|
||||
}
|
||||
|
||||
else if (templ->alopf == ALOPF12)
|
||||
else if (templ->alopf == ALOPF12
|
||||
|| templ->alopf == ALOPF12_IBRANCHD
|
||||
|| templ->alopf == ALOPF12_ICALLD)
|
||||
{
|
||||
const e2k_alopf12_opcode_templ *alopf12;
|
||||
|
||||
alopf12 = (const e2k_alopf12_opcode_templ *) templ;
|
||||
if ((instr->als[chn] & 0x00ff0000) != (unsigned) (alopf12->opce << 16)
|
||||
if ((templ->alopf != ALOPF12_ICALLD
|
||||
/* For ICALLD ALS.opce encodes WBS, therefore it shouldn't
|
||||
be verified this way. */
|
||||
&& (instr->als[chn] & 0x00ff0000) != (unsigned) (alopf12->opce << 16))
|
||||
|| instr->ales[chn] != ((alopf12->ales_opc2 << 8)
|
||||
| alopf12->ales_opce))
|
||||
continue;
|
||||
|
@ -854,6 +909,12 @@ print_alf (disassemble_info *info, int chn)
|
|||
instructions which are disassembled as ALOPF10 above. */
|
||||
else if (templ->alopf == AAURW)
|
||||
continue;
|
||||
/* This just prevents an assertion failure on recently added ALOPF19
|
||||
templates for the sake of LDAA* instructions support in GAS. TODO:
|
||||
their disassembly is to be implemented yet by analogy with ALOPF10
|
||||
`STAA*'s. */
|
||||
else if (templ->alopf == ALOPF19)
|
||||
continue;
|
||||
/* It's a 100% internal error if we turned out to be incapable of
|
||||
recognizing our own instruction template. It would be easier to
|
||||
skip it silently, of course, and not to disappoint the user, who
|
||||
|
@ -971,10 +1032,15 @@ print_alf (disassemble_info *info, int chn)
|
|||
else if (match->alopf == ALOPF2
|
||||
|| match->alopf == ALOPF12
|
||||
|| match->alopf == ALOPF12_PSHUFH
|
||||
|| match->alopf == ALOPF12_IBRANCHD
|
||||
|| match->alopf == ALOPF12_ICALLD
|
||||
|| match->alopf == ALOPF22)
|
||||
{
|
||||
const e2k_alf2_opcode_templ *alf2 = (const e2k_alf2_opcode_templ *) match;
|
||||
|
||||
if (match->alopf == ALOPF12_ICALLD)
|
||||
my_printf ("wbs = 0x%x, ", (instr->als[chn] & 0x00ff0000) >> 16);
|
||||
|
||||
print_src2 (info, chn, alf2->arg_fmt[0]);
|
||||
my_printf (", ");
|
||||
|
||||
|
@ -983,6 +1049,10 @@ print_alf (disassemble_info *info, int chn)
|
|||
my_printf ("0x%x, ", (unsigned) (instr->ales[chn] & 0xff));
|
||||
|
||||
print_dst_in_als (info, chn, alf2->arg_fmt[1]);
|
||||
|
||||
if (match->alopf == ALOPF12_IBRANCHD
|
||||
|| match->alopf == ALOPF12_ICALLD)
|
||||
print_ctcond (info, instr->ss & 0x1ff);
|
||||
}
|
||||
else if (match->alopf == ALOPF3
|
||||
|| match->alopf == ALOPF13)
|
||||
|
@ -1042,8 +1112,6 @@ print_alf (disassemble_info *info, int chn)
|
|||
{
|
||||
unsigned int opce1 = (instr->als[chn] & 0x00ffff00) >> 8;
|
||||
unsigned int lt = opce1 & 0x3;
|
||||
unsigned int am = (opce1 & 0x4) >> 2;
|
||||
unsigned int incr = (opce1 & 0x70) >> 4;
|
||||
unsigned int ind = (opce1 & 0x780) >> 7;
|
||||
unsigned int d = (opce1 & 0xf800) >> 11;
|
||||
|
||||
|
@ -1063,13 +1131,6 @@ print_alf (disassemble_info *info, int chn)
|
|||
}
|
||||
|
||||
my_printf (" ]");
|
||||
|
||||
if (am)
|
||||
{
|
||||
indentate ();
|
||||
my_printf ("incr,%d %%aaincr%d", chn, incr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (match->need_mas
|
||||
|
@ -1093,8 +1154,27 @@ print_alf (disassemble_info *info, int chn)
|
|||
|| match->alopf == ALOPF21_MERGE)
|
||||
print_predicates (info, chn, 1);
|
||||
|
||||
/* Print RLP predicates. */
|
||||
/* Print RLP predicates. Note that because these predicates are `alj_cond's
|
||||
they are not applicable to `I{BRANCH,CALL}D'. */
|
||||
if (match->alopf != ALOPF12_IBRANCHD
|
||||
&& match->alopf != ALOPF12_ICALLD)
|
||||
print_predicates (info, chn, 0);
|
||||
|
||||
/* Disassemble the INCR part of ALOPF10. */
|
||||
if (match->alopf == ALOPF10)
|
||||
{
|
||||
unsigned int opce1 = (instr->als[chn] & 0x00ffff00) >> 8;
|
||||
unsigned int am = (opce1 & 0x4) >> 2;
|
||||
unsigned int incr = (opce1 & 0x70) >> 4;
|
||||
|
||||
if (am)
|
||||
{
|
||||
indentate ();
|
||||
my_printf ("incr,%d %%aaincr%d", chn, incr);
|
||||
print_predicates (info, chn == 2 ? 6 : 7, 0);
|
||||
}
|
||||
}
|
||||
|
||||
end_syllable ();
|
||||
}
|
||||
|
||||
|
@ -1571,6 +1651,7 @@ print_cs0 (disassemble_info *info, bfd_vma instr_addr)
|
|||
PREF,
|
||||
PUTTSD,
|
||||
DONE,
|
||||
IRET,
|
||||
HRET,
|
||||
GLAUNCH,
|
||||
DISP,
|
||||
|
@ -1581,8 +1662,9 @@ print_cs0 (disassemble_info *info, bfd_vma instr_addr)
|
|||
} cs0_type;
|
||||
|
||||
static const char *cs0_names[] = {"", "ibranch", "pref", "puttsd",
|
||||
"done", "hret", "glaunch", "disp", "sdisp",
|
||||
"gettsd", "ldisp", "return"};
|
||||
"done", "iret", "hret", "glaunch",
|
||||
"disp", "sdisp", "gettsd", "ldisp",
|
||||
"return"};
|
||||
/* This is a copy of Table B.4.1 in `iset-v6.single'. */
|
||||
static cs0_type cs0_ops[4][4] = {
|
||||
{IBRANCH, PREF, PUTTSD, DONE},
|
||||
|
@ -1604,7 +1686,12 @@ print_cs0 (disassemble_info *info, bfd_vma instr_addr)
|
|||
type = GETTSD;
|
||||
else if (type == DONE)
|
||||
{
|
||||
if (param_type == 3)
|
||||
/* For {H,I}RET and GLAUNCH CS0.opc is the same as that of DONE (see
|
||||
Table B.4.1). Param types making these instructions different are
|
||||
listed in Table B.4.1.1. */
|
||||
if (param_type == 2)
|
||||
type = IRET;
|
||||
else if (param_type == 3)
|
||||
type = HRET;
|
||||
else if (param_type == 4)
|
||||
type = GLAUNCH;
|
||||
|
@ -1613,28 +1700,34 @@ print_cs0 (disassemble_info *info, bfd_vma instr_addr)
|
|||
|
||||
print_syllable ("CS0", 0, instr->cs0);
|
||||
|
||||
if (type == IBRANCH || type == DONE || type == HRET || type == GLAUNCH)
|
||||
if (type == IBRANCH
|
||||
|| type == DONE
|
||||
|| type == IRET
|
||||
|| type == HRET
|
||||
|| type == GLAUNCH)
|
||||
{
|
||||
/* IBRANCH, DONE, HRET and GLAUNCH are special because they require SS
|
||||
/* IBRANCH, DONE, {H,I}RET and GLAUNCH are special because they require SS
|
||||
to be properly encoded. */
|
||||
if (! instr->ss_present
|
||||
/* SS.ctop should be equal to zero for IBRANCH, DONE, HRET and
|
||||
GLAUNCH (see C.17.1.1, note that they don't mention the latter two
|
||||
instructions there which is probably an omission ). */
|
||||
/* SS.ctop should be equal to zero for IBRANCH, DONE, {I,H}RET and
|
||||
GLAUNCH (see C.17.1.1, note that they don't mention the latter three
|
||||
instructions there which is probably an omission; however, this is
|
||||
specified in the description of each instruction ). */
|
||||
|| (instr->ss & 0x00000c00))
|
||||
{
|
||||
indentate ();
|
||||
my_printf ("invalid %s", cs0_names[type]);
|
||||
}
|
||||
/* Don't output either of the aforementioned instructions under "never"
|
||||
condition. Don't disassemble CS0 being a part of HCALL. Unlike ldis
|
||||
HCALL is currently disassembled on behalf of CS1. */
|
||||
condition. Don't disassemble CS0 being a part of {H,I}CALL. Unlike
|
||||
ldis {H,I}CALL are currently disassembled on behalf of CS1. */
|
||||
else if (instr->ss & 0x1ff
|
||||
&& !(instr->cs1_present
|
||||
/* CS1.opc == CALL */
|
||||
&& (instr->cs1 & 0xf0000000) >> 28 == 5
|
||||
/* CS1.param.ctopc == HCALL */
|
||||
&& (instr->cs1 & 0x380) >> 7 == 2))
|
||||
/* CS1.param.ctopc == {H,I}CALL */
|
||||
&& ((instr->cs1 & 0x380) >> 7 == 2
|
||||
|| (instr->cs1 & 0x380) >> 7 == 1)))
|
||||
{
|
||||
indentate ();
|
||||
my_printf ("%s", cs0_names[type]);
|
||||
|
@ -1884,17 +1977,25 @@ print_cs1 (disassemble_info *info)
|
|||
else
|
||||
{
|
||||
unsigned int cs1_ctopc = (cs1 & 0x380) >> 7;
|
||||
/* CS1.param.ctpopc == HCALL. CS0 is required to encode HCALL. */
|
||||
if (cs1_ctopc == 2 && instr->cs0_present)
|
||||
/* CS1.param.ctpopc == {H,I}CALL == {2,1} (see Table B.4.2.1).
|
||||
CS0 is required to encode {H,I}CALL. */
|
||||
if ((cs1_ctopc == 2 || cs1_ctopc == 1) && instr->cs0_present)
|
||||
{
|
||||
unsigned int cs0 = instr->cs0;
|
||||
unsigned int cs0_opc = (cs0 & 0xf0000000) >> 28;
|
||||
/* CS0.opc == HCALL, which means
|
||||
/* CS0.opc == {H,I}CALL == 0 (see Table B.4.1), which means
|
||||
CS0.opc.ctpr == CS0.opc.ctp_opc == 0 */
|
||||
if (cs0_opc == 0)
|
||||
{
|
||||
unsigned int hdisp = (cs0 & 0x1e) >> 1;
|
||||
my_printf ("hcall 0x%x, wbs = 0x%x", hdisp, wbs);
|
||||
int is_hcall = cs1_ctopc == 2;
|
||||
unsigned int disp;
|
||||
|
||||
/* HCALL's hdisp is encoded in a rather weird way in
|
||||
CS0.disp[4:1] unlike ICALL's disp occupying the whole
|
||||
28-bit CS0.disp. */
|
||||
disp = is_hcall ? ((cs0 & 0x1e) >> 1) : (cs0 & 0xfffffff);
|
||||
my_printf ("%ccall 0x%x, wbs = 0x%x",
|
||||
is_hcall ? 'h' : 'i', disp, wbs);
|
||||
print_ctcond (info, instr->ss & 0x1ff);
|
||||
}
|
||||
}
|
||||
|
@ -1931,6 +2032,25 @@ print_cs1 (disassemble_info *info)
|
|||
indentate ();
|
||||
my_printf ("flushc");
|
||||
}
|
||||
|
||||
/* Presumably the presence of `FILL{R,C}' on `elbrus-v{X<6}' could be
|
||||
silently ignored as they are not recognized by these CPUs and probably
|
||||
don't result in any exceptions, however, I'd prefer to attract the
|
||||
user's attention to the fact that these unimplemented instructions are
|
||||
encoded in the disassembled file. */
|
||||
/* Check for `CS1.param.fillr'. */
|
||||
if (cs1 & 0x00000004)
|
||||
{
|
||||
indentate ();
|
||||
my_printf ("%sfillr", mcpu < 6 ? "unimp " : "");
|
||||
}
|
||||
|
||||
/* Check for `CS1.param.fillc'. */
|
||||
if (cs1 & 0x00000008)
|
||||
{
|
||||
indentate ();
|
||||
my_printf ("%sfillc", mcpu < 6 ? "unimp " : "");
|
||||
}
|
||||
}
|
||||
else if (opc == BG)
|
||||
{
|
||||
|
@ -2275,6 +2395,7 @@ print_insn_e2k (bfd_vma memaddr, disassemble_info *info)
|
|||
int status;
|
||||
size_t command_length;
|
||||
static int initialized;
|
||||
bfd_vma stop_vma;
|
||||
|
||||
/* This lets me stupidly shut Bug #88528 up for now . . . */
|
||||
if (! initialized
|
||||
|
@ -2294,14 +2415,27 @@ print_insn_e2k (bfd_vma memaddr, disassemble_info *info)
|
|||
initialized = 1;
|
||||
}
|
||||
|
||||
/* disassemble_bytes () sets `info->stop_vma' to zero rather than to a
|
||||
meaningful value when disassembling non-code sections or when
|
||||
`--disassemble-all (-D)' is in effect. Just ensure that we don't
|
||||
cross the disassembled section's boundary in such a case. The
|
||||
meaningful `info->stop_vma' is likely to take into account the
|
||||
address of the nearest symbol assumed to lie on the boundary between
|
||||
instructions. */
|
||||
if (info->stop_vma == 0 && info->section != NULL)
|
||||
stop_vma = info->section->vma + info->section->size;
|
||||
else
|
||||
stop_vma = info->stop_vma;
|
||||
|
||||
/* Don't even try to disassemble if the available address range doesn't fit
|
||||
the most short possible instruction or is not properly aligned. */
|
||||
if (info->stop_vma - memaddr < 8
|
||||
if ((stop_vma != 0
|
||||
&& stop_vma < memaddr + 8)
|
||||
|| (memaddr & 0x7) != 0)
|
||||
{
|
||||
/* Skip remaining bytes. Hopefully, we'll resume disassembly starting
|
||||
from a more meaningful symbol. */
|
||||
command_length = info->stop_vma - memaddr;
|
||||
command_length = stop_vma - memaddr;
|
||||
info->bytes_per_line = command_length;
|
||||
return command_length;
|
||||
}
|
||||
|
@ -2330,7 +2464,8 @@ print_insn_e2k (bfd_vma memaddr, disassemble_info *info)
|
|||
|
||||
if (/* Is there enough space in the available address range to hold a
|
||||
presumable synchronous instruction? */
|
||||
info->stop_vma - memaddr >= command_length
|
||||
(stop_vma == 0
|
||||
|| stop_vma >= memaddr + command_length)
|
||||
/* If so, read its remaining bytes. */
|
||||
&& (*info->read_memory_func) (memaddr + 1, &buffer[1],
|
||||
command_length - 1, info) == 0
|
||||
|
@ -2338,11 +2473,12 @@ print_insn_e2k (bfd_vma memaddr, disassemble_info *info)
|
|||
synchronous instruction. */
|
||||
&& unpack_instr (buffer))
|
||||
print_instr (info, memaddr);
|
||||
else if (info->stop_vma - memaddr < 16)
|
||||
else if (stop_vma != 0
|
||||
&& stop_vma < memaddr + 16)
|
||||
{
|
||||
/* There's no point in trying to interpret this bogus sequence of bytes
|
||||
as an APB instruction if it's not sufficiently long. */
|
||||
command_length = info->stop_vma - memaddr;
|
||||
command_length = stop_vma - memaddr;
|
||||
info->bytes_per_line = command_length;
|
||||
return command_length;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
#include "libiberty.h"
|
||||
#include "opcode/e2k.h"
|
||||
|
||||
int mcpu;
|
||||
/* Imply `-mcpu=elbrus-v2' by default now that support for `-mcpu={generic,
|
||||
elbrus-v1}' is to be removed from `e2k-linux-as' (see Bug #96498,
|
||||
Comment #11). */
|
||||
int mcpu = 2;
|
||||
|
||||
#define MAX_E2K_NUM_OPCODES 16384
|
||||
struct e2k_opcode_templ *e2k_opcode_templs[MAX_E2K_NUM_OPCODES];
|
||||
|
@ -192,6 +195,11 @@ init_opcode_templs ()
|
|||
|
||||
COPF4_VEC_ENTRY (flushr);
|
||||
COPF4_VEC_ENTRY (flushc);
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
COPF4_VEC_ENTRY (fillr);
|
||||
COPF4_VEC_ENTRY (fillc);
|
||||
}
|
||||
|
||||
SETCMD_VEC_ENTRY (setbn, 0);
|
||||
SETCMD_VEC_ENTRY (setbp, 1);
|
||||
|
@ -208,7 +216,10 @@ init_opcode_templs ()
|
|||
E2K_OPCODE_VEC_ENTRY (call, parse_ct_args);
|
||||
|
||||
if (mcpu >= 6)
|
||||
E2K_OPCODE_VEC_ENTRY (hcall, parse_hcall_args);
|
||||
{
|
||||
E2K_OPCODE_VEC_ENTRY (hcall, parse_hicall_args);
|
||||
E2K_OPCODE_VEC_ENTRY (icall, parse_hicall_args);
|
||||
}
|
||||
|
||||
E2K_OPCODE_VEC_ENTRY (ipd, parse_ipd_args);
|
||||
|
||||
|
@ -217,6 +228,15 @@ init_opcode_templs ()
|
|||
E2K_OPCODE_VEC_ENTRY (abn, parse_abn_args);
|
||||
E2K_OPCODE_VEC_ENTRY (abp, parse_abp_args);
|
||||
E2K_OPCODE_VEC_ENTRY (abg, parse_abg_args);
|
||||
|
||||
E2K_OPCODE_VEC_ENTRY (srp, parse_srp_args);
|
||||
|
||||
if (mcpu >= 2)
|
||||
E2K_OPCODE_VEC_ENTRY (crp, parse_crp_args);
|
||||
|
||||
if (mcpu >= 3)
|
||||
E2K_OPCODE_VEC_ENTRY (slrp, parse_slrp_args);
|
||||
|
||||
E2K_OPCODE_VEC_ENTRY (bap, parse_bap_args);
|
||||
E2K_OPCODE_VEC_ENTRY (eap, parse_eap_args);
|
||||
|
||||
|
@ -226,12 +246,13 @@ init_opcode_templs ()
|
|||
|
||||
E2K_OPCODE_VEC_ENTRY (ibranch, parse_ibranch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (rbranch, parse_ibranch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (done, parse_done_hret_glaunch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (done, parse_done_hiret_glaunch_args);
|
||||
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
E2K_OPCODE_VEC_ENTRY (hret, parse_done_hret_glaunch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (glaunch, parse_done_hret_glaunch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (iret, parse_done_hiret_glaunch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (hret, parse_done_hiret_glaunch_args);
|
||||
E2K_OPCODE_VEC_ENTRY (glaunch, parse_done_hiret_glaunch_args);
|
||||
}
|
||||
|
||||
E2K_OPCODE_VEC_ENTRY (wait, parse_wait_args);
|
||||
|
|
|
@ -1363,6 +1363,31 @@
|
|||
{"aaurwq", parse_alf_args, NULL, AAURW, NO_MAS, 0x3f, {0, 0, 1, 0, 0, 1}, ARGS_Q};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"ldaab", parse_alf_args, NULL, ALOPF19, MAS, 0x5c, {0, 0, 1, 0, 0, 1}, ARGS_S};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"ldaah", parse_alf_args, NULL, ALOPF19, MAS, 0x5d, {0, 0, 1, 0, 0, 1}, ARGS_S};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"ldaaw", parse_alf_args, NULL, ALOPF19, MAS, 0x5e, {0, 0, 1, 0, 0, 1}, ARGS_S};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"ldaad", parse_alf_args, NULL, ALOPF19, MAS, 0x5f, {0, 0, 1, 0, 0, 1}, ARGS_D};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"ldaaq", parse_alf_args, NULL, ALOPF19, MAS, 0x7f, {0, 0, 1, 0, 0, 1}, ARGS_Q};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"aaurr", parse_alf_args, NULL, AAURR, NO_MAS, 0x5e, {0, 0, 1, 0, 0, 1}, ARGS_S};
|
||||
|
@ -1425,172 +1450,172 @@
|
|||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x8, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x8, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x9, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x9, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xe, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xe, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddd", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xf, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddd", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xf, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddsb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xa, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddsb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xa, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xb, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xb, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddusb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xc, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddusb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xc, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"paddush", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xd, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"paddush", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0xd, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x10, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x10, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x11, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x11, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x16, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x16, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubd", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x17, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubd", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x17, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubsb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x12, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubsb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x12, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x13, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x13, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubusb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x14, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubusb", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x14, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psubush", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x15, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"psubush", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x15, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmaxsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x3, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"pmaxsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x3, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmaxub", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x2, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"pmaxub", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x2, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pminsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"pminsh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pminub", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x0, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
{"pminub", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x0, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT, 0, 0, EXT, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psadbw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1c, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psadbw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1c, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmulhuh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1b, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"pmulhuh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1b, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmulhh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x18, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"pmulhh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x18, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmullh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x19, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"pmullh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x19, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmaddh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1a, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"pmaddh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x1a, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pslld", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x4e, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"pslld", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x4e, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psllw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x14, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psllw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x14, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psllh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x15, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psllh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x15, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrld", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x4c, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psrld", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x4c, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrlw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x10, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psrlw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x10, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrlh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x11, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psrlh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x11, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psraw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x12, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psraw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x12, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrah", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x13, {0, 1, 0, 0, 1, 0}, ARGS_SSS, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
{"psrah", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x13, {0, 1, 0, 0, 1, 0}, ARGS_DDD, NONE, {0, EXT, 0, 0, EXT, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pfadds", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x30, {1, 1, 0, 1, 1, 0}, ARGS_SSS, NONE, {EXT, EXT, 0, EXT, EXT, 0}, 1};
|
||||
{"pfadds", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x30, {1, 1, 0, 1, 1, 0}, ARGS_DDD, NONE, {EXT, EXT, 0, EXT, EXT, 0}, 1};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
|
@ -1600,7 +1625,7 @@
|
|||
}
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pfsubs", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x32, {1, 1, 0, 1, 1, 0}, ARGS_SSS, NONE, {EXT, EXT, 0, EXT, EXT, 0}, 1};
|
||||
{"pfsubs", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x32, {1, 1, 0, 1, 1, 0}, ARGS_DDD, NONE, {EXT, EXT, 0, EXT, EXT, 0}, 1};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
{
|
||||
|
@ -3102,37 +3127,37 @@ if (mcpu == 2)
|
|||
if (mcpu >= 3)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psllw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x14, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
{"psllw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x14, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 3)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psllh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x15, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
{"psllh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x15, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 3)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrlw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x10, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
{"psrlw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x10, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 3)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrlh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x11, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
{"psrlh", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x11, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 3)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psraw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x12, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
{"psraw", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x12, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 3)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"psrah", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x13, {1, 0, 0, 1, 0, 0}, ARGS_SSS, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
{"psrah", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x13, {1, 0, 0, 1, 0, 0}, ARGS_DDD, NONE, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 3)
|
||||
|
@ -3438,7 +3463,7 @@ if (mcpu >= 4)
|
|||
if (mcpu >= 4)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pfadds", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x30, {0, 0, 1, 0, 0, 1}, ARGS_SSS, NONE, {0, 0, EXT, 0, 0, EXT}, 1};
|
||||
{"pfadds", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x30, {0, 0, 1, 0, 0, 1}, ARGS_DDD, NONE, {0, 0, EXT, 0, 0, EXT}, 1};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 4)
|
||||
|
@ -3450,7 +3475,7 @@ if (mcpu >= 4)
|
|||
if (mcpu >= 4)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pfsubs", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x32, {0, 0, 1, 0, 0, 1}, ARGS_SSS, NONE, {0, 0, EXT, 0, 0, EXT}, 1};
|
||||
{"pfsubs", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x32, {0, 0, 1, 0, 0, 1}, ARGS_DDD, NONE, {0, 0, EXT, 0, 0, EXT}, 1};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 4)
|
||||
|
@ -3538,6 +3563,12 @@ if (mcpu >= 5)
|
|||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 5)
|
||||
{
|
||||
static e2k_alf9_opcode_templ dummy =
|
||||
{"ldaaqp", parse_alf_args, NULL, ALOPF19, MAS, 0x60, {0, 0, 1, 0, 0, 1}, ARGS_P};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 5)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"qpand", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x8, {1, 1, 0, 1, 1, 0}, ARGS_PPP, NONE, {EXT1, EXT1, 0, EXT1, EXT1, 0}, 0};
|
||||
|
@ -4762,6 +4793,12 @@ if (mcpu >= 6)
|
|||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"qpsrad", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x25, {1, 1, 0, 1, 1, 0}, ARGS_PDP, NONE, {EXT1, EXT1, 0, EXT1, EXT1, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"pmrgp", parse_alf_args, merge_alopf11, ALOPF11_MERGE, NO_MAS, 0x40, {1, 1, 0, 1, 1, 0}, ARGS_DDD, NONE, {EXT, EXT, 0, EXT, EXT, 0}, 0};
|
||||
|
@ -4786,6 +4823,24 @@ if (mcpu >= 6)
|
|||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"qpchecks", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x33, {1, 0, 0, 1, 0, 0}, ARGS_SSS, QPCHECKS, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"qpcheckd", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x33, {1, 0, 0, 1, 0, 0}, ARGS_DDD, QPCHECKD, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
static e2k_alopf11_opcode_templ dummy =
|
||||
{"qpcheckq", parse_alf_args, merge_alopf11, ALOPF11, NO_MAS, 0x33, {1, 0, 0, 1, 0, 0}, ARGS_PPP, QPCHECKQ, {EXT1, 0, 0, EXT1, 0, 0}, 0};
|
||||
add_to_insn_table ((e2k_opcode_templ *) &dummy);
|
||||
}
|
||||
if (mcpu >= 6)
|
||||
{
|
||||
static e2k_alopf12_opcode_templ dummy =
|
||||
{"ibranchd", parse_alf_args, NULL, ALOPF12_IBRANCHD, NO_MAS, 0x53, {1, 0, 0, 0, 0, 0}, ARGS_DD, NONE, NONE, EXT};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue