Assorted code cleanup and fixes for hppa. Re-enable elf32-hppa as

it now compiles even if it doesn't work too well.
This commit is contained in:
Alan Modra 2000-05-02 00:12:52 +00:00
parent ec1428fa1c
commit 3f9b03b5da
21 changed files with 1484 additions and 1344 deletions

View File

@ -1,3 +1,81 @@
2000-05-02 Alan Modra <alan@linuxcare.com.au>
* config.bfd: Re-enable elf32-hppa. It now compiles, even if it
doesn't work very well.
* elf-hppa.h (elf_hppa_internal_shdr): Define.
(elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr.
Set hdr->s_type to 1 if ARCH_SIZE == 32.
(_bfd_elf_hppa_gen_reloc_type): Add prototype.
(elf_hppa_info_to_howto): Likewise.
(elf_hppa_info_to_howto_rel): Likewise.
(elf_hppa_reloc_type_lookup): Likewise.
(elf_hppa_is_local_label_name): Likewise.
(elf_hppa_fake_sections): Likewise.
(elf_hppa_final_write_processing): Likewise.
(elf_hppa_howto_table): Fully initialise all entries.
(_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args.
(elf_hppa_info_to_howto): Likewise.
(elf_hppa_info_to_howto_rel): Likewise.
(elf_hppa_reloc_type_lookup): Likewise.
(elf_hppa_final_write_processing, elf_hppa_add_symbol_hook,
elf_hppa_unmark_useless_dynamic_symbols,
elf_hppa_remark_useless_dynamic_symbols,
elf_hppa_record_segment_addrs, elf_hppa_final_link,
elf_hppa_relocate_section, elf_hppa_final_link_relocate,
elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until
elf32-hppa.c mess is cleaned up.
(elf_hppa_final_link_relocate): Make insn and r_type unsigned
int. Delete r_field. In case R_PARISC_PCREL21L, don't set
r_field then call hppa_field_adjust inline func with variable
r_field arg, instead call hppa_field_adjust with fixed arg.
In case R_PARISC_PCREL22F, don't set r_field.
(elf_hppa_relocate_insn): Change args and return type to unsigned
int. Call re_assemble_* funcs to do the work.
* elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when
sign extending.
* libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign
extending.
(sign_extend): Mask first before sign extending.
(low_sign_extend): Rewrite without condition expression.
(ones, dis_assemble_3, dis_assemble_12, dis_assemble_16,
dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete.
(assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a,
assemble_17, assemble_21, sign_unext, low_sign_unext): Return
result as function return value rather than through pointer arg.
Accept unsigned int args, and return unsigned int.
(re_assemble_3): New. Combines function of dis_assemble_3 with
re-assembly of opcode and immediate.
(re_assemble_12): Likewise.
(re_assemble_16): Likewise.
(re_assemble_17): Likewise.
(re_assemble_21): Likewise.
(re_assemble_22): Likewise.
(hppa_field_adjust): Rewrite and document, paying attention to
size of types and signed/unsigned issues.
(get_opcode): Shift before masking.
(FDLW): Rename to FLDW.
(bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt.
(hppa_rebuild_insn): Change args and return value to unsigned
int. Make use of re_assemble_*. Correct case 11.
* dep-in.sed: Handle ../opcodes/.
* Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h,
elf64-hppa.h, hppa_stubs.h, xcoff.h.
(BFD32_BACKENDS_CFILES): Restore elf32-hppa.c.
Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo,
elfarm-nabi.lo dependencies outside of auto-dependency area.
Regenerate dependencies.
* Makefile.in: Regenerate.
* configure.in (TRAD_HEADER): Test non-null before
AC_DEFINE_UNQUOTED.
* configure: Regenerate.
* reloc.c: Fix mis-spelling in comment.
2000-05-01 Alan Modra <alan@linuxcare.com.au> 2000-05-01 Alan Modra <alan@linuxcare.com.au>
* coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change. * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change.

View File

@ -303,6 +303,7 @@ BFD32_BACKENDS_CFILES = \
elf32-d30v.c \ elf32-d30v.c \
elf32-fr30.c \ elf32-fr30.c \
elf32-gen.c \ elf32-gen.c \
elf32-hppa.c \
elf32-i370.c \ elf32-i370.c \
elf32-i386.c \ elf32-i386.c \
elf32-i860.c \ elf32-i860.c \
@ -455,12 +456,12 @@ CFILES = \
## This is a list of all .h files which are in the source tree. ## This is a list of all .h files which are in the source tree.
SOURCE_HFILES = \ SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \ aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
ecoffswap.h elf32-arm.h elfcode.h elfcore.h \ elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \
elflink.h freebsd.h genlink.h go32stub.h libaout.h \ elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \ hppa_stubs.h libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \ libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
nlmswap.h ns32k.h peicode.h som.h vms.h nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff.h
HFILES = \ HFILES = \
elf32-target.h elf64-target.h targmatch.h \ elf32-target.h elf64-target.h targmatch.h \
@ -662,23 +663,6 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
elf64-hppa.lo: elf64-hppa.c elf64-hppa.h elf-bfd.h \
$(INCDIR)/elf/hppa.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
cpu-ia64.lo: cpu-ia64.c cpu-ia64-opc.c $(srcdir)/../opcodes/ia64-opc.h
elf64-ia64.lo: elf64-ia64.c elf-bfd.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
# What appears below is generated by a hacked mkdep using gcc -MM. # What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT DELETE THIS LINE -- mkdep uses it.
@ -722,6 +706,8 @@ cpu-fr30.lo: cpu-fr30.c
cpu-h8300.lo: cpu-h8300.c cpu-h8300.lo: cpu-h8300.c
cpu-h8500.lo: cpu-h8500.c cpu-h8500.lo: cpu-h8500.c
cpu-hppa.lo: cpu-hppa.c cpu-hppa.lo: cpu-hppa.c
cpu-ia64.lo: cpu-ia64.c cpu-ia64-opc.c $(srcdir)/../opcodes/ia64-opc.h \
$(INCDIR)/opcode/ia64.h
cpu-i370.lo: cpu-i370.c cpu-i370.lo: cpu-i370.c
cpu-i386.lo: cpu-i386.c cpu-i386.lo: cpu-i386.c
cpu-i860.lo: cpu-i860.c cpu-i860.lo: cpu-i860.c
@ -814,16 +800,12 @@ coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \ $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
ecoffswap.h ecoffswap.h
coff-pmac.lo: coff-pmac.c coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \ coff-pmac.lo: coff-pmac.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h xcoff.h coffcode.h coffswap.h
coff-rs6000.lo: coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \ coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h xcoff.h coffcode.h coffswap.h
coff64-rs6000.lo: coff64-rs6000.c coff-rs6000.c xcoff.h \
$(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \ coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \
@ -898,6 +880,10 @@ elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \
elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h elf32-target.h
elf32-hppa.lo: elf32-hppa.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \
elf32-hppa.h elf-hppa.h hppa_stubs.h elf32-target.h
elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \ elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/elf/i370.h elf32-target.h $(INCDIR)/elf/i370.h elf32-target.h
@ -1117,7 +1103,11 @@ coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \
libecoff.h coffswap.h ecoffswap.h libecoff.h coffswap.h ecoffswap.h
coff-ia64.lo: coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ coff-ia64.lo: coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
coffswap.h
coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6k64.h libcoff.h $(INCDIR)/bfdlink.h \
xcoff.h coffcode.h coffswap.h
demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \ demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \
libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
@ -1128,6 +1118,14 @@ elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
libcoff.h libecoff.h ecoffswap.h elf64-target.h libcoff.h libecoff.h ecoffswap.h elf64-target.h
elf64-hppa.lo: elf64-hppa.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \
elf64-hppa.h elf-hppa.h elf64-target.h
elf64-ia64.lo: elf64-ia64.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf64-target.h elf64-target.h

View File

@ -421,6 +421,7 @@ BFD32_BACKENDS_CFILES = \
elf32-d30v.c \ elf32-d30v.c \
elf32-fr30.c \ elf32-fr30.c \
elf32-gen.c \ elf32-gen.c \
elf32-hppa.c \
elf32-i370.c \ elf32-i370.c \
elf32-i386.c \ elf32-i386.c \
elf32-i860.c \ elf32-i860.c \
@ -578,12 +579,12 @@ CFILES = \
SOURCE_HFILES = \ SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \ aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
ecoffswap.h elf32-arm.h elfcode.h elfcore.h \ elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \
elflink.h freebsd.h genlink.h go32stub.h libaout.h \ elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \ hppa_stubs.h libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \ libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
nlmswap.h ns32k.h peicode.h som.h vms.h nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff.h
HFILES = \ HFILES = \
@ -1190,23 +1191,6 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
elf64-hppa.lo: elf64-hppa.c elf64-hppa.h elf-bfd.h \
$(INCDIR)/elf/hppa.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
cpu-ia64.lo: cpu-ia64.c cpu-ia64-opc.c $(srcdir)/../opcodes/ia64-opc.h
elf64-ia64.lo: elf64-ia64.c elf-bfd.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
# What appears below is generated by a hacked mkdep using gcc -MM. # What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT DELETE THIS LINE -- mkdep uses it.
@ -1250,6 +1234,8 @@ cpu-fr30.lo: cpu-fr30.c
cpu-h8300.lo: cpu-h8300.c cpu-h8300.lo: cpu-h8300.c
cpu-h8500.lo: cpu-h8500.c cpu-h8500.lo: cpu-h8500.c
cpu-hppa.lo: cpu-hppa.c cpu-hppa.lo: cpu-hppa.c
cpu-ia64.lo: cpu-ia64.c cpu-ia64-opc.c $(srcdir)/../opcodes/ia64-opc.h \
$(INCDIR)/opcode/ia64.h
cpu-i370.lo: cpu-i370.c cpu-i370.lo: cpu-i370.c
cpu-i386.lo: cpu-i386.c cpu-i386.lo: cpu-i386.c
cpu-i860.lo: cpu-i860.c cpu-i860.lo: cpu-i860.c
@ -1342,16 +1328,12 @@ coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \ $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
ecoffswap.h ecoffswap.h
coff-pmac.lo: coff-pmac.c coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \ coff-pmac.lo: coff-pmac.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h xcoff.h coffcode.h coffswap.h
coff-rs6000.lo: coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \ coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h xcoff.h coffcode.h coffswap.h
coff64-rs6000.lo: coff64-rs6000.c coff-rs6000.c xcoff.h \
$(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \ coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \
@ -1426,6 +1408,10 @@ elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \
elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h elf32-target.h
elf32-hppa.lo: elf32-hppa.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \
elf32-hppa.h elf-hppa.h hppa_stubs.h elf32-target.h
elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \ elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/elf/i370.h elf32-target.h $(INCDIR)/elf/i370.h elf32-target.h
@ -1645,7 +1631,11 @@ coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \
libecoff.h coffswap.h ecoffswap.h libecoff.h coffswap.h ecoffswap.h
coff-ia64.lo: coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ coff-ia64.lo: coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
coffswap.h
coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6k64.h libcoff.h $(INCDIR)/bfdlink.h \
xcoff.h coffcode.h coffswap.h
demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \ demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \
libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
@ -1656,6 +1646,14 @@ elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
libcoff.h libecoff.h ecoffswap.h elf64-target.h libcoff.h libecoff.h ecoffswap.h elf64-target.h
elf64-hppa.lo: elf64-hppa.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \
elf64-hppa.h elf-hppa.h elf64-target.h
elf64-ia64.lo: elf64-ia64.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf64-target.h elf64-target.h

View File

@ -224,11 +224,9 @@ case "${targ}" in
targ_underscore=yes targ_underscore=yes
;; ;;
#if 0 /* HPPA ELF does not work currently. */
hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*) hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
targ_defvec=bfd_elf32_hppa_vec targ_defvec=bfd_elf32_hppa_vec
;; ;;
#endif
#if 0 #if 0
#ifdef BFD64 #ifdef BFD64
# Do not enable this until we've settled the configury issues # Do not enable this until we've settled the configury issues
@ -242,18 +240,14 @@ case "${targ}" in
#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX) #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX)
hppa*-*-bsd*) hppa*-*-bsd*)
targ_defvec=som_vec targ_defvec=som_vec
#if 0 /* HPPA ELF does not work currently. */
targ_selvecs=bfd_elf32_hppa_vec targ_selvecs=bfd_elf32_hppa_vec
#endif
;; ;;
hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*) hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*)
targ_defvec=som_vec targ_defvec=som_vec
;; ;;
hppa*-*-osf*) hppa*-*-osf*)
targ_defvec=som_vec targ_defvec=som_vec
#if 0 /* HPPA ELF does not work currently. */
targ_selvecs=bfd_elf32_hppa_vec targ_selvecs=bfd_elf32_hppa_vec
#endif
;; ;;
#endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */ #endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */

475
bfd/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -351,8 +351,10 @@ changequote([,])dnl
fi fi
AC_SUBST(COREFILE) AC_SUBST(COREFILE)
AC_SUBST(COREFLAG) AC_SUBST(COREFLAG)
AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, if test -n "$TRAD_HEADER"; then
[Name of host specific header file to include in trad-core.c.]) AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
[Name of host specific header file to include in trad-core.c.])
fi
# Horrible hacks to build DLLs on Windows. # Horrible hacks to build DLLs on Windows.
WIN32LDFLAGS= WIN32LDFLAGS=

View File

@ -6,6 +6,7 @@ t loop
s!\.o:!.lo:! s!\.o:!.lo:!
s! @BFD_H@!!g s! @BFD_H@!!g
s!@INCDIR@!$(INCDIR)!g s!@INCDIR@!$(INCDIR)!g
s!@SRCDIR@/../opcodes!$(srcdir)/../opcodes!g
s!@SRCDIR@/!!g s!@SRCDIR@/!!g
s! hosts/[^ ]*\.h! !g s! hosts/[^ ]*\.h! !g
s/ sysdep.h//g s/ sysdep.h//g

File diff suppressed because it is too large Load Diff

View File

@ -311,17 +311,17 @@ hppa_elf_relocate_insn (abfd, input_sect, insn, address, sym_value,
case BL: case BL:
case BE: case BE:
case BLE: case BLE:
/* XXX computing constant_value is not needed??? */ /* XXX r_addend ignored ???. */
constant_value = assemble_17 ((insn & 0x001f0000) >> 16, constant_value = assemble_17 ((insn & 0x001f0000) >> 16,
(insn & 0x00001ffc) >> 2, (insn & 0x00001ffc) >> 2,
insn & 1); insn & 1);
constant_value = (constant_value << 15) >> 15; constant_value = (constant_value << (BFD_ARCH_SIZE-17))
>> (BFD_ARCH_SIZE-17);
if (pcrel) if (pcrel)
{ {
sym_value -= sym_value -= (address + input_sect->output_offset
address + input_sect->output_offset + input_sect->output_section->vma);
+ input_sect->output_section->vma;
sym_value = hppa_field_adjust (sym_value, -8, r_field); sym_value = hppa_field_adjust (sym_value, -8, r_field);
} }
else else

View File

@ -35,53 +35,6 @@
#endif /* GNU C? */ #endif /* GNU C? */
#endif /* INLINE */ #endif /* INLINE */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
/* Declare the functions with the unused attribute to avoid warnings. */
static INLINE unsigned int assemble_3 (unsigned int)
__attribute__ ((__unused__));
static INLINE void dis_assemble_3 (unsigned int, unsigned int *)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_12 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE void dis_assemble_12 (unsigned int, unsigned int *,
unsigned int *)
__attribute__ ((__unused__));
static INLINE void dis_assemble_16 (unsigned int, unsigned int *, int)
__attribute__ ((__unused__));
static INLINE unsigned long assemble_17 (unsigned int, unsigned int,
unsigned int)
__attribute__ ((__unused__));
static INLINE void dis_assemble_17 (unsigned int, unsigned int *,
unsigned int *, unsigned int *)
__attribute__ ((__unused__));
static INLINE void dis_assemble_22 (unsigned int, unsigned int *,
unsigned int *, unsigned int *,
unsigned int *)
__attribute__ ((__unused__));
static INLINE unsigned long assemble_21 (unsigned int)
__attribute ((__unused__));
static INLINE void dis_assemble_21 (unsigned int, unsigned int *)
__attribute__ ((__unused__));
static INLINE unsigned long sign_extend (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int ones (int) __attribute ((__unused__));
static INLINE void sign_unext (unsigned int, unsigned int, unsigned int *)
__attribute__ ((__unused__));
static INLINE unsigned long low_sign_extend (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE void low_sign_unext (unsigned int, unsigned int, unsigned int *)
__attribute__ ((__unused__));
static INLINE unsigned long hppa_field_adjust (unsigned long, unsigned long,
unsigned short)
__attribute__ ((__unused__));
static INLINE int bfd_hppa_insn2fmt (unsigned long)
__attribute__ ((__unused__));
static INLINE unsigned long hppa_rebuild_insn (bfd *, unsigned long,
unsigned long, unsigned long)
__attribute__ ((__unused__));
#endif /* gcc 2.7 or higher */
/* The PA instruction set variants. */ /* The PA instruction set variants. */
enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25}; enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25};
@ -199,10 +152,13 @@ enum hppa_reloc_expr_type_alt
The high order 10 bits contain parameter relocation information, The high order 10 bits contain parameter relocation information,
the low order 22 bits contain the constant offset. */ the low order 22 bits contain the constant offset. */
#define HPPA_R_ARG_RELOC(a) (((a) >> 22) & 0x3FF) #define HPPA_R_ARG_RELOC(a) \
#define HPPA_R_CONSTANT(a) ((((int)(a)) << 10) >> 10) (((a) >> 22) & 0x3ff)
#define HPPA_R_ADDEND(r,c) (((r) << 22) + ((c) & 0x3FFFFF)) #define HPPA_R_CONSTANT(a) \
((((int)(a)) << (BFD_ARCH_SIZE-22)) >> (BFD_ARCH_SIZE-22))
#define HPPA_R_ADDEND(r, c) \
(((r) << 22) + ((c) & 0x3fffff))
#define HPPA_WIDE (0) /* PSW W-bit, need to check! FIXME */ #define HPPA_WIDE (0) /* PSW W-bit, need to check! FIXME */
/* These macros get bit fields using HP's numbering (MSB = 0), /* These macros get bit fields using HP's numbering (MSB = 0),
@ -212,32 +168,96 @@ enum hppa_reloc_expr_type_alt
#ifndef GET_FIELD #ifndef GET_FIELD
#define GET_FIELD(X, FROM, TO) \ #define GET_FIELD(X, FROM, TO) \
((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1)) ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
#endif #endif
#define GET_BIT(X, WHICH) \ #define GET_BIT(X, WHICH) \
GET_FIELD (X, WHICH, WHICH) GET_FIELD (X, WHICH, WHICH)
#define MASK(SIZE) \ #define MASK(SIZE) \
(~((-1) << SIZE)) (~((-1) << SIZE))
#define CATENATE(X, XSIZE, Y, YSIZE) \ #define CATENATE(X, XSIZE, Y, YSIZE) \
(((X & MASK (XSIZE)) << YSIZE) | (Y & MASK (YSIZE))) (((X & MASK (XSIZE)) << YSIZE) | (Y & MASK (YSIZE)))
#define ELEVEN(X) \ #define ELEVEN(X) \
CATENATE (GET_BIT (X, 10), 1, GET_FIELD (X, 0, 9), 10) CATENATE (GET_BIT (X, 10), 1, GET_FIELD (X, 0, 9), 10)
/* Some functions to manipulate PA instructions. */ /* Some functions to manipulate PA instructions. */
/* NOTE: these use the HP convention that f{1} is the _left_ most /* NOTE: these use the HP convention that f{0} is the _left_ most
* bit (MSB) of f; they sometimes have to impose an assumption * bit (MSB) of f; they sometimes have to impose an assumption
* about the size of a field; and as far as I can tell, most * about the size of a field; and as far as I can tell, most
* aren't used. * aren't used.
*/ */
static INLINE unsigned long #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
/* Declare the functions with the unused attribute to avoid warnings. */
static INLINE unsigned int sign_extend (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int low_sign_extend (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_3 (unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_6 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_12 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_16 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_16a (unsigned int, unsigned int,
unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_17 (unsigned int, unsigned int,
unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int assemble_21 (unsigned int)
__attribute ((__unused__));
static INLINE unsigned int sign_unext (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int low_sign_unext (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int re_assemble_3 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int re_assemble_12 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int re_assemble_16 (unsigned int, unsigned int, int)
__attribute__ ((__unused__));
static INLINE unsigned int re_assemble_17 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int re_assemble_22 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int re_assemble_21 (unsigned int, unsigned int)
__attribute__ ((__unused__));
static INLINE bfd_signed_vma hppa_field_adjust (bfd_signed_vma, bfd_signed_vma,
enum hppa_reloc_field_selector_type_alt)
__attribute__ ((__unused__));
static INLINE int bfd_hppa_insn2fmt (unsigned int)
__attribute__ ((__unused__));
static INLINE unsigned int hppa_rebuild_insn (bfd *, unsigned int,
unsigned int, unsigned int)
__attribute__ ((__unused__));
#endif /* gcc 2.7 or higher */
/* The *sign_extend and assemble_* functions are used to assemble
various bitfields taken from an instruction and return the
resulting immediate value. They correspond to functions by the
same name in HP's PA-RISC 2.0 Architecture Reference Manual. */
static INLINE unsigned int
sign_extend (x, len) sign_extend (x, len)
unsigned int x, len; unsigned int x, len;
{ {
return (int)(x >> (len - 1) ? (-1 << len) | x : x); unsigned int signbit = (1 << (len - 1));
unsigned int mask = (signbit << 1) - 1;
return ((x & mask) ^ signbit) - signbit;
}
static INLINE unsigned int
low_sign_extend (x, len)
unsigned int x, len;
{
return (x >> 1) - ((x & 1) << (len - 1));
} }
static INLINE unsigned int static INLINE unsigned int
@ -247,19 +267,11 @@ assemble_3 (x)
return CATENATE (GET_BIT (x, 2), 1, GET_FIELD (x, 0, 1), 2); return CATENATE (GET_BIT (x, 2), 1, GET_FIELD (x, 0, 1), 2);
} }
static INLINE void
dis_assemble_3 (x, r)
unsigned int x;
unsigned int *r;
{
*r = (((x & 4) >> 2) | ((x & 3) << 1)) & 7;
}
static INLINE unsigned int static INLINE unsigned int
assemble_6 (x, y) assemble_6 (x, y)
unsigned int x, y; unsigned int x, y;
{ {
return (((x & 0x1) << 5) + (32 - (y & 0x1f))); return (((x & 1) << 5) + (32 - (y & 0x1f)));
} }
static INLINE unsigned int static INLINE unsigned int
@ -270,40 +282,7 @@ assemble_12 (x, y)
GET_FIELD (x, 0, 9), 9); GET_FIELD (x, 0, 9), 9);
} }
static INLINE void static INLINE unsigned int
dis_assemble_12 (as12, x, y)
unsigned int as12;
unsigned int *x, *y;
{
*y = (as12 & 0x800) >> 11;
*x = ((as12 & 0x3ff) << 1) | ((as12 & 0x400) >> 10);
}
static INLINE void
dis_assemble_16 (as16, x, wide)
unsigned int as16;
unsigned int *x;
int wide;
{
unsigned int t1, t2;
if (wide)
{
/* Unusual 16-bit encoding. */
t1 = (as16 << 1) & 0xffff;
t2 = (as16 & 0x8000);
*x = t1 ^ t2 ^ (t2 >> 1) | (t2 >> 15);
}
else
{
/* Standard 14-bit encoding. */
t1 = (as16 << 1) & 0x3fff;
t2 = (as16 & 0x2000);
*x = t1 | (t2 >> 13);
}
}
static INLINE unsigned long
assemble_16 (x, y) assemble_16 (x, y)
unsigned int x, y; unsigned int x, y;
{ {
@ -322,8 +301,7 @@ assemble_16 (x, y)
return sign_extend (temp, 16); return sign_extend (temp, 16);
} }
static INLINE unsigned int
static INLINE unsigned long
assemble_16a (x, y, z) assemble_16a (x, y, z)
unsigned int x, y, z; unsigned int x, y, z;
{ {
@ -333,223 +311,252 @@ assemble_16a (x, y, z)
if (HPPA_WIDE) if (HPPA_WIDE)
temp = CATENATE (CATENATE (z, 1, (z ^ GET_BIT (x, 0)), 1), 2, temp = CATENATE (CATENATE (z, 1, (z ^ GET_BIT (x, 0)), 1), 2,
CATENATE ((z ^ GET_BIT (x, 1)), 1, y, 11), 12); CATENATE ((z ^ GET_BIT (x, 1)), 1, y, 11), 12);
else else
temp = CATENATE (CATENATE (z, 1, z, 1), 2, CATENATE (z, 1, y, 11), 12); temp = CATENATE (CATENATE (z, 1, z, 1), 2, CATENATE (z, 1, y, 11), 12);
return sign_extend ((temp << 2), 16); return sign_extend ((temp << 2), 16);
} }
static INLINE unsigned long static INLINE unsigned int
assemble_17 (x, y, z) assemble_17 (x, y, z)
unsigned int x, y, z; unsigned int x, y, z;
{ {
unsigned long temp; unsigned int temp;
temp = CATENATE (CATENATE (z, 1, x, 5), 6, temp = CATENATE (CATENATE (z, 1, x, 5), 6,
CATENATE (GET_BIT (y, 10), 1, GET_FIELD (y, 0, 9), 10), 11); CATENATE (GET_BIT (y, 10), 1, GET_FIELD (y, 0, 9), 10), 11);
return temp; return temp;
} }
static INLINE void static INLINE unsigned int
dis_assemble_17 (as17, x, y, z)
unsigned int as17;
unsigned int *x, *y, *z;
{
*z = (as17 & 0x10000) >> 16;
*x = (as17 & 0x0f800) >> 11;
*y = (((as17 & 0x00400) >> 10) | ((as17 & 0x3ff) << 1)) & 0x7ff;
}
static INLINE void
dis_assemble_22 (as22, a, b, c, d)
unsigned int as22;
unsigned int *a, *b, *c, *d;
{
*d = (as22 & 0x200000) >> 21;
*a = (as22 & 0x1f0000) >> 16;
*b = (as22 & 0x0f800) >> 11;
*c = (((as22 & 0x00400) >> 10) | ((as22 & 0x3ff) << 1)) & 0x7ff;
}
static INLINE unsigned long
assemble_21 (x) assemble_21 (x)
unsigned int x; unsigned int x;
{ {
unsigned long temp; unsigned int temp;
temp = ((x & 1) << 20) | temp = (( (x & 0x000001) << 20)
((x & 0xffe) << 8) | | ((x & 0x000ffe) << 8)
((x & 0xc000) >> 7) | | ((x & 0x003000) >> 12)
((x & 0x1f0000) >> 14) | | ((x & 0x00c000) >> 7)
((x & 0x003000) >> 12); | ((x & 0x1f0000) >> 14));
return temp & 0x1fffff; return temp;
} }
static INLINE unsigned long static INLINE unsigned int
assemble_22 (a,b,c,d) assemble_22 (a,b,c,d)
unsigned int a,b,c,d; unsigned int a,b,c,d;
{ {
unsigned long temp; unsigned int temp;
temp = CATENATE (CATENATE (d, 1, a, 5), 6, temp = CATENATE (CATENATE (d, 1, a, 5), 6,
CATENATE (b, 5, ELEVEN (c), 11), 16); CATENATE (b, 5, ELEVEN (c), 11), 16);
return sign_extend (temp, 22); return sign_extend (temp, 22);
} }
static INLINE void
dis_assemble_21 (as21, x) /* The re_assemble_* functions splice together an opcode and an
unsigned int as21, *x; immediate value. pa-risc uses all sorts of weird bitfields in the
instruction to hold the value. */
static INLINE unsigned int
sign_unext (x, len)
unsigned int x, len;
{ {
unsigned long temp; unsigned int len_ones;
len_ones = ((unsigned int) 1 << len) - 1;
temp = (as21 & 0x100000) >> 20; return x & len_ones;
temp |= (as21 & 0x0ffe00) >> 8;
temp |= (as21 & 0x000180) << 7;
temp |= (as21 & 0x00007c) << 14;
temp |= (as21 & 0x000003) << 12;
*x = temp;
} }
static INLINE unsigned int static INLINE unsigned int
ones (n) low_sign_unext (x, len)
int n;
{
unsigned int len_ones;
int i;
i = 0;
len_ones = 0;
while (i < n)
{
len_ones = (len_ones << 1) | 1;
i++;
}
return len_ones;
}
static INLINE void
sign_unext (x, len, result)
unsigned int x, len; unsigned int x, len;
unsigned int *result;
{
unsigned int len_ones;
len_ones = ones (len);
*result = x & len_ones;
}
static INLINE unsigned long
low_sign_extend (x, len)
unsigned int x, len;
{
return (int)((x & 0x1 ? (-1 << (len - 1)) : 0) | x >> 1);
}
static INLINE void
low_sign_unext (x, len, result)
unsigned int x, len;
unsigned int *result;
{ {
unsigned int temp; unsigned int temp;
unsigned int sign; unsigned int sign;
unsigned int rest;
unsigned int one_bit_at_len;
unsigned int len_ones;
len_ones = ones (len); sign = (x >> (len-1)) & 1;
one_bit_at_len = 1 << (len - 1);
sign_unext (x, len, &temp); temp = sign_unext (x, len-1);
sign = temp & one_bit_at_len;
sign >>= (len - 1);
rest = temp & (len_ones ^ one_bit_at_len); return (temp << 1) | sign;
rest <<= 1;
*result = rest | sign;
} }
/* Handle field selectors for PA instructions. */ static INLINE unsigned int
re_assemble_3 (insn, as3)
static INLINE unsigned long unsigned int insn;
hppa_field_adjust (value, constant_value, r_field) unsigned int as3;
unsigned long value;
unsigned long constant_value;
unsigned short r_field;
{ {
return ((insn & ~ (7 << 13))
| ((as3 & 4) << (13-2))
| ((as3 & 3) << (13+1)));
}
static INLINE unsigned int
re_assemble_12 (insn, as12)
unsigned int insn;
unsigned int as12;
{
return ((insn & ~ 0x1ffd)
| ((as12 & 0x800) >> 11)
| ((as12 & 0x400) >> (10 - 2))
| ((as12 & 0x3ff) << (1 + 2)));
}
static INLINE unsigned int
re_assemble_16 (insn, as16, wide)
unsigned int insn;
unsigned int as16;
int wide;
{
unsigned int s, t;
if (wide)
{
/* Unusual 16-bit encoding. */
t = (as16 << 1) & 0xffff;
s = (as16 & 0x8000);
return (insn & ~ 0xffff) | (t ^ s ^ (s >> 1)) | (s >> 15);
}
else
{
/* Standard 14-bit encoding. */
t = (as16 << 1) & 0x3fff;
s = (as16 & 0x2000);
return (insn & ~ 0xffff) | t | (s >> 13);
}
}
static INLINE unsigned int
re_assemble_17 (insn, as17)
unsigned int insn;
unsigned int as17;
{
return ((insn & ~ 0x1f1ffd)
| ((as17 & 0x10000) >> 16)
| ((as17 & 0x0f800) << (16 - 11))
| ((as17 & 0x00400) >> (10 - 2))
| ((as17 & 0x003ff) << (1 + 2)));
}
static INLINE unsigned int
re_assemble_21 (insn, as21)
unsigned int insn;
unsigned int as21;
{
return ((insn & ~ 0x1fffff)
| ((as21 & 0x100000) >> 20)
| ((as21 & 0x0ffe00) >> 8)
| ((as21 & 0x000180) << 7)
| ((as21 & 0x00007c) << 14)
| ((as21 & 0x000003) << 12));
}
static INLINE unsigned int
re_assemble_22 (insn, as22)
unsigned int insn;
unsigned int as22;
{
return ((insn & ~ 0x3ff1ffd)
| ((as22 & 0x200000) >> 21)
| ((as22 & 0x1f0000) << (21 - 16))
| ((as22 & 0x00f800) << (16 - 11))
| ((as22 & 0x000400) >> (10 - 2))
| ((as22 & 0x0003ff) << (1 + 2)));
}
/* Handle field selectors for PA instructions.
The L and R (and LS, RS etc.) selectors are used in pairs to form a
full 32 bit address. eg.
LDIL L'start,%r1 ; put left part into r1
LDW R'start(%r1),%r2 ; add r1 and right part to form address
This function returns sign extended values in all cases.
*/
static INLINE bfd_signed_vma
hppa_field_adjust (sym_val, addend, r_field)
bfd_signed_vma sym_val;
bfd_signed_vma addend;
enum hppa_reloc_field_selector_type_alt r_field;
{
bfd_signed_vma value;
value = sym_val + addend;
switch (r_field) switch (r_field)
{ {
case e_fsel: /* F : no change */ case e_fsel:
case e_nsel: /* N : no change */ case e_nsel:
value += constant_value; /* F: No change. */
break; break;
case e_lssel: /* LS : if (bit 21) then add 0x800 case e_lsel:
arithmetic shift right 11 bits */ case e_nlsel:
value += constant_value; /* L: Select top 21 bits. */
if (value & 0x00000400) value = value >> 11;
value += 0x800;
value = (value & 0xfffff800) >> 11;
break; break;
case e_rssel: /* RS : Sign extend from bit 21 */ case e_rsel:
value += constant_value; /* R: Select bottom 11 bits. */
if (value & 0x00000400)
value |= 0xfffff800;
else
value &= 0x7ff;
break;
case e_lsel: /* L : Arithmetic shift right 11 bits */
case e_nlsel: /* NL : Arithmetic shift right 11 bits */
value += constant_value;
value = (value & 0xfffff800) >> 11;
break;
case e_rsel: /* R : Set bits 0-20 to zero */
value += constant_value;
value = value & 0x7ff; value = value & 0x7ff;
break; break;
case e_ldsel: /* LD : Add 0x800, arithmetic shift case e_lssel:
right 11 bits */ /* LS: Round to nearest multiple of 2048 then select top 21 bits. */
value += constant_value; value = value + 0x400;
value += 0x800; value = value >> 11;
value = (value & 0xfffff800) >> 11;
break; break;
case e_rdsel: /* RD : Set bits 0-20 to one */ case e_rssel:
value += constant_value; /* RS: Select bottom 11 bits for LS.
value |= 0xfffff800; We need to return a value such that 2048 * LS'x + RS'x == x.
ie. RS'x = x - ((x + 0x400) & -0x800)
this is just a sign extension from bit 21. */
value = ((value & 0x7ff) ^ 0x400) - 0x400;
break; break;
case e_lrsel: /* LR : L with "rounded" constant */ case e_ldsel:
case e_nlrsel: /* NLR : NL with "rounded" constant */ /* LD: Round to next multiple of 2048 then select top 21 bits.
value = value + ((constant_value + 0x1000) & 0xffffe000); Yes, if we are already on a multiple of 2048, we go up to the
value = (value & 0xfffff800) >> 11; next one. RD in this case will be -2048. */
value = value + 0x800;
value = value >> 11;
break; break;
case e_rrsel: /* RR : R with "rounded" constant */ case e_rdsel:
value = value + ((constant_value + 0x1000) & 0xffffe000); /* RD: Set bits 0-20 to one. */
value = (value & 0x7ff) + constant_value - ((constant_value + 0x1000) & 0xffffe000); value = value | -0x800;
break;
case e_lrsel:
case e_nlrsel:
/* LR: L with rounding of the addend to nearest 8k. */
value = sym_val + ((addend + 0x1000) & -0x2000);
value = value >> 11;
break;
case e_rrsel:
/* RR: R with rounding of the addend to nearest 8k.
We need to return a value such that 2048 * LR'x + RR'x == x
ie. RR'x = s+a - (s + (((a + 0x1000) & -0x2000) & -0x800))
. = s+a - ((s & -0x800) + ((a + 0x1000) & -0x2000))
. = (s & 0x7ff) + a - ((a + 0x1000) & -0x2000) */
value = (sym_val & 0x7ff) + (((addend & 0x1fff) ^ 0x1000) - 0x1000);
break; break;
default: default:
abort (); abort ();
} }
return value; return value;
} }
/* PA-RISC OPCODES */ /* PA-RISC OPCODES */
#define get_opcode(insn) ((insn) & 0xfc000000) >> 26 #define get_opcode(insn) (((insn) >> 26) & 0x3f)
/* FIXME: this list is incomplete. It should also be an enumerated /* FIXME: this list is incomplete. It should also be an enumerated
type rather than #defines. */ type rather than #defines. */
@ -597,9 +604,9 @@ hppa_field_adjust (value, constant_value, r_field)
#define STD 0x1c #define STD 0x1c
#define LDWL 0x17 #define LDWL 0x17
#define STWL 0x1f #define STWL 0x1f
#define FDLW 0x16 #define FLDW 0x16
#define FSTW 0x1e #define FSTW 0x1e
/* Given a machine instruction, return its format. /* Given a machine instruction, return its format.
FIXME: opcodes which do not map to a known format FIXME: opcodes which do not map to a known format
@ -607,18 +614,17 @@ hppa_field_adjust (value, constant_value, r_field)
static INLINE int static INLINE int
bfd_hppa_insn2fmt (insn) bfd_hppa_insn2fmt (insn)
unsigned long insn; unsigned int insn;
{ {
int fmt = -1;
unsigned char op = get_opcode (insn); unsigned char op = get_opcode (insn);
switch (op) switch (op)
{ {
case ADDI: case ADDI:
case ADDIT: case ADDIT:
case SUBI: case SUBI:
fmt = 11; return 11;
break;
case MOVB: case MOVB:
case MOVIB: case MOVIB:
case COMBT: case COMBT:
@ -634,8 +640,8 @@ bfd_hppa_insn2fmt (insn)
case CMPBDT: case CMPBDT:
case CMPBDF: case CMPBDF:
case CMPIBD: case CMPIBD:
fmt = 12; return 12;
break;
case LDO: case LDO:
case LDB: case LDB:
case LDH: case LDH:
@ -645,106 +651,57 @@ bfd_hppa_insn2fmt (insn)
case STH: case STH:
case STW: case STW:
case STWM: case STWM:
fmt = 14; return 14;
break;
case LDWL: case LDWL:
case STWL: case STWL:
case FDLW: case FLDW:
case FSTW: case FSTW:
/* This is a hack. Unfortunately, format 11 is already taken /* This is a hack. Unfortunately, format 11 is already taken
and we're using integers rather than an enum, so it's hard and we're using integers rather than an enum, so it's hard
to describe the 10a format. */ to describe the 11a format. */
fmt = -11; return -11;
break;
case LDD: case LDD:
case STD: case STD:
fmt = 10; return 10;
break;
case BL: case BL:
case BE: case BE:
case BLE: case BLE:
if ((insn & 0x00008000) == 0x00008000) if ((insn & 0x00008000) != 0)
return 22; return 22;
fmt = 17; return 17;
break;
case LDIL: case LDIL:
case ADDIL: case ADDIL:
fmt = 21; return 21;
break;
default: default:
fmt = 32;
break; break;
} }
return fmt; return 32;
} }
/* Insert VALUE into INSN using R_FORMAT to determine exactly what /* Insert VALUE into INSN using R_FORMAT to determine exactly what
bits to change. */ bits to change. */
static INLINE unsigned long static INLINE unsigned int
hppa_rebuild_insn (abfd, insn, value, r_format) hppa_rebuild_insn (abfd, insn, value, r_format)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
unsigned long insn; unsigned int insn;
unsigned long value; unsigned int value;
unsigned long r_format; unsigned int r_format;
{ {
unsigned long const_part;
unsigned long rebuilt_part;
switch (r_format) switch (r_format)
{ {
case 11: case 11: return (insn & ~ 0x7ff) | low_sign_unext (value, 11);
{ case 12: return re_assemble_12 (insn, value);
unsigned w1, w; case 14: return (insn & ~ 0x3fff) | low_sign_unext (value, 14);
case 17: return re_assemble_17 (insn, value);
const_part = insn & 0xffffe002; case 21: return re_assemble_21 (insn, value);
dis_assemble_12 (value, &w1, &w); case 32: return value;
rebuilt_part = (w1 << 2) | w;
return const_part | rebuilt_part;
}
case 12:
{
unsigned w1, w;
const_part = insn & 0xffffe002;
dis_assemble_12 (value, &w1, &w);
rebuilt_part = (w1 << 2) | w;
return const_part | rebuilt_part;
}
case 14:
{
unsigned int ext;
const_part = insn & 0xffffc000;
low_sign_unext (value, 14, &ext);
return const_part | ext;
}
case 17:
{
unsigned w1, w2, w;
const_part = insn & 0xffe0e002;
dis_assemble_17 (value, &w1, &w2, &w);
rebuilt_part = (w2 << 2) | (w1 << 16) | w;
return const_part | rebuilt_part;
}
case 21:
{
unsigned int w;
const_part = insn & 0xffe00000;
dis_assemble_21 (value, &w);
return const_part | w;
}
case 32:
const_part = 0;
return value;
default: default:
abort (); abort ();

View File

@ -25,7 +25,7 @@ SECTION
BFD maintains relocations in much the same way it maintains BFD maintains relocations in much the same way it maintains
symbols: they are left alone until required, then read in symbols: they are left alone until required, then read in
en-mass and translated into an internal form. A common en-masse and translated into an internal form. A common
routine <<bfd_perform_relocation>> acts upon the routine <<bfd_perform_relocation>> acts upon the
canonical form to do the fixup. canonical form to do the fixup.

View File

@ -1,3 +1,48 @@
2000-05-02 Alan Modra <alan@linuxcare.com.au>
* configure.in: Set em=linux for hppa-*-linux.
* configure: Regenerate.
* doc/Makefile.in: Regenerate with correct automake.
* frags.c (frag_grow): Sanity check chunk_size.
* config/obj-elf.h: #include "bfd.h" not <bfd.h>
* config/obj-som.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-hppa.h: Test BFD_ARCH_SIZE, not BFD64.
* config/tc-hppa.c (log2): Only compile when OBJ_SOM.
(md_pseudo_table): Fully initialise OBJ_ELF cases.
(fix_new_hppa): Add ATTRIBUTE_UNUSED to args as appropriate.
(pa_ip): low_sign_unext now returns via function value. Use
re_assemble_* instead of dis_assemble_* and
INSERT_FIELD_AND_CONTINUE combination. Don't call sign_unext
unnecessarily.
(md_convert_frag): Add ATTRIBUTE_UNUSED to args as appropriate.
(md_section_align, md_parse_option, md_show_usage,
md_undefined_symbol, pa_align, pa_block, pa_brtab, pa_try,
pa_callinfo, pa_code, pa_comm, pa_end, pa_enter, pa_entry,
pa_exit, pa_export, pa_import, pa_label, pa_leave, pa_level,
pa_origin, pa_param, pa_proc, pa_procend, pa_space, pa_spnum,
pa_version, pa_compiler, pa_copyright, pa_data, pa_fill, pa_lsym,
pa_text): Likewise.
(md_apply_fix): Change type of new_val to offsetT. Delete w1, w2,
w, resulti. Add insn, val. Move bfd_get_32 and bfd_put_32
outside of switch. Correct mask and shifting errors in case 10
and case -11. In case 21, compare against signed range to suit
hppa_field_adjust changes. In case 12, use re_assemble_12. In
case 17 and case 22, use offsetT variable to properly check range.
Use re_assemble_* here too.
(evaluate_absolute): Change type of value to offsetT. Call
hppa_field_adjust to do the work for us.
(pa_parse_cmpb_64_cmpltr): Delete save_s.
(pa_parse_cmpib_64_cmpltr): Ditto.
(pa_build_unwind_subspace): Delete unused var subseg. Change type
of i to unsigned int.
(pa_type_args): Conditionally declare symbol if OBJ_SOM.
(pa_end_of_source): Return type is void.
Mon May 1 08:54:23 2000 Catherine Moore <clm@cygnus.com> Mon May 1 08:54:23 2000 Catherine Moore <clm@cygnus.com>
* macro.c (macro_expand_body): Don't prepend macro number with zeroes. * macro.c (macro_expand_body): Don't prepend macro number with zeroes.

View File

@ -32,7 +32,7 @@
#define OUTPUT_FLAVOR bfd_target_elf_flavour #define OUTPUT_FLAVOR bfd_target_elf_flavour
#endif #endif
#include <bfd.h> #include "bfd.h"
#define BYTES_IN_WORD 4 /* for now */ #define BYTES_IN_WORD 4 /* for now */
#include "bfd/elf-bfd.h" #include "bfd/elf-bfd.h"

View File

@ -20,7 +20,7 @@
#define BFD 1 #define BFD 1
#include <bfd.h> #include "bfd.h"
typedef struct typedef struct
{ {

View File

@ -26,7 +26,7 @@
#define OBJ_SOM 1 #define OBJ_SOM 1
#include <bfd.h> #include "bfd.h"
#include "bfd/som.h" #include "bfd/som.h"
#include "targ-cpu.h" #include "targ-cpu.h"

View File

@ -528,6 +528,7 @@ static int need_pa11_opcode PARAMS ((struct pa_it *,
static int pa_parse_number PARAMS ((char **, struct pa_11_fp_reg_struct *)); static int pa_parse_number PARAMS ((char **, struct pa_11_fp_reg_struct *));
static label_symbol_struct *pa_get_label PARAMS ((void)); static label_symbol_struct *pa_get_label PARAMS ((void));
#ifdef OBJ_SOM #ifdef OBJ_SOM
static int log2 PARAMS ((int));
static void pa_compiler PARAMS ((int)); static void pa_compiler PARAMS ((int));
static void pa_align PARAMS ((int)); static void pa_align PARAMS ((int));
static void pa_space PARAMS ((int)); static void pa_space PARAMS ((int));
@ -568,7 +569,6 @@ static int reg_name_search PARAMS ((char *));
static int pa_chk_field_selector PARAMS ((char **)); static int pa_chk_field_selector PARAMS ((char **));
static int is_same_frag PARAMS ((fragS *, fragS *)); static int is_same_frag PARAMS ((fragS *, fragS *));
static void process_exit PARAMS ((void)); static void process_exit PARAMS ((void));
static int log2 PARAMS ((int));
static unsigned int pa_stringer_aux PARAMS ((char *)); static unsigned int pa_stringer_aux PARAMS ((char *));
static fp_operand_format pa_parse_fp_cnv_format PARAMS ((char **s)); static fp_operand_format pa_parse_fp_cnv_format PARAMS ((char **s));
static int pa_parse_ftest_gfx_completer PARAMS ((char **)); static int pa_parse_ftest_gfx_completer PARAMS ((char **));
@ -646,7 +646,7 @@ const pseudo_typeS md_pseudo_table[] =
{"exit", pa_exit, 0}, {"exit", pa_exit, 0},
{"export", pa_export, 0}, {"export", pa_export, 0},
#ifdef OBJ_ELF #ifdef OBJ_ELF
{ "file", dwarf2_directive_file }, { "file", dwarf2_directive_file, 0 },
#endif #endif
{"fill", pa_fill, 0}, {"fill", pa_fill, 0},
{"float", pa_float_cons, 'f'}, {"float", pa_float_cons, 'f'},
@ -658,7 +658,7 @@ const pseudo_typeS md_pseudo_table[] =
{"leave", pa_leave, 0}, {"leave", pa_leave, 0},
{"level", pa_level, 0}, {"level", pa_level, 0},
#ifdef OBJ_ELF #ifdef OBJ_ELF
{ "loc", dwarf2_directive_loc }, { "loc", dwarf2_directive_loc, 0 },
#endif #endif
{"long", pa_cons, 4}, {"long", pa_cons, 4},
{"lsym", pa_lsym, 0}, {"lsym", pa_lsym, 0},
@ -1271,7 +1271,7 @@ fix_new_hppa (frag, where, size, add_symbol, offset, exp, pcrel,
enum hppa_reloc_field_selector_type_alt r_field; enum hppa_reloc_field_selector_type_alt r_field;
int r_format; int r_format;
long arg_reloc; long arg_reloc;
int* unwind_bits; int* unwind_bits ATTRIBUTE_UNUSED;
{ {
fixS *new_fix; fixS *new_fix;
@ -1700,7 +1700,7 @@ pa_ip (str)
/* When in strict mode, we want to just reject this /* When in strict mode, we want to just reject this
match instead of giving an out of range error. */ match instead of giving an out of range error. */
CHECK_FIELD (num, 15, -16, strict); CHECK_FIELD (num, 15, -16, strict);
low_sign_unext (num, 5, &num); num = low_sign_unext (num, 5);
INSERT_FIELD_AND_CONTINUE (opcode, num, 16); INSERT_FIELD_AND_CONTINUE (opcode, num, 16);
/* Handle a 5 bit immediate at 31. */ /* Handle a 5 bit immediate at 31. */
@ -1712,7 +1712,7 @@ pa_ip (str)
/* When in strict mode, we want to just reject this /* When in strict mode, we want to just reject this
match instead of giving an out of range error. */ match instead of giving an out of range error. */
CHECK_FIELD (num, 15, -16, strict) CHECK_FIELD (num, 15, -16, strict)
low_sign_unext (num, 5, &num); num = low_sign_unext (num, 5);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
/* Handle an unsigned 5 bit immediate at 31. */ /* Handle an unsigned 5 bit immediate at 31. */
@ -1758,8 +1758,8 @@ pa_ip (str)
break; break;
num = pa_parse_number (&s, 0); num = pa_parse_number (&s, 0);
CHECK_FIELD (num, 7, 0, 1); CHECK_FIELD (num, 7, 0, 1);
dis_assemble_3 (num, &num); opcode = re_assemble_3 (opcode, num);
INSERT_FIELD_AND_CONTINUE (opcode, num, 13); continue;
/* Handle all completers. */ /* Handle all completers. */
case 'c': case 'c':
@ -2911,7 +2911,7 @@ pa_ip (str)
{ {
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
CHECK_FIELD (num, 1023, -1024, 0); CHECK_FIELD (num, 1023, -1024, 0);
low_sign_unext (num, 11, &num); num = low_sign_unext (num, 11);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
} }
else else
@ -2946,7 +2946,7 @@ pa_ip (str)
if ((a == 1 && num >= 0) || (a == 0 && num < 0)) if ((a == 1 && num >= 0) || (a == 0 && num < 0))
break; break;
CHECK_FIELD (num, 8191, -8192, 0); CHECK_FIELD (num, 8191, -8192, 0);
low_sign_unext (num, 14, &num); num = low_sign_unext (num, 14);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
} }
else else
@ -3055,7 +3055,7 @@ pa_ip (str)
{ {
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
CHECK_FIELD (num, 8191, -8192, 0); CHECK_FIELD (num, 8191, -8192, 0);
low_sign_unext (num, 14, &num); num = low_sign_unext (num, 14);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
} }
else else
@ -3079,8 +3079,8 @@ pa_ip (str)
{ {
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
CHECK_FIELD (num >> 11, 1048575, -1048576, 0); CHECK_FIELD (num >> 11, 1048575, -1048576, 0);
dis_assemble_21 (num, &num); opcode = re_assemble_21 (opcode, num);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0); continue;
} }
else else
{ {
@ -3101,11 +3101,10 @@ pa_ip (str)
s = expr_end; s = expr_end;
if (the_insn.exp.X_op == O_constant) if (the_insn.exp.X_op == O_constant)
{ {
unsigned int result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
CHECK_FIELD (num, 32767, -32768, 0); CHECK_FIELD (num, 32767, -32768, 0);
dis_assemble_16 (num, &result, 1); opcode = re_assemble_16 (opcode, num, 1);
INSERT_FIELD_AND_CONTINUE (opcode, result, 0); continue;
} }
else else
{ {
@ -3127,12 +3126,11 @@ pa_ip (str)
s = expr_end; s = expr_end;
if (the_insn.exp.X_op == O_constant) if (the_insn.exp.X_op == O_constant)
{ {
unsigned int result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
CHECK_FIELD (num, 32767, -32768, 0); CHECK_FIELD (num, 32767, -32768, 0);
CHECK_ALIGN (num, 4, 0); CHECK_ALIGN (num, 4, 0);
dis_assemble_16 (num, &result, 1); opcode = re_assemble_16 (opcode, num, 1);
INSERT_FIELD_AND_CONTINUE (opcode, result, 0); continue;
} }
else else
{ {
@ -3154,12 +3152,11 @@ pa_ip (str)
s = expr_end; s = expr_end;
if (the_insn.exp.X_op == O_constant) if (the_insn.exp.X_op == O_constant)
{ {
unsigned int result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
CHECK_FIELD (num, 32767, -32768, 0); CHECK_FIELD (num, 32767, -32768, 0);
CHECK_ALIGN (num, 8, 0); CHECK_ALIGN (num, 8, 0);
dis_assemble_16 (num, &result, 1); opcode = re_assemble_16 (opcode, num, 1);
INSERT_FIELD_AND_CONTINUE (opcode, result, 0); continue;
} }
else else
{ {
@ -3182,8 +3179,6 @@ pa_ip (str)
the_insn.pcrel = 1; the_insn.pcrel = 1;
if (!strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001")) if (!strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001"))
{ {
unsigned int w1, w, result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
if (num % 4) if (num % 4)
{ {
@ -3191,9 +3186,9 @@ pa_ip (str)
break; break;
} }
CHECK_FIELD (num, 8199, -8184, 0); CHECK_FIELD (num, 8199, -8184, 0);
sign_unext ((num - 8) >> 2, 12, &result);
dis_assemble_12 (result, &w1, &w); opcode = re_assemble_12 (opcode, (num - 8) >> 2);
INSERT_FIELD_AND_CONTINUE (opcode, ((w1 << 2) | w), 0); continue;
} }
else else
{ {
@ -3215,8 +3210,6 @@ pa_ip (str)
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
"L$0\001")) "L$0\001"))
{ {
unsigned int w2, w1, w, result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
if (num % 4) if (num % 4)
{ {
@ -3228,10 +3221,8 @@ pa_ip (str)
if (the_insn.exp.X_add_symbol) if (the_insn.exp.X_add_symbol)
num -= 8; num -= 8;
sign_unext (num >> 2, 17, &result); opcode = re_assemble_17 (opcode, num >> 2);
dis_assemble_17 (result, &w1, &w2, &w); continue;
INSERT_FIELD_AND_CONTINUE (opcode,
((w2 << 2) | (w1 << 16) | w), 0);
} }
else else
{ {
@ -3252,8 +3243,6 @@ pa_ip (str)
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
"L$0\001")) "L$0\001"))
{ {
unsigned int w3, w2, w1, w, result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
if (num % 4) if (num % 4)
{ {
@ -3265,12 +3254,7 @@ pa_ip (str)
if (the_insn.exp.X_add_symbol) if (the_insn.exp.X_add_symbol)
num -= 8; num -= 8;
sign_unext (num >> 2, 22, &result); opcode = re_assemble_22 (opcode, num >> 2);
dis_assemble_22 (result, &w3, &w1, &w2, &w);
INSERT_FIELD_AND_CONTINUE (opcode,
((w3 << 21) | (w2 << 2)
| (w1 << 16) | w),
0);
} }
else else
{ {
@ -3291,8 +3275,6 @@ pa_ip (str)
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
"L$0\001")) "L$0\001"))
{ {
unsigned int w2, w1, w, result;
num = evaluate_absolute (&the_insn); num = evaluate_absolute (&the_insn);
if (num % 4) if (num % 4)
{ {
@ -3304,10 +3286,8 @@ pa_ip (str)
if (the_insn.exp.X_add_symbol) if (the_insn.exp.X_add_symbol)
num -= 8; num -= 8;
sign_unext (num >> 2, 17, &result); opcode = re_assemble_17 (opcode, num >> 2);
dis_assemble_17 (result, &w1, &w2, &w); continue;
INSERT_FIELD_AND_CONTINUE (opcode,
((w2 << 2) | (w1 << 16) | w), 0);
} }
else else
{ {
@ -4234,8 +4214,8 @@ tc_gen_reloc (section, fixp)
void void
md_convert_frag (abfd, sec, fragP) md_convert_frag (abfd, sec, fragP)
register bfd *abfd; register bfd *abfd ATTRIBUTE_UNUSED;
register asection *sec; register asection *sec ATTRIBUTE_UNUSED;
register fragS *fragP; register fragS *fragP;
{ {
unsigned int address; unsigned int address;
@ -4280,7 +4260,7 @@ md_section_align (segment, size)
int int
md_estimate_size_before_relax (fragP, segment) md_estimate_size_before_relax (fragP, segment)
register fragS *fragP; register fragS *fragP;
asection *segment; asection *segment ATTRIBUTE_UNUSED;
{ {
int size; int size;
@ -4300,15 +4280,15 @@ size_t md_longopts_size = sizeof(md_longopts);
int int
md_parse_option (c, arg) md_parse_option (c, arg)
int c; int c ATTRIBUTE_UNUSED;
char *arg; char *arg ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
void void
md_show_usage (stream) md_show_usage (stream)
FILE *stream; FILE *stream ATTRIBUTE_UNUSED;
{ {
} }
@ -4316,7 +4296,7 @@ md_show_usage (stream)
symbolS * symbolS *
md_undefined_symbol (name) md_undefined_symbol (name)
char *name; char *name ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
@ -4330,8 +4310,8 @@ md_apply_fix (fixP, valp)
{ {
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
struct hppa_fix_struct *hppa_fixP; struct hppa_fix_struct *hppa_fixP;
long new_val, result = 0; offsetT new_val;
unsigned int w1, w2, w, resulti; unsigned int insn, val;
hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data; hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
/* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can /* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can
@ -4411,127 +4391,93 @@ md_apply_fix (fixP, valp)
new_val = hppa_field_adjust (*valp, 0, hppa_fixP->fx_r_field); new_val = hppa_field_adjust (*valp, 0, hppa_fixP->fx_r_field);
#undef arg_reloc_stub_needed #undef arg_reloc_stub_needed
insn = bfd_get_32 (stdoutput, buf);
switch (fmt) switch (fmt)
{ {
case 10: case 10:
CHECK_FIELD (new_val, 8191, -8192, 0); CHECK_FIELD (new_val, 8191, -8192, 0);
val = new_val;
/* Mask off 11 bits to be changed. */ insn = (insn & ~ 0x3ff1) | (((val & 0x1ff8) << 1)
bfd_put_32 (stdoutput, | ((val & 0x2000) >> 13));
bfd_get_32 (stdoutput, buf) & 0xffffc00e,
buf);
result = ((new_val & 0x1fff) >> 2) | ((new_val & 0x2000) >> 13);
break; break;
case -11: case -11:
CHECK_FIELD (new_val, 8191, -8192, 0); CHECK_FIELD (new_val, 8191, -8192, 0);
val = new_val;
/* Mask off 14 bits to be changed. */ insn = (insn & ~ 0x3ff9) | (((val & 0x1ffc) << 1)
bfd_put_32 (stdoutput, | ((val & 0x2000) >> 13));
bfd_get_32 (stdoutput, buf) & 0xffffc006,
buf);
result = ((new_val & 0x1fff) >> 1) | ((new_val & 0x2000) >> 15);
break; break;
/* Handle all opcodes with the 'j' operand type. */ /* Handle all opcodes with the 'j' operand type. */
case 14: case 14:
CHECK_FIELD (new_val, 8191, -8192, 0); CHECK_FIELD (new_val, 8191, -8192, 0);
val = new_val;
/* Mask off 14 bits to be changed. */ insn = ((insn & ~ 0x3fff) | low_sign_unext (val, 14));
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffffc000,
buf);
low_sign_unext (new_val, 14, &resulti);
result = resulti;
break; break;
/* Handle all opcodes with the 'k' operand type. */ /* Handle all opcodes with the 'k' operand type. */
case 21: case 21:
CHECK_FIELD (new_val, 2097152, 0, 0); CHECK_FIELD (new_val, 1048576, -1048576, 0);
val = new_val;
/* Mask off 21 bits to be changed. */ insn = re_assemble_21 (insn, val);
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffe00000,
buf);
dis_assemble_21 (new_val, &resulti);
result = resulti;
break; break;
/* Handle all the opcodes with the 'i' operand type. */ /* Handle all the opcodes with the 'i' operand type. */
case 11: case 11:
CHECK_FIELD (new_val, 1023, -1023, 0); CHECK_FIELD (new_val, 1023, -1023, 0);
val = new_val;
/* Mask off 11 bits to be changed. */ insn = (insn & ~ 0x7ff) | low_sign_unext (val, 11);
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffff800,
buf);
low_sign_unext (new_val, 11, &resulti);
result = resulti;
break; break;
/* Handle all the opcodes with the 'w' operand type. */ /* Handle all the opcodes with the 'w' operand type. */
case 12: case 12:
CHECK_FIELD (new_val, 8199, -8184, 0); CHECK_FIELD (new_val, 8199, -8184, 0);
val = new_val;
/* Mask off 11 bits to be changed. */ insn = re_assemble_12 (insn, (val - 8) >> 2);
sign_unext ((new_val - 8) >> 2, 12, &resulti);
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffffe002,
buf);
dis_assemble_12 (resulti, &w1, &w);
result = ((w1 << 2) | w);
break; break;
/* Handle some of the opcodes with the 'W' operand type. */ /* Handle some of the opcodes with the 'W' operand type. */
case 17: case 17:
{ {
int distance = *valp; offsetT distance = *valp;
CHECK_FIELD (new_val, 262143, -262144, 0);
/* If this is an absolute branch (ie no link) with an out of /* If this is an absolute branch (ie no link) with an out of
range target, then we want to complain. */ range target, then we want to complain. */
if (fixP->fx_r_type == R_HPPA_PCREL_CALL if (fixP->fx_r_type == R_HPPA_PCREL_CALL
&& (distance > 262143 || distance < -262144) && (insn & 0xffe00000) == 0xe8000000)
&& (bfd_get_32 (stdoutput, buf) & 0xffe00000) == 0xe8000000)
CHECK_FIELD (distance, 262143, -262144, 0); CHECK_FIELD (distance, 262143, -262144, 0);
/* Mask off 17 bits to be changed. */ CHECK_FIELD (new_val, 262143, -262144, 0);
bfd_put_32 (stdoutput, val = new_val;
bfd_get_32 (stdoutput, buf) & 0xffe0e002,
buf); insn = re_assemble_17 (insn, (val - 8) >> 2);
sign_unext ((new_val - 8) >> 2, 17, &resulti);
dis_assemble_17 (resulti, &w1, &w2, &w);
result = ((w2 << 2) | (w1 << 16) | w);
break; break;
} }
case 22: case 22:
{ {
int distance = *valp, w3; offsetT distance = *valp;
CHECK_FIELD (new_val, 8388607, -8388608, 0);
/* If this is an absolute branch (ie no link) with an out of /* If this is an absolute branch (ie no link) with an out of
range target, then we want to complain. */ range target, then we want to complain. */
if (fixP->fx_r_type == R_HPPA_PCREL_CALL if (fixP->fx_r_type == R_HPPA_PCREL_CALL
&& (distance > 8388607 || distance < -8388608) && (insn & 0xffe00000) == 0xe8000000)
&& (bfd_get_32 (stdoutput, buf) & 0xffe00000) == 0xe8000000)
CHECK_FIELD (distance, 8388607, -8388608, 0); CHECK_FIELD (distance, 8388607, -8388608, 0);
/* Mask off 22 bits to be changed. */ CHECK_FIELD (new_val, 8388607, -8388608, 0);
bfd_put_32 (stdoutput, val = new_val;
bfd_get_32 (stdoutput, buf) & 0xfc00e002,
buf); insn = re_assemble_22 (insn, (val - 8) >> 2);
sign_unext ((new_val - 8) >> 2, 22, &resulti);
dis_assemble_22 (resulti, &w3, &w1, &w2, &w);
result = ((w3 << 21) | (w2 << 2) | (w1 << 16) | w);
break; break;
} }
case 32: case 32:
result = 0; insn = new_val;
bfd_put_32 (stdoutput, new_val, buf);
break; break;
default: default:
@ -4540,7 +4486,7 @@ md_apply_fix (fixP, valp)
} }
/* Insert the relocation. */ /* Insert the relocation. */
bfd_put_32 (stdoutput, bfd_get_32 (stdoutput, buf) | result, buf); bfd_put_32 (stdoutput, insn, buf);
return 1; return 1;
} }
else else
@ -5189,70 +5135,14 @@ static int
evaluate_absolute (insn) evaluate_absolute (insn)
struct pa_it *insn; struct pa_it *insn;
{ {
int value; offsetT value;
expressionS exp; expressionS exp;
int field_selector = insn->field_selector; int field_selector = insn->field_selector;
exp = insn->exp; exp = insn->exp;
value = exp.X_add_number; value = exp.X_add_number;
switch (field_selector) return hppa_field_adjust (0, value, field_selector);
{
/* No change. */
case e_fsel:
break;
/* If bit 21 is on then add 0x800 and arithmetic shift right 11 bits. */
case e_lssel:
if (value & 0x00000400)
value += 0x800;
value = (value & 0xfffff800) >> 11;
break;
/* Sign extend from bit 21. */
case e_rssel:
if (value & 0x00000400)
value |= 0xfffff800;
else
value &= 0x7ff;
break;
/* Arithmetic shift right 11 bits. */
case e_lsel:
value = (value & 0xfffff800) >> 11;
break;
/* Set bits 0-20 to zero. */
case e_rsel:
value = value & 0x7ff;
break;
/* Add 0x800 and arithmetic shift right 11 bits. */
case e_ldsel:
value += 0x800;
value = (value & 0xfffff800) >> 11;
break;
/* Set bitgs 0-21 to one. */
case e_rdsel:
value |= 0xfffff800;
break;
#define RSEL_ROUND(c) (((c) + 0x1000) & ~0x1fff)
case e_rrsel:
value = (RSEL_ROUND (value) & 0x7ff) + (value - RSEL_ROUND (value));
break;
case e_lrsel:
value = (RSEL_ROUND (value) >> 11) & 0x1fffff;
break;
#undef RSEL_ROUND
default:
BAD_CASE (field_selector);
break;
}
return value;
} }
/* Given an argument location specification return the associated /* Given an argument location specification return the associated
@ -5509,7 +5399,6 @@ pa_parse_cmpb_64_cmpltr (s)
int cmpltr; int cmpltr;
char *name = *s + 1; char *name = *s + 1;
char c; char c;
char *save_s = *s;
cmpltr = -1; cmpltr = -1;
if (**s == ',') if (**s == ',')
@ -5605,7 +5494,6 @@ pa_parse_cmpib_64_cmpltr (s)
int cmpltr; int cmpltr;
char *name = *s + 1; char *name = *s + 1;
char c; char c;
char *save_s = *s;
cmpltr = -1; cmpltr = -1;
if (**s == ',') if (**s == ',')
@ -5934,7 +5822,7 @@ pa_align (bytes)
static void static void
pa_block (z) pa_block (z)
int z; int z ATTRIBUTE_UNUSED;
{ {
char *p; char *p;
long int temp_fill; long int temp_fill;
@ -5972,7 +5860,7 @@ pa_block (z)
static void static void
pa_brtab (begin) pa_brtab (begin)
int begin; int begin ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
@ -5993,7 +5881,7 @@ pa_brtab (begin)
static void static void
pa_try (begin) pa_try (begin)
int begin; int begin ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
expressionS exp; expressionS exp;
@ -6020,7 +5908,7 @@ pa_try (begin)
static void static void
pa_call (unused) pa_call (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -6111,9 +5999,9 @@ pa_build_unwind_subspace (call_info)
{ {
char *unwind; char *unwind;
asection *seg, *save_seg; asection *seg, *save_seg;
asymbol *sym; subsegT save_subseg;
subsegT subseg, save_subseg; unsigned int i;
int i, reloc; int reloc;
char c, *p; char c, *p;
if (now_seg != text_section) if (now_seg != text_section)
@ -6190,7 +6078,7 @@ pa_build_unwind_subspace (call_info)
static void static void
pa_callinfo (unused) pa_callinfo (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name, c, *p; char *name, c, *p;
int temp; int temp;
@ -6333,7 +6221,7 @@ pa_callinfo (unused)
static void static void
pa_code (unused) pa_code (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
current_space = is_defined_space ("$TEXT$"); current_space = is_defined_space ("$TEXT$");
@ -6366,7 +6254,7 @@ pa_code (unused)
static void static void
pa_comm (unused) pa_comm (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
unsigned int size; unsigned int size;
symbolS *symbol; symbolS *symbol;
@ -6398,7 +6286,7 @@ pa_comm (unused)
static void static void
pa_end (unused) pa_end (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
demand_empty_rest_of_line (); demand_empty_rest_of_line ();
} }
@ -6406,7 +6294,7 @@ pa_end (unused)
/* Process a .ENTER pseudo-op. This is not supported. */ /* Process a .ENTER pseudo-op. This is not supported. */
static void static void
pa_enter (unused) pa_enter (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -6421,7 +6309,7 @@ pa_enter (unused)
procesure. */ procesure. */
static void static void
pa_entry (unused) pa_entry (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -6528,7 +6416,7 @@ process_exit ()
static void static void
pa_exit (unused) pa_exit (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -6561,7 +6449,7 @@ pa_exit (unused)
static void static void
pa_export (unused) pa_export (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name, c, *p; char *name, c, *p;
symbolS *symbol; symbolS *symbol;
@ -6602,7 +6490,9 @@ pa_type_args (symbolP, is_export)
char *name, c, *p; char *name, c, *p;
unsigned int temp, arg_reloc; unsigned int temp, arg_reloc;
pa_symbol_type type = SYMBOL_TYPE_UNKNOWN; pa_symbol_type type = SYMBOL_TYPE_UNKNOWN;
#ifdef OBJ_SOM
obj_symbol_type *symbol = (obj_symbol_type *) symbol_get_bfdsym (symbolP); obj_symbol_type *symbol = (obj_symbol_type *) symbol_get_bfdsym (symbolP);
#endif
if (strncasecmp (input_line_pointer, "absolute", 8) == 0) if (strncasecmp (input_line_pointer, "absolute", 8) == 0)
@ -6748,7 +6638,7 @@ pa_type_args (symbolP, is_export)
static void static void
pa_import (unused) pa_import (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name, c, *p; char *name, c, *p;
symbolS *symbol; symbolS *symbol;
@ -6800,7 +6690,7 @@ pa_import (unused)
static void static void
pa_label (unused) pa_label (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name, c, *p; char *name, c, *p;
@ -6830,7 +6720,7 @@ pa_label (unused)
static void static void
pa_leave (unused) pa_leave (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -6845,7 +6735,7 @@ pa_leave (unused)
static void static void
pa_level (unused) pa_level (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *level; char *level;
@ -6886,7 +6776,7 @@ pa_level (unused)
static void static void
pa_origin (unused) pa_origin (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -6902,7 +6792,7 @@ pa_origin (unused)
static void static void
pa_param (unused) pa_param (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name, c, *p; char *name, c, *p;
symbolS *symbol; symbolS *symbol;
@ -6937,7 +6827,7 @@ pa_param (unused)
static void static void
pa_proc (unused) pa_proc (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
struct call_info *call_info; struct call_info *call_info;
@ -7007,7 +6897,7 @@ pa_proc (unused)
static void static void
pa_procend (unused) pa_procend (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
@ -7074,6 +6964,8 @@ pa_procend (unused)
pa_undefine_label (); pa_undefine_label ();
} }
#ifdef OBJ_SOM
/* If VALUE is an exact power of two between zero and 2^31, then /* If VALUE is an exact power of two between zero and 2^31, then
return log2 (VALUE). Else return -1. */ return log2 (VALUE). Else return -1. */
@ -7092,8 +6984,6 @@ log2 (value)
return shift; return shift;
} }
#ifdef OBJ_SOM
/* Check to make sure we have a valid space and subspace. */ /* Check to make sure we have a valid space and subspace. */
static void static void
@ -7233,7 +7123,7 @@ pa_parse_space_stmt (space_name, create_flag)
static void static void
pa_space (unused) pa_space (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name, c, *space_name, *save_s; char *name, c, *space_name, *save_s;
int temp; int temp;
@ -7352,7 +7242,7 @@ pa_space (unused)
static void static void
pa_spnum (unused) pa_spnum (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char c; char c;
@ -8192,7 +8082,7 @@ pa_stringer (append_zero)
static void static void
pa_version (unused) pa_version (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
obj_version (0); obj_version (0);
pa_undefine_label (); pa_undefine_label ();
@ -8204,7 +8094,7 @@ pa_version (unused)
static void static void
pa_compiler (unused) pa_compiler (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
obj_som_compiler (0); obj_som_compiler (0);
pa_undefine_label (); pa_undefine_label ();
@ -8216,7 +8106,7 @@ pa_compiler (unused)
static void static void
pa_copyright (unused) pa_copyright (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
obj_copyright (0); obj_copyright (0);
pa_undefine_label (); pa_undefine_label ();
@ -8237,7 +8127,7 @@ pa_cons (nbytes)
static void static void
pa_data (unused) pa_data (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
current_space = is_defined_space ("$PRIVATE$"); current_space = is_defined_space ("$PRIVATE$");
@ -8262,7 +8152,7 @@ pa_float_cons (float_type)
static void static void
pa_fill (unused) pa_fill (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -8292,7 +8182,7 @@ pa_lcomm (needs_align)
static void static void
pa_lsym (unused) pa_lsym (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
/* We must have a valid space and subspace. */ /* We must have a valid space and subspace. */
@ -8307,7 +8197,7 @@ pa_lsym (unused)
label when finished. */ label when finished. */
static void static void
pa_text (unused) pa_text (unused)
int unused; int unused ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_SOM #ifdef OBJ_SOM
current_space = is_defined_space ("$TEXT$"); current_space = is_defined_space ("$TEXT$");
@ -8536,7 +8426,7 @@ elf_hppa_final_processing ()
#endif #endif
#ifdef OBJ_ELF #ifdef OBJ_ELF
pa_end_of_source () void pa_end_of_source ()
{ {
if (debug_type == DEBUG_DWARF2) if (debug_type == DEBUG_DWARF2)
dwarf2_finish (); dwarf2_finish ();

View File

@ -46,10 +46,8 @@
#define WORKING_DOT_WORD #define WORKING_DOT_WORD
/* FIXME. The lack of a place to put things which are both target cpu
and target format dependent makes hacks like this necessary. */
#ifdef OBJ_ELF #ifdef OBJ_ELF
#ifdef BFD64 #if BFD_ARCH_SIZE == 64
#include "bfd/elf64-hppa.h" #include "bfd/elf64-hppa.h"
#define TARGET_FORMAT "elf64-hppa" #define TARGET_FORMAT "elf64-hppa"
#else #else

2
gas/configure vendored
View File

@ -1731,8 +1731,8 @@ for this_target in $target $canon_targets ; do
fr30-*-*) fmt=elf bfd_gas=yes ;; fr30-*-*) fmt=elf bfd_gas=yes ;;
hppa-*-linux-gnu*) fmt=elf em=linux ;;
hppa-*-*elf*) fmt=elf em=hppa ;; hppa-*-*elf*) fmt=elf em=hppa ;;
hppa-*-linux-gnu*) fmt=elf em=hppa ;;
hppa-*-lites*) fmt=elf em=hppa ;; hppa-*-lites*) fmt=elf em=hppa ;;
hppa-*-osf*) fmt=som em=hppa ;; hppa-*-osf*) fmt=som em=hppa ;;
hppa-*-rtems*) fmt=elf em=hppa ;; hppa-*-rtems*) fmt=elf em=hppa ;;

View File

@ -194,8 +194,8 @@ changequote([,])dnl
fr30-*-*) fmt=elf bfd_gas=yes ;; fr30-*-*) fmt=elf bfd_gas=yes ;;
hppa-*-linux-gnu*) fmt=elf em=linux ;;
hppa-*-*elf*) fmt=elf em=hppa ;; hppa-*-*elf*) fmt=elf em=hppa ;;
hppa-*-linux-gnu*) fmt=elf em=hppa ;;
hppa-*-lites*) fmt=elf em=hppa ;; hppa-*-lites*) fmt=elf em=hppa ;;
hppa-*-osf*) fmt=som em=hppa ;; hppa-*-osf*) fmt=som em=hppa ;;
hppa-*-rtems*) fmt=elf em=hppa ;; hppa-*-rtems*) fmt=elf em=hppa ;;

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am # Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -10,6 +10,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
SHELL = @SHELL@ SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
@ -45,10 +46,9 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@ AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
transform = @program_transform_name@ transform = @program_transform_name@
NORMAL_INSTALL = : NORMAL_INSTALL = :
@ -57,8 +57,6 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
@SET_MAKE@
build_alias = @build_alias@ build_alias = @build_alias@
build_triplet = @build@ build_triplet = @build@
host_alias = @host_alias@ host_alias = @host_alias@
@ -100,6 +98,7 @@ RANLIB = @RANLIB@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@ USE_NLS = @USE_NLS@
VERSION = @VERSION@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
YACC = @YACC@ YACC = @YACC@
atof = @atof@ atof = @atof@
cgen_cpu_prefix = @cgen_cpu_prefix@ cgen_cpu_prefix = @cgen_cpu_prefix@
@ -110,7 +109,6 @@ obj_format = @obj_format@
target_cpu_type = @target_cpu_type@ target_cpu_type = @target_cpu_type@
te_file = @te_file@ te_file = @te_file@
AUTOMAKE_OPTIONS = cygnus AUTOMAKE_OPTIONS = cygnus
# What version of the manual you want; "all" includes everything # What version of the manual you want; "all" includes everything
@ -149,11 +147,9 @@ noinst_TEXINFOS = internals.texi
DISTCLEANFILES = asconfig.texi DISTCLEANFILES = asconfig.texi
MAINTAINERCLEANFILES = gasver.texi MAINTAINERCLEANFILES = gasver.texi
subdir = doc
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../config.h CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
DIST_SOURCES =
TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
INFO_DEPS = as.info gasp.info INFO_DEPS = as.info gasp.info
@ -163,12 +159,12 @@ man1dir = $(mandir)/man1
MANS = $(man_MANS) MANS = $(man_MANS)
NROFF = nroff NROFF = nroff
depcomp =
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best GZIP_ENV = --best
all: all-redirect all: all-redirect
.SUFFIXES: .SUFFIXES:
@ -196,7 +192,7 @@ DVIPS = dvips
$(MAKEINFO) -I $(srcdir) $< $(MAKEINFO) -I $(srcdir) $<
.texi.dvi: .texi.dvi:
TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \ TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi: .texi:
@ -212,7 +208,7 @@ DVIPS = dvips
$(MAKEINFO) -I $(srcdir) $< $(MAKEINFO) -I $(srcdir) $<
.texinfo.dvi: .texinfo.dvi:
TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \ TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info: .txi.info:
@ -220,7 +216,7 @@ DVIPS = dvips
$(MAKEINFO) -I $(srcdir) $< $(MAKEINFO) -I $(srcdir) $<
.txi.dvi: .txi.dvi:
TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \ TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi: .txi:
@ -235,7 +231,7 @@ install-info-am: $(INFO_DEPS)
@list='$(INFO_DEPS)'; \ @list='$(INFO_DEPS)'; \
for file in $$list; do \ for file in $$list; do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \
for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \ if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
@ -254,38 +250,37 @@ install-info-am: $(INFO_DEPS)
uninstall-info: uninstall-info:
$(PRE_UNINSTALL) $(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \ ii=yes; \
for file in $$list; do \ else ii=; fi; \
echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \ list='$(INFO_DEPS)'; \
install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \ for file in $$list; do \
(if cd $(DESTDIR)$(infodir); then \ test -z "$ii" \
echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \ done
else :; fi); \ @$(NORMAL_UNINSTALL)
list='$(INFO_DEPS)'; \
for file in $$list; do \
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done done
dist-info: $(INFO_DEPS) dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \ list='$(INFO_DEPS)'; \
for base in $$list; do \ for base in $$list; do \
if test -f $$base; then d=.; else d=$(srcdir); fi; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \ for file in `cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \ test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \ || cp -p $$d/$$file $(distdir)/$$file; \
done; \ done; \
done done
mostlyclean-aminfo: mostlyclean-aminfo:
-rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.pgs as.ky as.kys \ -rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps \
as.ps as.log as.pg as.toc as.tp as.tps as.vr as.vrs as.op \ as.log as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr \
as.tr as.cv as.cn as.cm as.ov gasp.aux gasp.cp gasp.cps \ as.cv as.cn gasp.aux gasp.cp gasp.cps gasp.dvi gasp.fn \
gasp.dvi gasp.fn gasp.fns gasp.pgs gasp.ky gasp.kys gasp.ps \ gasp.fns gasp.ky gasp.kys gasp.ps gasp.log gasp.pg gasp.toc \
gasp.log gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs \ gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op gasp.tr gasp.cv \
gasp.op gasp.tr gasp.cv gasp.cn gasp.cm gasp.ov gasp.cn
clean-aminfo: clean-aminfo:
@ -313,7 +308,6 @@ install-man1:
else file=$$i; fi; \ else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
@ -329,7 +323,6 @@ uninstall-man1:
for i in $$list; do \ for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \
@ -346,16 +339,17 @@ TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES) distdir: $(DISTFILES)
@for file in $(DISTFILES); do \ @for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \ cp -pr $$d/$$file $(distdir)/$$file; \
|| exit 1; \
else \ else \
test -f $(distdir)/$$file \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| exit 1; \ || cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \ fi; \
done done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
@ -383,7 +377,7 @@ uninstall: uninstall-am
all-am: Makefile $(MANS) all-am: Makefile $(MANS)
all-redirect: all-am all-redirect: all-am
install-strip: install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs:
$(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(mkinstalldirs) $(DESTDIR)$(mandir)/man1
@ -398,7 +392,6 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic: maintainer-clean-generic:
-rm -f Makefile.in
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
@ -426,9 +419,8 @@ uninstall-man1 install-man uninstall-man tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-info-am \ dvi-am dvi check check-am installcheck-am installcheck install-info-am \
install-info install-exec-am install-exec install-data-am install-data \ install-info install-exec-am install-exec install-data-am install-data \
install-am install uninstall-am uninstall all-redirect all-am all \ install-am install uninstall-am uninstall all-redirect all-am all \
install-strip installdirs mostlyclean-generic distclean-generic \ installdirs mostlyclean-generic distclean-generic clean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean
maintainer-clean
asconfig.texi: $(CONFIG).texi asconfig.texi: $(CONFIG).texi

View File

@ -74,11 +74,13 @@ frag_grow (nchars)
frag_new (0); frag_new (0);
oldc = frchain_now->frch_obstack.chunk_size; oldc = frchain_now->frch_obstack.chunk_size;
frchain_now->frch_obstack.chunk_size = 2 * nchars + SIZEOF_STRUCT_FRAG; frchain_now->frch_obstack.chunk_size = 2 * nchars + SIZEOF_STRUCT_FRAG;
while ((n = obstack_room (&frchain_now->frch_obstack)) < nchars) if (frchain_now->frch_obstack.chunk_size > 0)
{ while ((n = obstack_room (&frchain_now->frch_obstack)) < nchars
frag_wane (frag_now); && (unsigned long) frchain_now->frch_obstack.chunk_size > nchars)
frag_new (0); {
} frag_wane (frag_now);
frag_new (0);
}
frchain_now->frch_obstack.chunk_size = oldc; frchain_now->frch_obstack.chunk_size = oldc;
} }
if (obstack_room (&frchain_now->frch_obstack) < nchars) if (obstack_room (&frchain_now->frch_obstack) < nchars)