Import of Binutils from the FSF 2.12 branch.

(this fixes several linker problems and coredumps)
These bits are taken from the FSF anoncvs repo on 10-April-2002 13:24 Zulu
This commit is contained in:
David E. O'Brien 2002-04-12 19:33:52 +00:00
parent 55ba99bb8d
commit 0aecce1e34
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/binutils/dist/; revision=94536
127 changed files with 15678 additions and 8730 deletions

View File

@ -1,3 +1,302 @@
2002-04-06 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
R_CRIS_32_PCREL>: Fix typo in name.
(cris_elf_check_relocs): Always create .rela.got here when
R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
(elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
assume it's created.
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* configure.in: Bump version to 2.12.1 and comment out is_release.
* configure: Regenerate.
* dep-in.sed: Cope with absolute paths.
* Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
Run "make dep-am".
* Makefile.in: Regenerate.
Merge from mainline
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* srec.c (MAXCHUNK, Chunk): Revise comments.
(srec_write_record): Correct buffer size.
(srec_write_header): Do without intermediate buffer.
(srec_write_section): Validate Chunk.
(srec_write_terminator): Pass NULL instead of dummy buffer.
(srec_write_symbols): Pass file and symbol names directly to
bfd_bwrite so sprintf won't overflow buffer.
2002-04-03 Jakub Jelinek <jakub@redhat.com>
* elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
PC relative relocs against hidden symbols.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2002-04-03 Alan Modra <amodra@bigpond.net.au>
* elf.c (_bfd_elf_make_section_from_shdr): When setting section
LMAs, loop over segments until p_vaddr and p_memsz specify an
extent enclosing the section.
2002-04-02 Nick Clifton <nickc@cambridge.redhat.com>
* ihex.c (ihex_write_object_contents): Do not allow records to
cross a 64K boundary - wrap if necessary.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* linker.c (link_action): Ignore duplicate warning syms.
(_bfd_generic_link_write_global_symbol): Follow warning symbol link.
* elflink.h (elf_adjust_dynstr_offsets): Likewise.
(elf_adjust_dynamic_symbol): Likewise.
(elf_export_symbol): Likewise.
(elf_link_find_version_dependencies): Likewise.
(elf_link_assign_sym_version): Likewise.
(elf_link_sec_merge_syms): Likewise.
(elf_link_output_extsym): Likewise.
(elf_gc_sweep_symbol): Likewise.
(elf_gc_propagate_vtable_entries_used): Likewise.
(elf_gc_smash_unused_vtentry_relocs): Likewise.
(elf_gc_allocate_got_offsets): Likewise.
(elf_collect_hash_codes): Likewise.
* elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
* elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
(elf_hppa_remark_useless_dynamic_symbols): Likewise.
* elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
* elf32-arm.h (elf32_arm_discard_copies): Likewise.
* elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
(elf_cris_discard_excess_dso_dynamics): Likewise.
* elf32-hppa.c (clobber_millicode_symbols): Likewise.
(mark_PIC_calls): Likewise.
(allocate_plt_static): Likewise.
(allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf32-i386.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
* elf32-m68k.c (elf_m68k_discard_copies): Likewise.
* elf32-mips.c (mips_elf_output_extsym): Likewise.
(mips_elf_sort_hash_table_f): Likewise.
(mips_elf_check_mips16_stubs): Likewise.
* elf32-s390.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf32-sh.c (sh_elf_discard_copies): Likewise.
* elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
(xstormy16_relax_plt_realloc): Likewise.
* elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
(elf64_alpha_output_extsym): Likewise.
* elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
* elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
(mips_elf64_check_mips16_stubs): Likewise.
(mips_elf64_output_extsym): Likewise.
* elf64-ppc.c (func_desc_adjust): Likewise.
(allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf64-s390.c (allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
* elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
* elf64-x86-64.c (elf64_x86_64_discard_copies): Likewise.
* elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
* aoutx.h (aout_link_write_other_symbol): Likewise.
* cofflink.c (_bfd_coff_write_task_globals): Likewise.
(_bfd_coff_write_global_sym): Likewise.
* i386linux.c (linux_tally_symbols): Likewise.
* m68klinux.c (linux_tally_symbols): Likewise.
* sparclinux.c (linux_tally_symbols): Likewise.
* pdp11.c (aout_link_write_other_symbol): Likewise.
* sunos.c (sunos_scan_dynamic_symbol): Likewise.
* xcofflink.c (xcoff_build_ldsyms): Likewise.
(xcoff_write_global_symbol): Likewise.
* cofflink.c (_bfd_coff_final_link): Formatting.
* elf32-i386.c (elf_i386_check_relocs): Formatting.
* elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
* elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
* elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
(mips_elf64_final_link): Likewise.
* elflink.h (elf_link_find_version_dependencies): Remove duplicate
prototype.
2002-03-21 Richard Earnshaw <rearnsha@arm.com>
* elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
<case R_ARM_GOT>): Handle relocations to Thumb functions.
2002-03-19 Hans-Peter Nilsson <hp@bitrange.com>
* elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
STT_NOTYPE symbols to STT_OBJECT.
2002-03-13 Alan Modra <amodra@bigpond.net.au>
* archures.c (bfd_default_compatible): Test bits_per_word.
* cpu-i386.c (i386_compatible): Remove. Replace occurrences with
bfd_default_compatible.
* cpu-i370.c (i370_compatible): Likewise.
* cpu-sparc.c (sparc_compatible): Likewise.
* cpu-h8300.c (compatible): Test in->arch == out->arch.
2002-02-19 Martin Schwidefsky <schwidefsky@de.ibm.com>
* archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
(bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
* bfd-in2.h: Regenerate.
* cpu-s390.c (arch_info_struct): Use renamed architecture defines.
Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
with "s390:64-bit".
* elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
(elf_s390_reloc_type_lookup): Likewise.
(elf_s390_check_relocs): Likewise.
(elf_s390_gc_sweep_hook): Likewise.
(elf_s390_relocate_section): Likewise.
(elf_s390_object_p): Use renamed architecture define.
* elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
2002-04-03 Alan Modra <amodra@bigpond.net.au>
Merge from mainline.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* cpu-mips.c (mips_compatible): Make static, prototype.
2002-03-14 Alan Modra <amodra@bigpond.net.au>
* cpu-mips.c (mips_compatible): New. Don't check bits_per_word.
(N): Use the above.
2002-04-01 Nathan Williams <nathanw@wasabisystems.com>
* elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
which caused the returned LWP ID to always be 0.
2002-04-01 Richard Henderson <rth@redhat.com>
* elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
(elf32_sparc_relocate_section): Use it to figure out when to
initialize .got entries.
* elf64-sparc.c: Similarly.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
Merge from mainline
2002-03-27 Gregory Steuck <greg@nest.cx>
* elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
terminating NULL if empty symbol table.
(_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
2002-03-26 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
2002-03-23 Alan Modra <amodra@bigpond.net.au>
* elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
section file offset for !SEC_LOAD sections.
2002-03-20 Daniel Jacobowitz <drow@mvista.com>
* dwarf2.c (struct funcinfo): Move up.
(lookup_address_in_function_table): New argument function_ptr.
Set it.
(lookup_address_in_line_table): New argument function. If function
is non-NULL, use it to handle ``addr'' before the first line note of
the function.
(comp_unit_find_nearest_line): Update and swap calls to
lookup_address_in_function_table and lookup_address_in_line_table.
* syms.c (_bfd_stab_section_find_nearest_line): Use the first
N_SLINE encountered if we see an N_FUN before any N_SLINE.
2002-03-18 Alan Modra <amodra@bigpond.net.au>
* libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
* libbfd.h: Regenerate.
* archive.c (coff_write_armap): Pass on failures from
bfd_write_bigendian_4byte_int.
2002-03-14 H.J. Lu <hjl@gnu.org>
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
error to bfd_error_nonrepresentable_section for reinit_array
section in DSO.
2002-03-14 Nick Clifton <nickc@cambridge.redhat.com>
* coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
OR it in rather than replacing previously selected flags.
* elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
(TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
2002-03-14 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_bfd_final_link): Revert last change. Instead,
ensure reloc size matches before calling elf_link_input_bfd.
Add an assert to check reloc size when counting output relocs.
2002-03-14 Nick Clifton <nickc@cambridge.redhat.com>
* mmo.c (mmo_get_loc): Return NULL rather than false.
2002-03-13 Alan Modra <amodra@bigpond.net.au>
* elflink.h: Formatting fixes.
(elf_link_output_extsym): Merge undefined and undef weak cases.
* elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
when word size of input matches output word size.
2002-03-07 H.J. Lu (hjl@gnu.org)
* coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
as the type for bfd_reloc_val.
2002-03-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
* elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
(elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
(elf_hppa_final_link_relocate): Correct relocations for indirect
references to local data through the DLT. Fix .opd creation for
local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
relocations. Use e_lsel selector for R_PARISC_DLTIND21L,
R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
"Processor-Specific ELF for PA_RISC, Version 1.43" document.
Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
* elf32-hppa.c (final_link_relocate): Revise relocation selectors
as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
2002-03-05 Jakub Jelinek <jakub@redhat.com>
* merge.c (_bfd_merge_sections): Don't segfault if there
is nothing to merge due to GC.
2002-03-05 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
symbols that have been forced local.
* elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
to output forced local syms for non-shared link.
(elf_link_output_extsym): Tweak condition for calling backend
adjust_dynamic_symbol so that previous behaviour is kept.
Whitespace changes throughout file.
2002-03-04 H.J. Lu <hjl@gnu.org>
* elf.c (bfd_section_from_shdr): Handle special sections,
.init_array, .fini_array and .preinit_array.
(elf_fake_sections): Likewise.
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
DT entry only if the section is in output for .init_array,
.fini_array and .preinit_array. Complain about .preinit_array
section in DSO.
(elf_bfd_final_link): Warn zero size for .init_array,
.fini_array and .preinit_array sections.
* elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
(elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
.preinit_array.
2002-03-01 David Mosberger <davidm@hpl.hp.com>
* elflink.h (size_dynamic_sections): If section named
".preinit_array" exists, create DT_PREINIT_ARRAY and
DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for
".init_array" and ".fini_array".
(elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
DT_FINI_ARRAY.
2002-02-19 Frank Ch. Eigler <fche@redhat.com>
* syms.c (stt[]): Sorted. Added .init/.fini -> "t" mapping.
2002-02-13 Nick Clifton <nickc@cambridge.redhat.com>
* elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
non-zero physical addresses when adjusting the LMAs of new
sections.
2002-02-11 Michael Snyder <msnyder@redhat.com>
* elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
* elf.c (elfcore_grok_pstatus): Add prototype.
(elfcore_grok_lwpstatus): Add prototype.
(elfcore_write_lwpstatus): New function.
(elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
2002-03-20 Tom Rix <trix@redhat.com>
* coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from

View File

@ -700,8 +700,8 @@ DEP1: $(CFILES)
dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
-e 's!@BFD_H@!$(BFD_H)!' \
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!'
-e 's!@SRCDIR@!$(srcdir)!' \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/bfd$$,,`'!'
dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@ -1141,12 +1141,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h $(srcdir)/../opcodes/sh64-opc.h
elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@ -1426,6 +1423,10 @@ elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -750,7 +750,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@ -917,7 +917,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@ -1258,8 +1258,8 @@ DEP1: $(CFILES)
dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
-e 's!@BFD_H@!$(BFD_H)!' \
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!'
-e 's!@SRCDIR@!$(srcdir)!' \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/bfd$$,,`'!'
dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@ -1685,12 +1685,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h $(srcdir)/../opcodes/sh64-opc.h
elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@ -1970,6 +1967,10 @@ elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf64-target.h
elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \

View File

@ -1,6 +1,6 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -145,7 +145,7 @@ AC_SUBST(INTLLIBS)
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
@ -173,7 +173,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
@ -214,7 +214,7 @@ AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
AC_DEFUN([AM_MISSING_PROG],
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
@ -230,7 +230,7 @@ AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
AC_DEFUN([AM_CONFIG_HEADER],
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
@ -256,7 +256,7 @@ changequote([,]))])
# serial 1
AC_DEFUN(AM_MAINTAINER_MODE,
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
@ -273,7 +273,7 @@ AC_DEFUN(AM_MAINTAINER_MODE,
# Define a conditional.
AC_DEFUN(AM_CONDITIONAL,
AC_DEFUN([AM_CONDITIONAL],
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then

View File

@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 a.out binaries.
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@ -28,9 +28,12 @@
#define DEFAULT_ARCH bfd_arch_tic30
#define ARCH_SIZE 32
#define MY(OP) CAT(tic30_aout_,OP)
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
#define MY(OP) CONCAT2 (tic30_aout_,OP)
#define TARGETNAME "a.out-tic30"
#define NAME(x,y) CAT3(tic30_aout,_32_,y)
#define NAME(x,y) CONCAT3 (tic30_aout,_32_,y)
#include "bfd.h"
#include "sysdep.h"
@ -56,8 +59,19 @@ static bfd_reloc_status_type tic30_aout_final_link_relocate
static const bfd_target *tic30_aout_object_p PARAMS ((bfd *));
static boolean tic30_aout_write_object_contents PARAMS ((bfd *));
static boolean tic30_aout_set_sizes PARAMS ((bfd *));
static const bfd_target * tic30_aout_callback PARAMS ((bfd *));
static boolean MY_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *));
reloc_howto_type * tic30_aout_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
enum machine_type tic30_aout_machine_type
PARAMS ((enum bfd_architecture, unsigned long, boolean *));
boolean tic30_aout_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
#define MY_reloc_howto(BFD,REL,IN,EX,PC) tic30_aout_reloc_howto(BFD,REL,&IN,&EX,&PC)
#define MY_reloc_howto(BFD, REL, IN, EX, PC) \
tic30_aout_reloc_howto(BFD, REL, &IN, &EX, &PC)
#define MY_final_link_relocate tic30_aout_final_link_relocate
#define MY_object_p tic30_aout_object_p
#define MY_mkobject NAME(aout,mkobject)
@ -101,7 +115,7 @@ static boolean tic30_aout_set_sizes PARAMS ((bfd *));
#define MY_finish_dynamic_link 0
#endif
static CONST struct aout_backend_data tic30_aout_backend_data =
static const struct aout_backend_data tic30_aout_backend_data =
{
MY_zmagic_contiguous,
MY_text_includes_header,
@ -130,26 +144,27 @@ static CONST struct aout_backend_data tic30_aout_backend_data =
2) to get the 32-bit addresses in the format the TMS320C30 likes
it. */
reloc_howto_type tic30_aout_howto_table[] =
{
EMPTY_HOWTO (-1),
HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16,
"16", false, 0x0000FFFF, 0x0000FFFF, false),
HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL,
"24", false, 0x00FFFFFF, 0x00FFFFFF, false),
HOWTO (3, 18, 3, 24, false, 0, complain_overflow_bitfield, NULL,
"LDP", false, 0x00FF0000, 0x000000FF, false),
HOWTO (4, 2, 4, 32, false, 0, complain_overflow_bitfield, tic30_aout_fix_32,
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed,
tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1)
};
{
EMPTY_HOWTO (-1),
HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16,
"16", false, 0x0000FFFF, 0x0000FFFF, false),
HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL,
"24", false, 0x00FFFFFF, 0x00FFFFFF, false),
HOWTO (3, 18, 3, 24, false, 0, complain_overflow_bitfield, NULL,
"LDP", false, 0x00FF0000, 0x000000FF, false),
HOWTO (4, 2, 4, 32, false, 0, complain_overflow_bitfield, tic30_aout_fix_32,
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed,
tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1)
};
extern reloc_howto_type *NAME (aout, reloc_type_lookup) ();
extern reloc_howto_type *NAME (aout, reloc_type_lookup)
PARAMS ((bfd *, bfd_reloc_code_real_type));
reloc_howto_type *
tic30_aout_reloc_type_lookup (abfd, code)
@ -317,10 +332,10 @@ tic30_aout_callback (abfd)
unsigned int arch_align_power;
unsigned long arch_align;
/* Calculate the file positions of the parts of a newly read aout header */
/* Calculate the file positions of the parts of a newly read aout header. */
obj_textsec (abfd)->_raw_size = N_TXTSIZE (*execp);
/* The virtual memory addresses of the sections */
/* The virtual memory addresses of the sections. */
obj_textsec (abfd)->vma = N_TXTADDR (*execp);
obj_datasec (abfd)->vma = N_DATADDR (*execp);
obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
@ -329,11 +344,11 @@ tic30_aout_callback (abfd)
obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file offsets of the sections */
/* The file offsets of the sections. */
obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
obj_datasec (abfd)->filepos = N_DATOFF (*execp);
/* The file offsets of the relocation info */
/* The file offsets of the relocation info. */
obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
@ -345,7 +360,7 @@ tic30_aout_callback (abfd)
#ifdef SET_ARCH_MACH
SET_ARCH_MACH (abfd, *execp);
#else
bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0L);
#endif
/* Now that we know the architecture, set the alignments of the
@ -429,7 +444,9 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
x = bfd_get_32 (input_bfd, location);
break;
}
overflow = false;
if (howto->complain_on_overflow != complain_overflow_dont)
{
bfd_vma check;
@ -487,7 +504,9 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
case complain_overflow_bitfield:
{
bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
if ((check & ~reloc_bits) != 0 && (((bfd_vma) signed_check & ~reloc_bits) != (-1 & ~reloc_bits)))
if ((check & ~reloc_bits) != 0
&& (((bfd_vma) signed_check & ~reloc_bits)
!= ((bfd_vma) -1 & ~reloc_bits)))
overflow = true;
}
break;
@ -520,18 +539,18 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
return overflow ? bfd_reloc_overflow : bfd_reloc_ok;
}
/* Finish up the reading of an a.out file header */
/* Finish up the reading of an a.out file header. */
static const bfd_target *
tic30_aout_object_p (abfd)
bfd *abfd;
{
struct external_exec exec_bytes; /* Raw exec header from file */
struct internal_exec exec; /* Cleaned-up exec header */
struct external_exec exec_bytes; /* Raw exec header from file. */
struct internal_exec exec; /* Cleaned-up exec header. */
const bfd_target *target;
bfd_size_type amt = EXEC_BYTES_SIZE;
if (bfd_read ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
!= EXEC_BYTES_SIZE)
if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
@ -541,7 +560,7 @@ tic30_aout_object_p (abfd)
#ifdef SWAP_MAGIC
exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
#else
exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
exec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
#endif /* SWAP_MAGIC */
if (N_BADMAG (exec))
@ -562,10 +581,10 @@ tic30_aout_object_p (abfd)
#ifdef ENTRY_CAN_BE_ZERO
/* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
* means that it isn't obvious if EXEC_P should be set.
* All of the following must be true for an executable:
* There must be no relocations, the bfd can be neither an
* archive nor an archive element, and the file must be executable. */
means that it isn't obvious if EXEC_P should be set.
All of the following must be true for an executable:
There must be no relocations, the bfd can be neither an
archive nor an archive element, and the file must be executable. */
if (exec.a_trsize + exec.a_drsize == 0
&& bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL)
@ -614,8 +633,9 @@ tic30_aout_write_object_contents (abfd)
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
{
bfd_size_type text_size; /* dummy vars */
bfd_size_type text_size; /* Dummy vars. */
file_ptr text_end;
if (adata (abfd).magic == undecided_magic)
NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
@ -628,13 +648,15 @@ tic30_aout_write_object_contents (abfd)
if (adata (abfd).exec_bytes_size > 0)
{
bfd_size_type amt;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return false;
if (bfd_write ((PTR) & exec_bytes, 1, adata (abfd).exec_bytes_size, abfd) != adata (abfd).exec_bytes_size)
amt = adata (abfd).exec_bytes_size;
if (bfd_bwrite ((PTR) &exec_bytes, amt, abfd) != amt)
return false;
}
/* Now write out reloc info, followed by syms and strings */
/* Now write out reloc info, followed by syms and strings. */
if (bfd_get_outsymbols (abfd) != (asymbol **) NULL
&& bfd_get_symcount (abfd) != 0)
{
@ -745,10 +767,10 @@ MY_bfd_final_link (abfd, info)
{
obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
}
if (obj_datasec (abfd)->vma < vma)
{
obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
}
obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
obj_datasec (abfd)->user_set_vma = 1;
vma = obj_datasec (abfd)->vma;
obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size;
@ -940,6 +962,9 @@ tic30_aout_set_arch_mach (abfd, arch, machine)
#ifndef MY_bfd_gc_sections
#define MY_bfd_gc_sections bfd_generic_gc_sections
#endif
#ifndef MY_bfd_merge_sections
#define MY_bfd_merge_sections bfd_generic_merge_sections
#endif
#ifndef MY_bfd_reloc_type_lookup
#define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
#endif

View File

@ -1,6 +1,6 @@
/* BFD semi-generic back-end for a.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
2001
2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -4577,6 +4577,13 @@ aout_link_write_other_symbol (h, data)
bfd_size_type indx;
bfd_size_type amt;
if (h->root.type == bfd_link_hash_warning)
{
h = (struct aout_link_hash_entry *) h->root.u.i.link;
if (h->root.type == bfd_link_hash_new)
return true;
}
output_bfd = finfo->output_bfd;
if (aout_backend_info (output_bfd)->write_dynamic_symbol != NULL)
@ -4605,6 +4612,7 @@ aout_link_write_other_symbol (h, data)
switch (h->root.type)
{
default:
case bfd_link_hash_warning:
abort ();
/* Avoid variable not initialized warnings. */
return true;
@ -4646,9 +4654,8 @@ aout_link_write_other_symbol (h, data)
type = N_WEAKU;
val = 0;
case bfd_link_hash_indirect:
case bfd_link_hash_warning:
/* FIXME: Ignore these for now. The circumstances under which
they should be written out are not clear to me. */
/* We ignore these symbols, since the indirected symbol is
already in the hash table. */
return true;
}

View File

@ -1,6 +1,6 @@
/* BFD back-end for archive files (libraries).
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
@ -2190,7 +2190,8 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
!= sizeof (struct ar_hdr))
return false;
bfd_write_bigendian_4byte_int (arch, symbol_count);
if (!bfd_write_bigendian_4byte_int (arch, symbol_count))
return false;
/* Two passes, first write the file offsets for each symbol -
remembering that each offset is on a two byte boundary. */
@ -2207,7 +2208,8 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
while (count < symbol_count && map[count].u.abfd == current)
{
bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr);
if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr))
return false;
count++;
}
/* Add size of this archive entry. */

View File

@ -259,8 +259,8 @@ DESCRIPTION
.#define bfd_mach_avr5 5
. bfd_arch_cris, {* Axis CRIS *}
. bfd_arch_s390, {* IBM s390 *}
.#define bfd_mach_s390_esa 0
.#define bfd_mach_s390_esame 1
.#define bfd_mach_s390_31 0
.#define bfd_mach_s390_64 1
. bfd_arch_openrisc, {* OpenRISC *}
. bfd_arch_mmix, {* Donald Knuth's educational processor. *}
. bfd_arch_xstormy16,
@ -722,6 +722,9 @@ bfd_default_compatible (a, b)
if (a->arch != b->arch)
return NULL;
if (a->bits_per_word != b->bits_per_word)
return NULL;
if (a->mach > b->mach)
return a;

View File

@ -1638,8 +1638,8 @@ enum bfd_architecture
#define bfd_mach_avr5 5
bfd_arch_cris, /* Axis CRIS */
bfd_arch_s390, /* IBM s390 */
#define bfd_mach_s390_esa 0
#define bfd_mach_s390_esame 1
#define bfd_mach_s390_31 0
#define bfd_mach_s390_64 1
bfd_arch_openrisc, /* OpenRISC */
bfd_arch_mmix, /* Donald Knuth's educational processor. */
bfd_arch_xstormy16,

View File

@ -1,6 +1,6 @@
/* BFD back-end for ARM COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -900,6 +900,11 @@ coff_arm_reloc_type_lookup (abfd, code)
#define BADMAG(x) ARMBADMAG(x)
#define ARM 1 /* Customize coffcode.h */
/* Make sure that the 'r_offset' field is copied properly
so that identical binaries will compare the same. */
#define SWAP_IN_RELOC_OFFSET H_GET_32
#define SWAP_OUT_RELOC_OFFSET H_PUT_32
/* Extend the coff_link_hash_table structure with a few ARM specific fields.
This allows us to store global data here without actually creating any
global variables, which is a no-no in the BFD world. */

View File

@ -1,5 +1,6 @@
/* BFD back-end for MIPS Extended-Coff files.
Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@ -115,7 +116,6 @@ static boolean mips_relax_pcrel16 PARAMS ((struct bfd_link_info *, bfd *,
bfd_byte *, bfd_vma));
static reloc_howto_type *mips_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
/* ECOFF has COFF sections, but the debugging information is stored in
a completely different format. ECOFF targets use some of the
@ -366,7 +366,7 @@ static reloc_howto_type mips_howto_table[] =
#define MIPS_HOWTO_COUNT \
(sizeof mips_howto_table / sizeof mips_howto_table[0])
/* When the linker is doing relaxing, it may change a external PCREL16
/* When the linker is doing relaxing, it may change an external PCREL16
reloc. This typically represents an instruction like
bal foo
We change it to
@ -426,7 +426,7 @@ mips_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
{
const RELOC *ext = (RELOC *) ext_ptr;
intern->r_vaddr = bfd_h_get_32 (abfd, (bfd_byte *) ext->r_vaddr);
intern->r_vaddr = H_GET_32 (abfd, ext->r_vaddr);
if (bfd_header_big_endian (abfd))
{
intern->r_symndx = (((int) ext->r_bits[0]
@ -503,7 +503,7 @@ mips_ecoff_swap_reloc_out (abfd, intern, dst)
r_symndx = intern->r_offset & 0xffffff;
}
bfd_h_put_32 (abfd, intern->r_vaddr, (bfd_byte *) ext->r_vaddr);
H_PUT_32 (abfd, intern->r_vaddr, ext->r_vaddr);
if (bfd_header_big_endian (abfd))
{
ext->r_bits[0] = r_symndx >> RELOC_BITS0_SYMNDX_SH_LEFT_BIG;
@ -691,7 +691,7 @@ mips_refhi_reloc (abfd,
return bfd_reloc_outofrange;
/* Save the information, and let REFLO do the actual relocation. */
n = (struct mips_hi *) bfd_malloc (sizeof *n);
n = (struct mips_hi *) bfd_malloc ((bfd_size_type) sizeof *n);
if (n == NULL)
return bfd_reloc_outofrange;
n->addr = (bfd_byte *) data + reloc_entry->address;
@ -758,8 +758,8 @@ mips_reflo_reloc (abfd,
if ((val & 0x8000) != 0)
val += 0x10000;
insn = (insn &~ 0xffff) | ((val >> 16) & 0xffff);
bfd_put_32 (abfd, insn, l->addr);
insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
bfd_put_32 (abfd, (bfd_vma) insn, l->addr);
next = l->next;
free (l);
@ -854,7 +854,7 @@ mips_gprel_reloc (abfd,
{
for (i = 0; i < count; i++, sym++)
{
register CONST char *name;
register const char *name;
name = bfd_asymbol_name (*sym);
if (*name == '_' && strcmp (name, "_gp") == 0)
@ -903,14 +903,14 @@ mips_gprel_reloc (abfd,
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
insn = (insn &~ 0xffff) | (val & 0xffff);
bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address);
insn = (insn &~ (unsigned) 0xffff) | (val & 0xffff);
bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address);
if (relocateable != false)
reloc_entry->address += input_section->output_offset;
/* Make sure it fit in 16 bits. */
if (val >= 0x8000 && val < 0xffff8000)
if ((long) val >= 0x8000 || (long) val < -0x8000)
return bfd_reloc_overflow;
return bfd_reloc_ok;
@ -982,7 +982,7 @@ mips_relhi_reloc (abfd,
return bfd_reloc_outofrange;
/* Save the information, and let RELLO do the actual relocation. */
n = (struct mips_hi *) bfd_malloc (sizeof *n);
n = (struct mips_hi *) bfd_malloc ((bfd_size_type) sizeof *n);
if (n == NULL)
return bfd_reloc_outofrange;
n->addr = (bfd_byte *) data + reloc_entry->address;
@ -1059,8 +1059,8 @@ mips_rello_reloc (abfd,
if ((val & 0x8000) != 0)
val += 0x10000;
insn = (insn &~ 0xffff) | ((val >> 16) & 0xffff);
bfd_put_32 (abfd, insn, l->addr);
insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
bfd_put_32 (abfd, (bfd_vma) insn, l->addr);
next = l->next;
free (l);
@ -1100,7 +1100,6 @@ mips_rello_reloc (abfd,
requires special handling when relaxing. We don't want
bfd_perform_relocation to tamper with it at all. */
/*ARGSUSED*/
static bfd_reloc_status_type
mips_switch_reloc (abfd,
reloc_entry,
@ -1147,7 +1146,7 @@ mips_bfd_reloc_type_lookup (abfd, code)
case BFD_RELOC_LO16:
mips_type = MIPS_R_REFLO;
break;
case BFD_RELOC_MIPS_GPREL:
case BFD_RELOC_GPREL16:
mips_type = MIPS_R_GPREL;
break;
case BFD_RELOC_MIPS_LITERAL:
@ -1195,7 +1194,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
if (refhi == NULL)
return;
insn = bfd_get_32 (input_bfd,
contents + adjust + refhi->r_vaddr - input_section->vma);
if (reflo == NULL)
@ -1204,7 +1203,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
vallo = (bfd_get_32 (input_bfd,
contents + adjust + reflo->r_vaddr - input_section->vma)
& 0xffff);
val = ((insn & 0xffff) << 16) + vallo;
val += relocation;
@ -1224,7 +1223,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
if ((val & 0x8000) != 0)
val += 0x10000;
insn = (insn &~ 0xffff) | ((val >> 16) & 0xffff);
insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
bfd_put_32 (input_bfd, (bfd_vma) insn,
contents + adjust + refhi->r_vaddr - input_section->vma);
}
@ -1252,6 +1251,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
unsigned int i;
boolean got_lo;
struct internal_reloc lo_int_rel;
bfd_size_type amt;
BFD_ASSERT (input_bfd->xvec->byteorder
== output_bfd->xvec->byteorder);
@ -1262,10 +1262,8 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
symndx_to_section = ecoff_data (input_bfd)->symndx_to_section;
if (symndx_to_section == (asection **) NULL)
{
symndx_to_section = ((asection **)
bfd_alloc (input_bfd,
(NUM_RELOC_SECTIONS
* sizeof (asection *))));
amt = NUM_RELOC_SECTIONS * sizeof (asection *);
symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
if (!symndx_to_section)
return false;
@ -1432,7 +1430,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
if (gp_undefined)
{
if (! ((*info->callbacks->reloc_dangerous)
(info, _("GP relative relocation when GP not defined"),
(info, _("GP relative relocation used when GP not defined"),
input_bfd, input_section,
int_rel.r_vaddr - input_section->vma)))
return false;
@ -1505,7 +1503,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
memmove (here + PCREL16_EXPANSION_ADJUSTMENT, here,
(size_t) (input_section->_raw_size
- (int_rel.r_vaddr - input_section->vma)));
/* Generate the new instructions. */
if (! mips_relax_pcrel16 (info, input_bfd, input_section,
h, here,
@ -1626,7 +1624,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
int_rel.r_symndx = RELOC_SECTION_TEXT;
break;
}
if (int_rel.r_symndx == -1)
abort ();
@ -1881,12 +1879,13 @@ mips_read_relocs (abfd, sec)
asection *sec;
{
struct ecoff_section_tdata *section_tdata;
bfd_size_type amt;
section_tdata = ecoff_section_data (abfd, sec);
if (section_tdata == (struct ecoff_section_tdata *) NULL)
{
sec->used_by_bfd =
(PTR) bfd_alloc (abfd, sizeof (struct ecoff_section_tdata));
amt = sizeof (struct ecoff_section_tdata);
sec->used_by_bfd = (PTR) bfd_alloc (abfd, amt);
if (sec->used_by_bfd == NULL)
return false;
@ -1898,20 +1897,14 @@ mips_read_relocs (abfd, sec)
if (section_tdata->external_relocs == NULL)
{
bfd_size_type external_relocs_size;
external_relocs_size = (ecoff_backend (abfd)->external_reloc_size
* sec->reloc_count);
section_tdata->external_relocs =
(PTR) bfd_alloc (abfd, external_relocs_size);
if (section_tdata->external_relocs == NULL && external_relocs_size != 0)
amt = ecoff_backend (abfd)->external_reloc_size;
amt *= sec->reloc_count;
section_tdata->external_relocs = (PTR) bfd_alloc (abfd, amt);
if (section_tdata->external_relocs == NULL && amt != 0)
return false;
if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0
|| (bfd_read (section_tdata->external_relocs, 1,
external_relocs_size, abfd)
!= external_relocs_size))
|| bfd_bread (section_tdata->external_relocs, amt, abfd) != amt)
return false;
}
@ -2010,6 +2003,7 @@ mips_relax_section (abfd, sec, info, again)
struct ecoff_link_hash_entry **adj_h_ptr;
struct ecoff_link_hash_entry **adj_h_ptr_end;
struct ecoff_value_adjust *adjust;
bfd_size_type amt;
/* If we have already expanded this reloc, we certainly don't
need to do it again. */
@ -2086,7 +2080,7 @@ mips_relax_section (abfd, sec, info, again)
if (info->keep_memory)
contents = (bfd_byte *) bfd_alloc (abfd, sec->_raw_size);
else
contents = (bfd_byte *) bfd_malloc ((size_t) sec->_raw_size);
contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
if (contents == (bfd_byte *) NULL)
goto error_return;
if (! bfd_get_section_contents (abfd, sec, (PTR) contents,
@ -2104,7 +2098,7 @@ mips_relax_section (abfd, sec, info, again)
somebody felt it were important. Ignoring this reloc will
presumably cause a reloc overflow error later on. */
if (bfd_get_32 (abfd, contents + int_rel.r_vaddr - sec->vma)
!= 0x0411ffff) /* bgezal $0,. == bal . */
!= 0x0411ffff) /* bgezal $0,. == bal . */
continue;
/* Bother. We need to expand this reloc, and we will need to
@ -2119,13 +2113,13 @@ mips_relax_section (abfd, sec, info, again)
if (offsets == (long *) NULL)
{
size_t size;
bfd_size_type size;
size = sec->reloc_count * sizeof (long);
size = (bfd_size_type) sec->reloc_count * sizeof (long);
offsets = (long *) bfd_alloc (abfd, size);
if (offsets == (long *) NULL)
goto error_return;
memset (offsets, 0, size);
memset (offsets, 0, (size_t) size);
section_tdata->offsets = offsets;
}
@ -2180,7 +2174,7 @@ mips_relax_section (abfd, sec, info, again)
mips_ecoff_swap_reloc_in (abfd, (PTR) (adj_ext_rel + 1), &rello);
BFD_ASSERT (rello.r_type == MIPS_R_RELLO);
addhi = bfd_get_32 (abfd,
contents + adj_int_rel.r_vaddr - sec->vma);
addhi &= 0xffff;
@ -2298,8 +2292,8 @@ mips_relax_section (abfd, sec, info, again)
/* Add an entry to the symbol value adjust list. This is used
by bfd_ecoff_debug_accumulate to adjust the values of
internal symbols and FDR's. */
adjust = ((struct ecoff_value_adjust *)
bfd_alloc (abfd, sizeof (struct ecoff_value_adjust)));
amt = sizeof (struct ecoff_value_adjust);
adjust = (struct ecoff_value_adjust *) bfd_alloc (abfd, amt);
if (adjust == (struct ecoff_value_adjust *) NULL)
goto error_return;
@ -2352,15 +2346,17 @@ mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
if ((relocation & 0x8000) != 0)
relocation += 0x10000;
bfd_put_32 (input_bfd, 0x04110001, location); /* bal .+8 */
bfd_put_32 (input_bfd, (bfd_vma) 0x04110001, location); /* bal .+8 */
bfd_put_32 (input_bfd,
0x3c010000 | ((relocation >> 16) & 0xffff), /* lui $at,XX */
location + 4);
bfd_put_32 (input_bfd,
0x24210000 | (relocation & 0xffff), /* addiu $at,$at,XX */
location + 8);
bfd_put_32 (input_bfd, 0x003f0821, location + 12); /* addu $at,$at,$ra */
bfd_put_32 (input_bfd, 0x0020f809, location + 16); /* jalr $at */
bfd_put_32 (input_bfd,
(bfd_vma) 0x003f0821, location + 12); /* addu $at,$at,$ra */
bfd_put_32 (input_bfd,
(bfd_vma) 0x0020f809, location + 16); /* jalr $at */
return true;
}
@ -2387,6 +2383,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
struct external_reloc *ext_rel;
struct external_reloc *ext_rel_end;
bfd_byte *p;
bfd_size_type amt;
BFD_ASSERT (! info->relocateable);
@ -2400,7 +2397,8 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
if (! mips_read_relocs (abfd, datasec))
return false;
relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 4);
amt = (bfd_size_type) datasec->reloc_count * 4;
relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
if (relsec->contents == NULL)
return false;
@ -2505,7 +2503,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
(unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
mips_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2,
mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in,
mips_ecoff_swap_scnhdr_in, NULL,
mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
@ -2601,6 +2599,9 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
/* GC of sections is not done. */
#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
/* Merging of sections is not done. */
#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
extern const bfd_target ecoff_big_vec;
const bfd_target ecoff_little_vec =
@ -2643,7 +2644,7 @@ const bfd_target ecoff_little_vec =
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
& ecoff_big_vec,
(PTR) &mips_ecoff_backend_data
};
@ -2686,7 +2687,7 @@ const bfd_target ecoff_big_vec =
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
& ecoff_little_vec,
(PTR) &mips_ecoff_backend_data
};
@ -2730,6 +2731,6 @@ const bfd_target ecoff_biglittle_vec =
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
(PTR) &mips_ecoff_backend_data
};

View File

@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 coff binaries.
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@ -27,22 +27,28 @@
#include "coff/internal.h"
#include "libcoff.h"
static int coff_tic30_select_reloc PARAMS ((reloc_howto_type *));
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
reloc_howto_type * tic30_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
reloc_howto_type tic30_coff_howto_table[] =
{
HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL,
"16", false, 0x0000FFFF, 0x0000FFFF, false),
HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL,
"24", false, 0xFFFFFF00, 0xFFFFFF00, false),
HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL,
"LDP", false, 0x00FF0000, 0x000000FF, false),
HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL,
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
"PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
EMPTY_HOWTO (-1)
};
{
HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL,
"16", false, 0x0000FFFF, 0x0000FFFF, false),
HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL,
"24", false, 0xFFFFFF00, 0xFFFFFF00, false),
HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL,
"LDP", false, 0x00FF0000, 0x000000FF, false),
HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL,
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
"PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
EMPTY_HOWTO (-1)
};
#ifndef coff_bfd_reloc_type_lookup
#define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup
@ -50,6 +56,7 @@ reloc_howto_type tic30_coff_howto_table[] =
/* For the case statement use the code values used in tc_gen_reloc to
map to the howto table entries that match those in both the aout
and coff implementations. */
reloc_howto_type *
tic30_coff_reloc_type_lookup (abfd, code)
bfd *abfd ATTRIBUTE_UNUSED;
@ -75,7 +82,7 @@ tic30_coff_reloc_type_lookup (abfd, code)
#endif
/* Turn a howto into a reloc number */
/* Turn a howto into a reloc number. */
static int
coff_tic30_select_reloc (howto)
@ -91,8 +98,8 @@ coff_tic30_select_reloc (howto)
#define __A_MAGIC_SET__
/* Code to swap in the reloc */
#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
#define SWAP_IN_RELOC_OFFSET H_GET_32
#define SWAP_OUT_RELOC_OFFSET H_PUT_32
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \
dst->r_stuff[1] = 'C';
@ -126,7 +133,7 @@ rtype2howto (internal, dst)
}
}
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry)
/* Perform any necessary magic to the addend in a reloc entry */
@ -148,13 +155,10 @@ reloc_processing (relent, reloc, symbols, abfd, section)
rtype2howto (relent, reloc);
if (reloc->r_symndx > 0)
{
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
}
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
else
{
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
}
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
relent->addend = reloc->r_offset;
relent->address -= section->vma;
}

View File

@ -28,15 +28,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coff/internal.h"
#include "libcoff.h"
static void extra_case PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *));
static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
static int coff_z8k_select_reloc PARAMS ((reloc_howto_type *));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
static reloc_howto_type r_imm32 =
HOWTO (R_IMM32, 0, 1, 32, false, 0,
HOWTO (R_IMM32, 0, 2, 32, false, 0,
complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff,
0xffffffff, false);
static reloc_howto_type r_imm4l =
HOWTO (R_IMM4L, 0, 1, 4, false, 0,
HOWTO (R_IMM4L, 0, 0, 4, false, 0,
complain_overflow_bitfield, 0, "r_imm4l", true, 0xf, 0xf, false);
static reloc_howto_type r_da =
@ -45,14 +50,27 @@ HOWTO (R_IMM16, 0, 1, 16, false, 0,
false);
static reloc_howto_type r_imm8 =
HOWTO (R_IMM8, 0, 1, 8, false, 0,
HOWTO (R_IMM8, 0, 0, 8, false, 0,
complain_overflow_bitfield, 0, "r_imm8", true, 0x000000ff, 0x000000ff,
false);
static reloc_howto_type r_rel16 =
HOWTO (R_REL16, 0, 1, 16, false, 0,
complain_overflow_bitfield, 0, "r_rel16", true, 0x0000ffff, 0x0000ffff,
true);
static reloc_howto_type r_jr =
HOWTO (R_JR, 0, 1, 8, true, 0, complain_overflow_signed, 0,
HOWTO (R_JR, 0, 0, 8, true, 0, complain_overflow_signed, 0,
"r_jr", true, 0, 0, true);
static reloc_howto_type r_disp7 =
HOWTO (R_DISP7, 0, 0, 7, true, 0, complain_overflow_bitfield, 0,
"r_disp7", true, 0, 0, true);
static reloc_howto_type r_callr =
HOWTO (R_CALLR, 0, 1, 12, true, 0, complain_overflow_signed, 0,
"r_callr", true, 0xfff, 0xfff, true);
/* Turn a howto into a reloc number */
static int
@ -68,15 +86,14 @@ coff_z8k_select_reloc (howto)
#define Z8K 1 /* Customize coffcode.h */
#define __A_MAGIC_SET__
/* Code to swap in the reloc */
#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
/* Code to swap in the reloc. */
#define SWAP_IN_RELOC_OFFSET H_GET_32
#define SWAP_OUT_RELOC_OFFSET H_PUT_32
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \
dst->r_stuff[0] = 'S'; \
dst->r_stuff[1] = 'C';
/* Code to turn a r_type into a howto ptr, uses the above howto table
*/
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
static void
rtype2howto (internal, dst)
@ -97,6 +114,15 @@ rtype2howto (internal, dst)
case R_JR:
internal->howto = &r_jr;
break;
case R_DISP7:
internal->howto = &r_disp7;
break;
case R_CALLR:
internal->howto = &r_callr;
break;
case R_REL16:
internal->howto = &r_rel16;
break;
case R_IMM32:
internal->howto = &r_imm32;
break;
@ -106,9 +132,9 @@ rtype2howto (internal, dst)
}
}
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry)
/* Perform any necessary magic to the addend in a reloc entry */
/* Perform any necessary magic to the addend in a reloc entry. */
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
cache_ptr->addend = ext_reloc.r_offset;
@ -119,7 +145,7 @@ rtype2howto (internal, dst)
static void
reloc_processing (relent, reloc, symbols, abfd, section)
arelent * relent;
struct internal_reloc *reloc;
struct internal_reloc * reloc;
asymbol ** symbols;
bfd * abfd;
asection * section;
@ -128,13 +154,9 @@ reloc_processing (relent, reloc, symbols, abfd, section)
rtype2howto (relent, reloc);
if (reloc->r_symndx > 0)
{
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
}
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
else
{
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
}
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
relent->addend = reloc->r_offset;
relent->address -= section->vma;
@ -142,15 +164,15 @@ reloc_processing (relent, reloc, symbols, abfd, section)
static void
extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
bfd *in_abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
arelent *reloc;
bfd_byte *data;
unsigned int *src_ptr;
unsigned int *dst_ptr;
bfd * in_abfd;
struct bfd_link_info * link_info;
struct bfd_link_order * link_order;
arelent * reloc;
bfd_byte * data;
unsigned int * src_ptr;
unsigned int * dst_ptr;
{
asection *input_section = link_order->u.indirect.section;
asection * input_section = link_order->u.indirect.section;
switch (reloc->howto->type)
{
@ -164,7 +186,8 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
case R_IMM32:
bfd_put_32 (in_abfd,
bfd_coff_reloc16_get_value (reloc, link_info, input_section),
/* 0x80000000 indicates a long segmented address. */
bfd_coff_reloc16_get_value (reloc, link_info, input_section) | 0x80000000,
data + *dst_ptr);
(*dst_ptr) += 4;
(*src_ptr) += 4;
@ -196,8 +219,8 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
bfd_vma dot = (link_order->offset
+ *dst_ptr
+ input_section->output_section->vma);
int gap = dst - dot - 1;/* -1 since were in the odd byte of the
word and the pc's been incremented */
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
word and the pc's been incremented. */
if (gap & 1)
abort ();
@ -215,6 +238,88 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
(*src_ptr)++;
break;
}
case R_DISP7:
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
word and the pc's been incremented. */
if (gap & 1)
abort ();
gap /= 2;
if (gap > 0 || gap < -128)
{
if (! ((*link_info->callbacks->reloc_overflow)
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (in_abfd,
(bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f),
data + *dst_ptr);
(*dst_ptr)++;
(*src_ptr)++;
break;
}
case R_CALLR:
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
+ input_section->output_section->vma);
int gap = dst - dot - 2;
if (gap & 1)
abort ();
gap /= 2;
if (gap > 8191 || gap < -8192)
{
if (! ((*link_info->callbacks->reloc_overflow)
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_16 (in_abfd,
(bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff),
data + *dst_ptr);
(*dst_ptr) += 2;
(*src_ptr) += 2;
break;
}
case R_REL16:
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
+ input_section->output_section->vma);
int gap = dst - dot - 2;
if (gap > 32767 || gap < -32768)
{
if (! ((*link_info->callbacks->reloc_overflow)
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_16 (in_abfd, (bfd_vma) gap, data + *dst_ptr);
(*dst_ptr) += 2;
(*src_ptr) += 2;
break;
}
default:
abort ();
}

View File

@ -4443,16 +4443,14 @@ coff_slurp_symbol_table (abfd)
#ifdef COFF_WITH_PE
if (src->u.syment.n_sclass == C_NT_WEAK)
dst->symbol.flags = BSF_WEAK;
dst->symbol.flags |= BSF_WEAK;
if (src->u.syment.n_sclass == C_SECTION
&& src->u.syment.n_scnum > 0)
{
dst->symbol.flags = BSF_LOCAL;
}
dst->symbol.flags = BSF_LOCAL;
#endif
if (src->u.syment.n_sclass == C_WEAKEXT)
dst->symbol.flags = BSF_WEAK;
dst->symbol.flags |= BSF_WEAK;
break;

View File

@ -1,5 +1,5 @@
/* COFF specific linker code.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
@ -1005,7 +1005,8 @@ _bfd_coff_final_link (abfd, info)
if (info->task_link)
{
finfo.failed = false;
coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_task_globals,
coff_link_hash_traverse (coff_hash_table (info),
_bfd_coff_write_task_globals,
(PTR) &finfo);
if (finfo.failed)
goto error_return;
@ -1013,7 +1014,8 @@ _bfd_coff_final_link (abfd, info)
/* Write out the global symbols. */
finfo.failed = false;
coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym,
coff_link_hash_traverse (coff_hash_table (info),
_bfd_coff_write_global_sym,
(PTR) &finfo);
if (finfo.failed)
goto error_return;
@ -2497,6 +2499,13 @@ _bfd_coff_write_global_sym (h, data)
output_bfd = finfo->output_bfd;
if (h->root.type == bfd_link_hash_warning)
{
h = (struct coff_link_hash_entry *) h->root.u.i.link;
if (h->root.type == bfd_link_hash_new)
return true;
}
if (h->indx >= 0)
return true;
@ -2512,6 +2521,7 @@ _bfd_coff_write_global_sym (h, data)
{
default:
case bfd_link_hash_new:
case bfd_link_hash_warning:
abort ();
return false;
@ -2544,7 +2554,6 @@ _bfd_coff_write_global_sym (h, data)
break;
case bfd_link_hash_indirect:
case bfd_link_hash_warning:
/* Just ignore these. They can't be handled anyhow. */
return true;
}
@ -2699,6 +2708,9 @@ _bfd_coff_write_task_globals (h, data)
boolean rtnval = true;
boolean save_global_to_static;
if (h->root.type == bfd_link_hash_warning)
h = (struct coff_link_hash_entry *) h->root.u.i.link;
if (h->indx < 0)
{
switch (h->root.type)

View File

@ -160,9 +160,15 @@
/* Define if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have the <time.h> header file. */
#undef HAVE_TIME_H

View File

@ -1116,7 +1116,7 @@ fi
PACKAGE=bfd
VERSION=2.12
VERSION=2.12.1
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@ -1199,7 +1199,7 @@ fi
# Uncomment the next line to remove the date from the reported bfd version
is_release=y
#is_release=y
bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`

View File

@ -7,9 +7,9 @@ AC_INIT(libbfd.c)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
AM_INIT_AUTOMAKE(bfd, 2.12)
AM_INIT_AUTOMAKE(bfd, 2.12.1)
# Uncomment the next line to remove the date from the reported bfd version
is_release=y
#is_release=y
changequote(,)dnl
bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`

View File

@ -1,5 +1,5 @@
/* BFD support for the Intel 386 architecture.
Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001
Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.

View File

@ -1,5 +1,6 @@
/* bfd back-end for mips support
Copyright (C) 1990, 91-97, 1998 Free Software Foundation, Inc.
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -22,6 +23,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
static const bfd_arch_info_type *mips_compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
/* The default routine tests bits_per_word, which is wrong on mips as
mips word size doesn't correlate with reloc size. */
static const bfd_arch_info_type *
mips_compatible (a, b)
const bfd_arch_info_type *a;
const bfd_arch_info_type *b;
{
if (a->arch != b->arch)
return NULL;
if (a->mach > b->mach)
return a;
if (b->mach > a->mach)
return b;
return a;
}
#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
{ \
BITS_WORD, /* bits in a word */ \
@ -33,51 +57,59 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
PRINT, \
3, \
DEFAULT, \
bfd_default_compatible, \
mips_compatible, \
bfd_default_scan, \
NEXT, \
}
enum {
I_mips3000,
I_mips3900,
I_mips4000,
I_mips4010,
I_mips4100,
I_mips4111,
I_mips4300,
I_mips4400,
I_mips4600,
I_mips4650,
I_mips5000,
I_mips6000,
I_mips8000,
I_mips10000,
I_mips16
enum
{
I_mips3000,
I_mips3900,
I_mips4000,
I_mips4010,
I_mips4100,
I_mips4111,
I_mips4300,
I_mips4400,
I_mips4600,
I_mips4650,
I_mips5000,
I_mips6000,
I_mips8000,
I_mips10000,
I_mips12000,
I_mips16,
I_mips5,
I_mipsisa32,
I_mipsisa64,
I_sb1,
};
#define NN(index) (&arch_info_struct[(index) + 1])
#define NN(index) (&arch_info_struct[(index)+1])
static const bfd_arch_info_type arch_info_struct[] =
static const bfd_arch_info_type arch_info_struct[] =
{
N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)),
N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)),
N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)),
N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)),
N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)),
N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)),
N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)),
N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)),
N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)),
N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)),
N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)),
N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)),
N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)),
N (64, 64, bfd_mach_mips10000, "mips:10000", false, NN(I_mips10000)),
N (64, 64, bfd_mach_mips16, "mips:16", false, 0),
N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)),
N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)),
N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)),
N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)),
N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)),
N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)),
N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)),
N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)),
N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)),
N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)),
N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)),
N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)),
N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)),
N (64, 64, bfd_mach_mips10000,"mips:10000", false, NN(I_mips10000)),
N (64, 64, bfd_mach_mips12000,"mips:12000", false, NN(I_mips12000)),
N (64, 64, bfd_mach_mips16, "mips:16", false, NN(I_mips16)),
N (64, 64, bfd_mach_mips5, "mips:mips5", false, NN(I_mips5)),
N (32, 32, bfd_mach_mipsisa32, "mips:isa32", false, NN(I_mipsisa32)),
N (64, 64, bfd_mach_mipsisa64, "mips:isa64", false, NN(I_mipsisa64)),
N (64, 64, bfd_mach_mips_sb1, "mips:sb1", false, 0),
};
/* The default architecture is mips:3000, but with a machine number of

View File

@ -1,5 +1,6 @@
/* BFD support for the SPARC architecture.
Copyright 1992, 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
Copyright 1992, 1995, 1996, 1998, 2000, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -21,22 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
/* Don't mix 32 bit and 64 bit files. */
static const bfd_arch_info_type *sparc_compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
static const bfd_arch_info_type *
sparc_compatible (a, b)
const bfd_arch_info_type *a;
const bfd_arch_info_type *b;
{
if (a->bits_per_word != b->bits_per_word)
return NULL;
return bfd_default_compatible (a, b);
}
static const bfd_arch_info_type arch_info_struct[] =
{
{
@ -49,7 +34,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:sparclet",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[1],
},
@ -63,7 +48,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:sparclite",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[2],
},
@ -77,7 +62,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v8plus",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[3],
},
@ -91,7 +76,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v8plusa",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[4],
},
@ -105,7 +90,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:sparclite_le",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[5],
},
@ -119,7 +104,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v9",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[6],
},
@ -133,7 +118,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v9a",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[7],
},
@ -147,7 +132,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v8plusb",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[8],
},
@ -161,7 +146,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v9b",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
0,
}
@ -178,7 +163,7 @@ const bfd_arch_info_type bfd_sparc_arch =
"sparc",
3,
true, /* the default */
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[0],
};

View File

@ -1,5 +1,5 @@
/* BFD support for the NEC V850 processor
Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -20,8 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "safe-ctype.h"
#include <ctype.h>
static boolean scan PARAMS ((const struct bfd_arch_info *, const char *));
static boolean
scan (info, string)
@ -33,38 +34,34 @@ scan (info, string)
unsigned long number;
enum bfd_architecture arch;
/* First test for an exact match */
/* First test for an exact match. */
if (strcasecmp (string, info->printable_name) == 0)
return true;
/* See how much of the supplied string matches with the
architecture, eg the string m68k:68020 would match the m68k entry
up to the :, then we get left with the machine number */
up to the :, then we get left with the machine number. */
for (ptr_src = string, ptr_tst = info->arch_name;
*ptr_src && *ptr_tst;
ptr_src++, ptr_tst++)
{
if (*ptr_src != *ptr_tst) break;
}
if (*ptr_src != *ptr_tst)
break;
/* Chewed up as much of the architecture as will match, skip any
colons */
/* Chewed up as much of the architecture as will match;
if there is a colon present skip it. */
if (*ptr_src == ':')
ptr_src++;
ptr_src ++;
if (*ptr_src == 0)
{
/* nothing more, then only keep this one if it is the default
machine for this architecture */
return info->the_default;
}
/* Nothing more, then only keep this one if it is
the default machine for this architecture. */
return info->the_default;
number = 0;
while (isdigit ((unsigned char) *ptr_src))
while (ISDIGIT (*ptr_src))
{
number = number * 10 + * ptr_src - '0';
ptr_src++;
ptr_src ++;
}
switch (number)
@ -92,12 +89,12 @@ scan (info, string)
static const bfd_arch_info_type arch_info_struct[] =
{
N (bfd_mach_v850e, "v850e", false, &arch_info_struct[1]),
N (bfd_mach_v850e, "v850e", false, & arch_info_struct[1]),
N (bfd_mach_v850ea, "v850ea", false, NULL)
};
#undef NEXT
#define NEXT &arch_info_struct[0]
#undef NEXT
#define NEXT & arch_info_struct[0]
const bfd_arch_info_type bfd_v850_arch =
N (bfd_mach_v850, "v850", true, NEXT);

View File

@ -1,5 +1,5 @@
/* BFD library support routines for the Z800n architecture.
Copyright 1992, 1993, 1994, 2000 Free Software Foundation, Inc.
Copyright 1992, 1993, 1994, 2000, 2001 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -22,6 +22,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
static boolean scan_mach
PARAMS ((const struct bfd_arch_info *, const char *));
static const bfd_arch_info_type *compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
#if 0 /* not used currently */
/*
Relocations for the Z8K
@ -148,8 +153,6 @@ local_bfd_reloc_type_lookup (arch, code)
}
#endif
int bfd_default_scan_num_mach ();
static boolean
scan_mach (info, string)
const struct bfd_arch_info *info;

View File

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

View File

@ -1,3 +1,7 @@
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* Makefile.in: Regenerate.
2002-02-01 Alan Modra <amodra@bigpond.net.au>
* chew.c (WORD): Eliminate.

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -242,7 +242,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
@ -328,7 +328,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)

View File

@ -240,9 +240,10 @@ static void arange_add PARAMS ((struct comp_unit *, bfd_vma, bfd_vma));
static struct line_info_table *decode_line_info
PARAMS ((struct comp_unit *, struct dwarf2_debug *));
static boolean lookup_address_in_line_info_table
PARAMS ((struct line_info_table *, bfd_vma, const char **, unsigned int *));
PARAMS ((struct line_info_table *, bfd_vma, struct funcinfo *,
const char **, unsigned int *));
static boolean lookup_address_in_function_table
PARAMS ((struct funcinfo *, bfd_vma, const char **));
PARAMS ((struct funcinfo *, bfd_vma, struct funcinfo **, const char **));
static boolean scan_unit_for_functions PARAMS ((struct comp_unit *));
static bfd_vma find_rela_addend
PARAMS ((bfd *, asection *, bfd_size_type, asymbol**));
@ -808,6 +809,14 @@ struct line_info_table
struct line_info* last_line;
};
struct funcinfo
{
struct funcinfo *prev_func;
char* name;
bfd_vma low;
bfd_vma high;
};
static void
add_line_info (table, address, filename, line, column, end_sequence)
struct line_info_table* table;
@ -1215,10 +1224,12 @@ decode_line_info (unit, stash)
static boolean
lookup_address_in_line_info_table (table,
addr,
function,
filename_ptr,
linenumber_ptr)
struct line_info_table* table;
bfd_vma addr;
struct funcinfo *function;
const char **filename_ptr;
unsigned int *linenumber_ptr;
{
@ -1235,35 +1246,53 @@ lookup_address_in_line_info_table (table,
if (!each_line->end_sequence
&& addr >= each_line->address && addr < next_line->address)
{
*filename_ptr = each_line->filename;
*linenumber_ptr = each_line->line;
/* If this line appears to span functions, and addr is in the
later function, return the first line of that function instead
of the last line of the earlier one. This check is for GCC
2.95, which emits the first line number for a function late. */
if (function != NULL
&& each_line->address < function->low
&& next_line->address > function->low)
{
*filename_ptr = next_line->filename;
*linenumber_ptr = next_line->line;
}
else
{
*filename_ptr = each_line->filename;
*linenumber_ptr = each_line->line;
}
return true;
}
next_line = each_line;
each_line = each_line->prev_line;
}
/* At this point each_line is NULL but next_line is not. If we found the
containing function in this compilation unit, return the first line we
have a number for. This is also for compatibility with GCC 2.95. */
if (function != NULL)
{
*filename_ptr = next_line->filename;
*linenumber_ptr = next_line->line;
return true;
}
return false;
}
/* Function table functions. */
struct funcinfo
{
struct funcinfo *prev_func;
char* name;
bfd_vma low;
bfd_vma high;
};
/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return true. */
static boolean
lookup_address_in_function_table (table,
addr,
function_ptr,
functionname_ptr)
struct funcinfo* table;
bfd_vma addr;
struct funcinfo** function_ptr;
const char **functionname_ptr;
{
struct funcinfo* each_func;
@ -1275,6 +1304,7 @@ lookup_address_in_function_table (table,
if (addr >= each_func->low && addr < each_func->high)
{
*functionname_ptr = each_func->name;
*function_ptr = each_func;
return true;
}
}
@ -1636,6 +1666,7 @@ comp_unit_find_nearest_line (unit, addr,
{
boolean line_p;
boolean func_p;
struct funcinfo *function;
if (unit->error)
return false;
@ -1664,13 +1695,16 @@ comp_unit_find_nearest_line (unit, addr,
}
}
line_p = lookup_address_in_line_info_table (unit->line_table,
addr,
filename_ptr,
linenumber_ptr);
function = NULL;
func_p = lookup_address_in_function_table (unit->function_table,
addr,
&function,
functionname_ptr);
line_p = lookup_address_in_line_info_table (unit->line_table,
addr,
function,
filename_ptr,
linenumber_ptr);
return line_p || func_p;
}

View File

@ -1,5 +1,5 @@
/* Generic ECOFF (Extended-COFF) routines.
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@ -4393,6 +4393,13 @@ ecoff_link_write_external (h, data)
bfd *output_bfd = einfo->abfd;
boolean strip;
if (h->root.type == bfd_link_hash_warning)
{
h = (struct ecoff_link_hash_entry *) h->root.u.i.link;
if (h->root.type == bfd_link_hash_new)
return true;
}
/* We need to check if this symbol is being stripped. */
if (h->root.type == bfd_link_hash_undefined
|| h->root.type == bfd_link_hash_undefweak)
@ -4474,6 +4481,7 @@ ecoff_link_write_external (h, data)
switch (h->root.type)
{
default:
case bfd_link_hash_warning:
case bfd_link_hash_new:
abort ();
case bfd_link_hash_undefined:
@ -4502,9 +4510,8 @@ ecoff_link_write_external (h, data)
h->esym.asym.value = h->root.u.c.size;
break;
case bfd_link_hash_indirect:
case bfd_link_hash_warning:
/* FIXME: Ignore these for now. The circumstances under which
they should be written out are not clear to me. */
/* We ignore these symbols, since the indirected symbol is
already in the hash table. */
return true;
}

View File

@ -1531,6 +1531,8 @@ extern char *elfcore_write_prfpreg
PARAMS ((bfd *, char *, int *, void *, int));
extern char *elfcore_write_prxfpreg
PARAMS ((bfd *, char *, int *, void *, int));
extern char *elfcore_write_lwpstatus
PARAMS ((bfd*, char*, int*, long, int, void*));
/* MIPS ELF specific routines. */

View File

@ -652,27 +652,44 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name)
offset plus size lies within the segment's memory
span and, if the section is loaded, the extent of the
loaded data lies within the extent of the segment.
If the p_paddr field is not set, we don't alter the
LMA. */
Note - we used to check the p_paddr field as well, and
refuse to set the LMA if it was 0. This is wrong
though, as a perfectly valid initialised segment can
have a p_paddr of zero. Some architectures, eg ARM,
place special significance on the address 0 and
executables need to be able to have a segment which
covers this address. */
if (phdr->p_type == PT_LOAD
&& phdr->p_paddr
&& (bfd_vma) hdr->sh_offset >= phdr->p_offset
&& (hdr->sh_offset + hdr->sh_size
<= phdr->p_offset + phdr->p_memsz)
&& ((flags & SEC_LOAD) == 0
|| (phdr->p_offset + phdr->p_filesz
>= hdr->sh_offset + hdr->sh_size)))
|| (hdr->sh_offset + hdr->sh_size
<= phdr->p_offset + phdr->p_filesz)))
{
/* We used to do a relative adjustment here, but
that doesn't work if the segment is packed with
code from multiple VMAs. Instead we calculate
the LMA absoultely, based on the LMA of the
segment (it is assumed that the segment will
contain sections with contiguous LMAs, even if
the VMAs are not). */
newsect->lma = phdr->p_paddr
+ hdr->sh_offset - phdr->p_offset;
break;
if ((flags & SEC_LOAD) == 0)
newsect->lma = (phdr->p_paddr
+ hdr->sh_addr - phdr->p_vaddr);
else
/* We used to use the same adjustment for SEC_LOAD
sections, but that doesn't work if the segment
is packed with code from multiple VMAs.
Instead we calculate the section LMA based on
the segment LMA. It is assumed that the
segment will contain sections with contiguous
LMAs, even if the VMAs are not. */
newsect->lma = (phdr->p_paddr
+ hdr->sh_offset - phdr->p_offset);
/* With contiguous segments, we can't tell from file
offsets whether a section with zero size should
be placed at the end of one segment or the
beginning of the next. Decide based on vaddr. */
if (hdr->sh_addr >= phdr->p_vaddr
&& (hdr->sh_addr + hdr->sh_size
<= phdr->p_vaddr + phdr->p_memsz))
break;
}
}
}
@ -1558,6 +1575,9 @@ bfd_section_from_shdr (abfd, shindex)
case SHT_NOBITS: /* .bss section. */
case SHT_HASH: /* .hash section. */
case SHT_NOTE: /* .note section. */
case SHT_INIT_ARRAY: /* .init_array section. */
case SHT_FINI_ARRAY: /* .fini_array section. */
case SHT_PREINIT_ARRAY: /* .preinit_array section. */
return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
case SHT_SYMTAB: /* A symbol table */
@ -2172,6 +2192,12 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr->sh_type = SHT_REL;
this_hdr->sh_entsize = bed->s->sizeof_rel;
}
else if (strcmp (asect->name, ".init_array") == 0)
this_hdr->sh_type = SHT_INIT_ARRAY;
else if (strcmp (asect->name, ".fini_array") == 0)
this_hdr->sh_type = SHT_FINI_ARRAY;
else if (strcmp (asect->name, ".preinit_array") == 0)
this_hdr->sh_type = SHT_PREINIT_ARRAY;
else if (strncmp (asect->name, ".note", 5) == 0)
this_hdr->sh_type = SHT_NOTE;
else if (strncmp (asect->name, ".stab", 5) == 0
@ -5096,7 +5122,9 @@ _bfd_elf_get_symtab_upper_bound (abfd)
Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->symtab_hdr;
symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
symtab_size = (symcount + 1) * (sizeof (asymbol *));
if (symcount > 0)
symtab_size -= sizeof (asymbol *);
return symtab_size;
}
@ -5116,7 +5144,9 @@ _bfd_elf_get_dynamic_symtab_upper_bound (abfd)
}
symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
symtab_size = (symcount + 1) * (sizeof (asymbol *));
if (symcount > 0)
symtab_size -= sizeof (asymbol *);
return symtab_size;
}
@ -6149,6 +6179,8 @@ elfcore_grok_psinfo (abfd, note)
#endif /* defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) */
#if defined (HAVE_PSTATUS_T)
static boolean elfcore_grok_pstatus PARAMS ((bfd *, Elf_Internal_Note *));
static boolean
elfcore_grok_pstatus (abfd, note)
bfd *abfd;
@ -6186,6 +6218,8 @@ elfcore_grok_pstatus (abfd, note)
#endif /* defined (HAVE_PSTATUS_T) */
#if defined (HAVE_LWPSTATUS_T)
static boolean elfcore_grok_lwpstatus PARAMS ((bfd *, Elf_Internal_Note *));
static boolean
elfcore_grok_lwpstatus (abfd, note)
bfd *abfd;
@ -6416,7 +6450,7 @@ elfcore_netbsd_get_lwpid (note, lwpidp)
cp = strchr (note->namedata, '@');
if (cp != NULL)
{
*lwpidp = atoi(cp);
*lwpidp = atoi(cp + 1);
return true;
}
return false;
@ -6599,6 +6633,38 @@ elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs)
}
#endif /* HAVE_PRSTATUS_T */
#if defined (HAVE_LWPSTATUS_T)
char *
elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs)
bfd *abfd;
char *buf;
int *bufsiz;
long pid;
int cursig;
void *gregs;
{
lwpstatus_t lwpstat;
char *note_name = "CORE";
memset (&lwpstat, 0, sizeof (lwpstat));
lwpstat.pr_lwpid = pid >> 16;
lwpstat.pr_cursig = cursig;
#if defined (HAVE_LWPSTATUS_T_PR_REG)
memcpy (lwpstat.pr_reg, gregs, sizeof (lwpstat.pr_reg));
#elif defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
#if !defined(gregs)
memcpy (lwpstat.pr_context.uc_mcontext.gregs,
gregs, sizeof (lwpstat.pr_context.uc_mcontext.gregs));
#else
memcpy (lwpstat.pr_context.uc_mcontext.__gregs,
gregs, sizeof (lwpstat.pr_context.uc_mcontext.__gregs));
#endif
#endif
return elfcore_write_note (abfd, buf, bufsiz, note_name,
NT_LWPSTATUS, &lwpstat, sizeof (lwpstat));
}
#endif /* HAVE_LWPSTATUS_T */
#if defined (HAVE_PSTATUS_T)
char *
elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs)
@ -6612,11 +6678,11 @@ elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs)
pstatus_t pstat;
char *note_name = "CORE";
memset (&pstat, 0, sizeof (prstat));
pstat.pr_pid = pid;
memcpy (pstat.pr_reg, gregs, sizeof (pstat.pr_reg));
return elfcore_write_note (abfd, buf, bufsiz,
note_name, NT_PSTATUS, &pstat, sizeof (pstat));
memset (&pstat, 0, sizeof (pstat));
pstat.pr_pid = pid & 0xffff;
buf = elfcore_write_note (abfd, buf, bufsiz, note_name,
NT_PSTATUS, &pstat, sizeof (pstat));
return buf;
}
#endif /* HAVE_PSTATUS_T */

View File

@ -1560,6 +1560,12 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
if (sgot == NULL)
return bfd_reloc_notsupported;
/* If we are addressing a Thumb function, we need to adjust the
address by one, so that attempts to call the function pointer will
correctly interpret it as Thumb code. */
if (sym_flags == STT_ARM_TFUNC)
value += 1;
/* Note that sgot->output_offset is not involved in this
calculation. We always want the start of .got. If we
define _GLOBAL_OFFSET_TABLE in a different way, as is
@ -1612,6 +1618,13 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
off &= ~1;
else
{
/* If we are addressing a Thumb function, we need to
adjust the address by one, so that attempts to
call the function pointer will correctly
interpret it as Thumb code. */
if (sym_flags == STT_ARM_TFUNC)
value |= 1;
bfd_put_32 (output_bfd, value, sgot->contents + off);
h->got.offset |= 1;
}
@ -3275,6 +3288,9 @@ elf32_arm_discard_copies (h, ignore)
{
struct elf32_arm_pcrel_relocs_copied * s;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct elf32_arm_link_hash_entry *) h->root.root.u.i.link;
/* We only discard relocs for symbols defined in a regular object. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;

View File

@ -1,5 +1,5 @@
/* Intel 80386/80486-specific support for 32-bit ELF
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -847,11 +847,10 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
{
const char *name;
bfd *dynobj;
unsigned int strndx = elf_elfheader (abfd)->e_shstrndx;
unsigned int shnam = elf_section_data (sec)->rel_hdr.sh_name;
name = (bfd_elf_string_from_elf_section
(abfd,
elf_elfheader (abfd)->e_shstrndx,
elf_section_data (sec)->rel_hdr.sh_name));
name = bfd_elf_string_from_elf_section (abfd, strndx, shnam);
if (name == NULL)
return false;
@ -1251,10 +1250,15 @@ allocate_dynrelocs (h, inf)
struct elf_i386_link_hash_entry *eh;
struct elf_i386_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
if (h->root.type == bfd_link_hash_indirect)
return true;
if (h->root.type == bfd_link_hash_warning)
/* When warning symbols are created, they **replace** the "real"
entry in the hash table, thus we never get to see the real
symbol in a hash traversal. So look at it now. */
h = (struct elf_link_hash_entry *) h->root.u.i.link;
info = (struct bfd_link_info *) inf;
htab = elf_i386_hash_table (info);
@ -1421,6 +1425,9 @@ readonly_dynrelocs (h, inf)
struct elf_i386_link_hash_entry *eh;
struct elf_i386_dyn_relocs *p;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
eh = (struct elf_i386_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{

File diff suppressed because it is too large Load Diff

View File

@ -1084,6 +1084,17 @@ elf32_sparc_relax_section (abfd, section, link_info, again)
return true;
}
/* This is the condition under which finish_dynamic_symbol will be called
from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol
routine, we'll need to do something about initializing any .plt and .got
entries in relocate_section. */
#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
((DYN) \
&& ((INFO)->shared \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
/* Relocate a SPARC ELF section. */
static boolean
@ -1133,9 +1144,10 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation;
bfd_vma relocation, off;
bfd_reloc_status_type r;
boolean is_plt = false;
boolean unresolved_reloc;
r_type = ELF32_R_TYPE (rel->r_info);
@ -1175,6 +1187,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
h = NULL;
sym = NULL;
sec = NULL;
unresolved_reloc = false;
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
@ -1187,71 +1200,30 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
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;
relocation = 0;
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
sec = h->root.u.def.section;
if (((r_type == R_SPARC_WPLT30
|| r_type == R_SPARC_PLT32)
&& h->plt.offset != (bfd_vma) -1)
|| ((r_type == R_SPARC_GOT10
|| r_type == R_SPARC_GOT13
|| r_type == R_SPARC_GOT22)
&& elf_hash_table (info)->dynamic_sections_created
&& (! info->shared
|| (! info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|| (info->shared
&& ((! info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)
&& (r_type == R_SPARC_8
|| r_type == R_SPARC_16
|| r_type == R_SPARC_32
|| r_type == R_SPARC_DISP8
|| r_type == R_SPARC_DISP16
|| r_type == R_SPARC_DISP32
|| r_type == R_SPARC_WDISP30
|| r_type == R_SPARC_WDISP22
|| r_type == R_SPARC_WDISP19
|| r_type == R_SPARC_WDISP16
|| r_type == R_SPARC_HI22
|| r_type == R_SPARC_22
|| r_type == R_SPARC_13
|| r_type == R_SPARC_LO10
|| r_type == R_SPARC_UA16
|| r_type == R_SPARC_UA32
|| ((r_type == R_SPARC_PC10
|| r_type == R_SPARC_PC22)
&& strcmp (h->root.root.string,
"_GLOBAL_OFFSET_TABLE_") != 0))
&& ((input_section->flags & SEC_ALLOC) != 0
/* DWARF will emit R_SPARC_32 relocations in its
sections against symbols defined externally
in shared libraries. We can't do anything
with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
{
/* In these cases, we don't need the relocation
value. We check specially because in some
obscure cases sec->output_section will be NULL. */
relocation = 0;
}
if (sec->output_section == NULL)
/* Set a flag that will be cleared later if we find a
relocation value for this symbol. output_section
is typically NULL for symbols satisfied by a shared
library. */
unresolved_reloc = true;
else
relocation = (h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset);
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
;
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
;
else
{
if (! ((*info->callbacks->undefined_symbol)
@ -1260,7 +1232,6 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
(!info->shared || info->no_undefined
|| ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}
}
@ -1279,14 +1250,17 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL)
{
bfd_vma off;
boolean dyn;
off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
dyn = elf_hash_table (info)->dynamic_sections_created;
if (! elf_hash_table (info)->dynamic_sections_created
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
|| (info->shared
&& (info->symbolic || h->dynindx == -1)
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a
@ -1310,13 +1284,11 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
h->got.offset |= 1;
}
}
relocation = sgot->output_offset + off - got_base;
else
unresolved_reloc = false;
}
else
{
bfd_vma off;
BFD_ASSERT (local_got_offsets != NULL
&& local_got_offsets[r_symndx] != (bfd_vma) -1);
@ -1355,10 +1327,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
local_got_offsets[r_symndx] |= 1;
}
relocation = sgot->output_offset + off - got_base;
}
relocation = sgot->output_offset + off - got_base;
break;
case R_SPARC_PLT32:
@ -1396,6 +1366,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset);
unresolved_reloc = false;
if (r_type == R_SPARC_PLT32)
{
r_type = R_SPARC_32;
@ -1496,6 +1467,17 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
if (!(outrel.r_offset & 3))
r_type = R_SPARC_32;
break;
case R_SPARC_DISP8:
case R_SPARC_DISP16:
case R_SPARC_DISP32:
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_SPARC_NONE.
FIXME: Add code tracking needed dynamic relocs as
e.g. i386 has. */
if (h->dynindx == -1)
skip = true, relocate = true;
break;
}
if (skip)
@ -1582,6 +1564,18 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
/* ??? Copied from elf32-i386.c, debugging section check and all. */
if (unresolved_reloc
&& !(info->shared
&& (input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset,
h->root.root.string);
r = bfd_reloc_continue;
if (r_type == R_SPARC_WDISP16)
{

View File

@ -27,9 +27,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/v850.h"
#include "libiberty.h"
/* sign-extend a 24-bit number */
#define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000)
/* Sign-extend a 24-bit number. */
#define SEXT24(x) ((((x) & 0xffffff) ^ 0x800000) - 0x800000)
static reloc_howto_type *v850_elf_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
@ -45,7 +46,7 @@ static boolean v850_elf_relocate_section
PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
static bfd_reloc_status_type v850_elf_perform_relocation
PARAMS ((bfd *, int, bfd_vma, bfd_byte *));
PARAMS ((bfd *, unsigned int, bfd_vma, bfd_byte *));
static boolean v850_elf_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *));
static void remember_hi16s_reloc
@ -63,14 +64,12 @@ static void v850_elf_final_write_processing
PARAMS ((bfd *, boolean));
static boolean v850_elf_set_private_flags
PARAMS ((bfd *, flagword));
static boolean v850_elf_copy_private_bfd_data
PARAMS ((bfd *, bfd *));
static boolean v850_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
static boolean v850_elf_print_private_bfd_data
PARAMS ((bfd *, PTR));
static boolean v850_elf_section_from_bfd_section
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *));
PARAMS ((bfd *, asection *, int *));
static void v850_elf_symbol_processing
PARAMS ((bfd *, asymbol *));
static boolean v850_elf_add_symbol_hook
@ -81,9 +80,16 @@ static boolean v850_elf_link_output_symbol_hook
Elf_Internal_Sym *, asection *));
static boolean v850_elf_section_from_shdr
PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
static boolean v850_elf_gc_sweep_hook
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
static asection * v850_elf_gc_mark_hook
PARAMS ((bfd *, struct bfd_link_info *,
Elf_Internal_Rela *, struct elf_link_hash_entry *,
Elf_Internal_Sym *));
/* Note: It is REQUIRED that the 'type' value of each entry in this array
match the index of the entry in the array. */
/* Note: It is REQUIRED that the 'type' value of each entry
in this array match the index of the entry in the array. */
static reloc_howto_type v850_elf_howto_table[] =
{
/* This reloc does nothing. */
@ -470,7 +476,7 @@ struct v850_elf_reloc_map
/* BFD_RELOC_V850_CALLT_16_16_OFFSET is 258, which will not fix in an
unsigned char. */
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
unsigned int elf_reloc_val;
};
static const struct v850_elf_reloc_map v850_elf_reloc_map[] =
@ -503,7 +509,8 @@ static const struct v850_elf_reloc_map v850_elf_reloc_map[] =
};
/* Map a bfd relocation into the appropriate howto structure */
/* Map a bfd relocation into the appropriate howto structure. */
static reloc_howto_type *
v850_elf_reloc_type_lookup (abfd, code)
bfd * abfd ATTRIBUTE_UNUSED;
@ -511,22 +518,21 @@ v850_elf_reloc_type_lookup (abfd, code)
{
unsigned int i;
for (i = 0;
i < sizeof (v850_elf_reloc_map) / sizeof (struct v850_elf_reloc_map);
i++)
{
if (v850_elf_reloc_map[i].bfd_reloc_val == code)
{
BFD_ASSERT (v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val].type == v850_elf_reloc_map[i].elf_reloc_val);
for (i = ARRAY_SIZE (v850_elf_reloc_map); i --;)
if (v850_elf_reloc_map[i].bfd_reloc_val == code)
{
unsigned int elf_reloc_val = v850_elf_reloc_map[i].elf_reloc_val;
return & v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val];
}
}
BFD_ASSERT (v850_elf_howto_table[elf_reloc_val].type == elf_reloc_val);
return v850_elf_howto_table + elf_reloc_val;
}
return NULL;
}
/* Set the howto pointer for an V850 ELF reloc. */
static void
v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED;
@ -582,7 +588,7 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
#ifdef DEBUG
fprintf (stderr, "v850_elf_check_relocs called for section %s in %s\n",
bfd_get_section_name (abfd, sec),
bfd_get_filename (abfd));
bfd_archive_filename (abfd));
#endif
dynobj = elf_hash_table (info)->dynobj;
@ -626,8 +632,8 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
return false;
break;
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
/* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
case R_V850_GNU_VTENTRY:
if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return false;
@ -662,7 +668,8 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
small_data_common:
if (h)
{
h->other |= other; /* flag which type of relocation was used */
/* Flag which type of relocation was used. */
h->other |= other;
if ((h->other & V850_OTHER_MASK) != (other & V850_OTHER_MASK)
&& (h->other & V850_OTHER_ERROR) == 0)
{
@ -690,7 +697,8 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
sprintf (buff, msg, h->root.root.string);
info->callbacks->warning (info, buff, h->root.root.string,
abfd, h->root.u.def.section, 0);
abfd, h->root.u.def.section,
(bfd_vma) 0);
bfd_set_error (bfd_error_bad_value);
h->other |= V850_OTHER_ERROR;
@ -702,7 +710,9 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
&& h->root.u.c.p
&& !strcmp (bfd_get_section_name (abfd, h->root.u.c.p->section), "COMMON"))
{
asection *section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common);
asection * section;
section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common);
section->flags |= SEC_IS_COMMON;
}
@ -719,20 +729,18 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
return ret;
}
/*
* In the old version, when an entry was checked out from the table,
* it was deleted. This produced an error if the entry was needed
* more than once, as the second attempted retry failed.
*
* In the current version, the entry is not deleted, instead we set
* the field 'found' to true. If a second lookup matches the same
* entry, then we know that the hi16s reloc has already been updated
* and does not need to be updated a second time.
*
* TODO - TOFIX: If it is possible that we need to restore 2 different
* addresses from the same table entry, where the first generates an
* overflow, whilst the second do not, then this code will fail.
*/
/* In the old version, when an entry was checked out from the table,
it was deleted. This produced an error if the entry was needed
more than once, as the second attempted retry failed.
In the current version, the entry is not deleted, instead we set
the field 'found' to true. If a second lookup matches the same
entry, then we know that the hi16s reloc has already been updated
and does not need to be updated a second time.
TODO - TOFIX: If it is possible that we need to restore 2 different
addresses from the same table entry, where the first generates an
overflow, whilst the second do not, then this code will fail. */
typedef struct hi16s_location
{
@ -755,10 +763,11 @@ remember_hi16s_reloc (abfd, addend, address)
bfd_byte * address;
{
hi16s_location * entry = NULL;
bfd_size_type amt = sizeof (* free_hi16s);
/* Find a free structure. */
if (free_hi16s == NULL)
free_hi16s = (hi16s_location *) bfd_zalloc (abfd, sizeof (* free_hi16s));
free_hi16s = (hi16s_location *) bfd_zalloc (abfd, amt);
entry = free_hi16s;
free_hi16s = free_hi16s->next;
@ -825,12 +834,13 @@ find_remembered_hi16s_reloc (addend, already_found)
/* FIXME: The code here probably ought to be removed and the code in reloc.c
allowed to do its stuff instead. At least for most of the relocs, anwyay. */
static bfd_reloc_status_type
v850_elf_perform_relocation (abfd, r_type, addend, address)
bfd * abfd;
int r_type;
bfd_vma addend;
bfd_byte * address;
bfd *abfd;
unsigned int r_type;
bfd_vma addend;
bfd_byte *address;
{
unsigned long insn;
bfd_signed_vma saddend = (bfd_signed_vma) addend;
@ -855,7 +865,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address)
insn = bfd_get_32 (abfd, address);
insn &= ~0xfffe003f;
insn |= (((addend & 0xfffe) << 16) | ((addend & 0x3f0000) >> 16));
bfd_put_32 (abfd, insn, address);
bfd_put_32 (abfd, (bfd_vma) insn, address);
return bfd_reloc_ok;
case R_V850_9_PCREL:
@ -1029,9 +1039,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address)
0x00000000
+ 0x00006fff (bit 15 not set, so the top half is zero)
------------
0x00006fff which is wrong (assuming that fred is at 0xffff)
*/
0x00006fff which is wrong (assuming that fred is at 0xffff). */
{
long result;
@ -1056,7 +1064,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address)
{
insn = bfd_get_16 (abfd, hi16s_address);
insn += 1;
bfd_put_16 (abfd, insn, hi16s_address);
bfd_put_16 (abfd, (bfd_vma) insn, hi16s_address);
}
}
else
@ -1122,7 +1130,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address)
if (addend & 1)
return bfd_reloc_dangerous;
insn = (addend & ~1) | (insn & 1);
insn = (addend &~ (bfd_vma) 1) | (insn & 1);
break;
case R_V850_TDA_6_8_OFFSET:
@ -1211,9 +1219,9 @@ v850_elf_perform_relocation (abfd, r_type, addend, address)
insn &= 0x0001ffdf;
insn |= (addend & 1) << 5;
insn |= (addend & ~1) << 16;
insn |= (addend &~ (bfd_vma) 1) << 16;
bfd_put_32 (abfd, insn, address);
bfd_put_32 (abfd, (bfd_vma) insn, address);
return bfd_reloc_ok;
case R_V850_CALLT_6_7_OFFSET:
@ -1238,11 +1246,12 @@ v850_elf_perform_relocation (abfd, r_type, addend, address)
}
bfd_put_16 (abfd, insn, address);
bfd_put_16 (abfd, (bfd_vma) insn, address);
return bfd_reloc_ok;
}
/* Insert the addend into the instruction. */
static bfd_reloc_status_type
v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
bfd * abfd ATTRIBUTE_UNUSED;
@ -1258,7 +1267,7 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
/* If there is an output BFD,
and the symbol is not a section name (which is only defined at final link time),
and either we are not putting the addend into the instruction
or the addend is zero, so there is nothing to add into the instruction
or the addend is zero, so there is nothing to add into the instruction
then just fixup the address and return. */
if (obfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
@ -1270,9 +1279,7 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
}
#if 0
else if (obfd != NULL)
{
return bfd_reloc_continue;
}
return bfd_reloc_continue;
#endif
/* Catch relocs involving undefined symbols. */
@ -1308,21 +1315,20 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
.text
.globl _start
nop
_start:
_start:
jr foo
.section ".foo","ax"
nop
foo:
nop
*/
nop */
if (reloc->howto->pc_relative == true)
{
/* Here the variable relocation holds the final address of the
symbol we are relocating against, plus any addend. */
relocation -= isection->output_section->vma + isection->output_offset;
/* Deal with pcrel_offset */
/* Deal with pcrel_offset. */
relocation -= reloc->address;
}
#endif
@ -1340,6 +1346,7 @@ v850_elf_is_local_label_name (abfd, name)
}
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
input_section, contents, offset, value,
@ -1356,7 +1363,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
asection * sym_sec;
int is_local ATTRIBUTE_UNUSED;
{
unsigned long r_type = howto->type;
unsigned int r_type = howto->type;
bfd_byte * hit_data = contents + offset;
/* Adjust the value according to the relocation. */
@ -1377,7 +1384,8 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000))
return bfd_reloc_overflow;
value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */
/* Only the bottom 24 bits of the PC are valid */
value = SEXT24 (value);
break;
case R_V850_HI16_S:
@ -1436,7 +1444,8 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
h = bfd_link_hash_lookup (info->hash, "__ep", false, false, true);
if (h == (struct bfd_link_hash_entry *) NULL
|| h->type != bfd_link_hash_defined)
return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */
/* Actually this indicates that __ep could not be found. */
return bfd_reloc_continue;
ep = (h->u.def.value
+ h->u.def.section->output_section->vma
@ -1455,7 +1464,8 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true);
if (h == (struct bfd_link_hash_entry *) NULL
|| h->type != bfd_link_hash_defined)
return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */
/* Actually this indicates that __ctbp could not be found. */
return bfd_reloc_dangerous + 1;
ctbp = (h->u.def.value
+ h->u.def.section->output_section->vma
@ -1501,6 +1511,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
}
/* Relocate an V850 ELF section. */
static boolean
v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, local_syms, local_sections)
@ -1524,7 +1535,8 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (sym_hashes == NULL)
{
info->callbacks->warning
(info, "no hash table available", NULL, input_bfd, input_section, 0);
(info, "no hash table available",
NULL, input_bfd, input_section, (bfd_vma) 0);
return false;
}
@ -1583,17 +1595,16 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
relocation = (sec->output_section->vma
+ sec->output_offset
+ sym->st_value);
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
#if 0
{
char * name;
name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name);
name = (name == NULL) ? "<none>" : name;
fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n",
sec->name, name, sym->st_name,
sec->output_section->vma, sec->output_offset, sym->st_value, rel->r_addend);
fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n",
sec->name, name, sym->st_name,
sec->output_section->vma, sec->output_offset, sym->st_value, rel->r_addend);
}
#endif
}
@ -1613,15 +1624,15 @@ fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n"
+ sec->output_section->vma
+ sec->output_offset);
#if 0
fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation);
fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation);
#endif
}
else if (h->root.type == bfd_link_hash_undefweak)
{
#if 0
fprintf (stderr, "undefined: sec: %s, name: %s\n",
sec->name, h->root.root.string);
fprintf (stderr, "undefined: sec: %s, name: %s\n",
sec->name, h->root.root.string);
#endif
relocation = 0;
}
@ -1632,14 +1643,13 @@ fprintf (stderr, "undefined: sec: %s, name: %s\n",
input_section, rel->r_offset, true)))
return false;
#if 0
fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
#endif
relocation = 0;
}
}
/* FIXME: We should use the addend, but the COFF relocations
don't. */
/* FIXME: We should use the addend, but the COFF relocations don't. */
r = v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
input_section,
contents, rel->r_offset,
@ -1725,7 +1735,7 @@ v850_elf_gc_sweep_hook (abfd, info, sec, relocs)
asection *sec ATTRIBUTE_UNUSED;
const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
{
/* No got and plt entries for v850-elf */
/* No got and plt entries for v850-elf. */
return true;
}
@ -1762,17 +1772,14 @@ v850_elf_gc_mark_hook (abfd, info, rel, h, sym)
}
else
{
if (!(elf_bad_symtab (abfd)
&& ELF_ST_BIND (sym->st_info) != STB_LOCAL)
&& ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
&& sym->st_shndx != SHN_COMMON))
{
return bfd_section_from_elf_index (abfd, sym->st_shndx);
}
}
return bfd_section_from_elf_index (abfd, sym->st_shndx);
}
return NULL;
}
/* Set the right machine number. */
static boolean
v850_elf_object_p (abfd)
bfd *abfd;
@ -1788,6 +1795,7 @@ v850_elf_object_p (abfd)
}
/* Store the machine number in the flags field. */
static void
v850_elf_final_write_processing (abfd, linker)
bfd * abfd;
@ -1808,6 +1816,7 @@ v850_elf_final_write_processing (abfd, linker)
}
/* Function to keep V850 specific file flags. */
static boolean
v850_elf_set_private_flags (abfd, flags)
bfd * abfd;
@ -1821,28 +1830,8 @@ v850_elf_set_private_flags (abfd, flags)
return true;
}
/* Copy backend specific data from one object module to another */
static boolean
v850_elf_copy_private_bfd_data (ibfd, obfd)
bfd * ibfd;
bfd * obfd;
{
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return true;
BFD_ASSERT (!elf_flags_init (obfd)
|| (elf_elfheader (obfd)->e_flags
== elf_elfheader (ibfd)->e_flags));
elf_gp (obfd) = elf_gp (ibfd);
elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
elf_flags_init (obfd) = true;
return true;
}
/* Merge backend specific data from an object file to the output
object file when linking. */
/* Merge backend specific data from an object file
to the output object file when linking. */
static boolean
v850_elf_merge_private_bfd_data (ibfd, obfd)
bfd * ibfd;
@ -1874,9 +1863,7 @@ v850_elf_merge_private_bfd_data (ibfd, obfd)
if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
&& bfd_get_arch_info (obfd)->the_default)
{
return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
}
return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
return true;
}
@ -1888,11 +1875,12 @@ v850_elf_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_V850_ARCH) != (out_flags & EF_V850_ARCH)
&& (in_flags & EF_V850_ARCH) != E_V850_ARCH)
_bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
bfd_get_filename (ibfd));
bfd_archive_filename (ibfd));
return true;
}
/* Display the flags field */
/* Display the flags field. */
static boolean
v850_elf_print_private_bfd_data (abfd, ptr)
@ -1938,13 +1926,12 @@ static asection v850_elf_zcom_section;
static asymbol v850_elf_zcom_symbol;
static asymbol * v850_elf_zcom_symbol_ptr;
/* Given a BFD section, try to locate the corresponding ELF section
index. */
/* Given a BFD section, try to locate the
corresponding ELF section index. */
static boolean
v850_elf_section_from_bfd_section (abfd, hdr, sec, retval)
v850_elf_section_from_bfd_section (abfd, sec, retval)
bfd * abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr * hdr ATTRIBUTE_UNUSED;
asection * sec;
int * retval;
{
@ -1968,9 +1955,9 @@ v850_elf_symbol_processing (abfd, asym)
asymbol * asym;
{
elf_symbol_type * elfsym = (elf_symbol_type *) asym;
unsigned short index;
unsigned int indx;
index = elfsym->internal_elf_sym.st_shndx;
indx = elfsym->internal_elf_sym.st_shndx;
/* If the section index is an "ordinary" index, then it may
refer to a v850 specific section created by the assembler.
@ -1978,26 +1965,26 @@ v850_elf_symbol_processing (abfd, asym)
FIXME: Should we alter the st_shndx field as well ? */
if (index < elf_elfheader(abfd)[0].e_shnum)
switch (elf_elfsections(abfd)[index]->sh_type)
if (indx < elf_numsections (abfd))
switch (elf_elfsections(abfd)[indx]->sh_type)
{
case SHT_V850_SCOMMON:
index = SHN_V850_SCOMMON;
indx = SHN_V850_SCOMMON;
break;
case SHT_V850_TCOMMON:
index = SHN_V850_TCOMMON;
indx = SHN_V850_TCOMMON;
break;
case SHT_V850_ZCOMMON:
index = SHN_V850_ZCOMMON;
indx = SHN_V850_ZCOMMON;
break;
default:
break;
}
switch (index)
switch (indx)
{
case SHN_V850_SCOMMON:
if (v850_elf_scom_section.name == NULL)
@ -2068,7 +2055,7 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
asection ** secp;
bfd_vma * valp;
{
int index = sym->st_shndx;
unsigned int indx = sym->st_shndx;
/* If the section index is an "ordinary" index, then it may
refer to a v850 specific section created by the assembler.
@ -2076,26 +2063,26 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
FIXME: Should we alter the st_shndx field as well ? */
if (index < elf_elfheader(abfd)[0].e_shnum)
switch (elf_elfsections(abfd)[index]->sh_type)
if (indx < elf_numsections (abfd))
switch (elf_elfsections(abfd)[indx]->sh_type)
{
case SHT_V850_SCOMMON:
index = SHN_V850_SCOMMON;
indx = SHN_V850_SCOMMON;
break;
case SHT_V850_TCOMMON:
index = SHN_V850_TCOMMON;
indx = SHN_V850_TCOMMON;
break;
case SHT_V850_ZCOMMON:
index = SHN_V850_ZCOMMON;
indx = SHN_V850_ZCOMMON;
break;
default:
break;
}
switch (index)
switch (indx)
{
case SHN_V850_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
@ -2119,7 +2106,6 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
return true;
}
/*ARGSIGNORED*/
static boolean
v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
bfd * abfd ATTRIBUTE_UNUSED;
@ -2173,8 +2159,9 @@ v850_elf_section_from_shdr (abfd, hdr, name)
return true;
}
/* Set the correct type for a V850 ELF section. We do this by the
section name, which is a hack, but ought to work. */
/* Set the correct type for a V850 ELF section. We do this
by the section name, which is a hack, but ought to work. */
static boolean
v850_elf_fake_sections (abfd, hdr, sec)
bfd * abfd ATTRIBUTE_UNUSED;
@ -2202,7 +2189,8 @@ v850_elf_fake_sections (abfd, hdr, sec)
#define TARGET_LITTLE_SYM bfd_elf32_v850_vec
#define TARGET_LITTLE_NAME "elf32-v850"
#define ELF_ARCH bfd_arch_v850
#define ELF_MACHINE_CODE EM_CYGNUS_V850
#define ELF_MACHINE_CODE EM_V850
#define ELF_MACHINE_ALT1 EM_CYGNUS_V850
#define ELF_MAXPAGESIZE 0x1000
#define elf_info_to_howto v850_elf_info_to_howto_rela
@ -2225,7 +2213,6 @@ v850_elf_fake_sections (abfd, hdr, sec)
#define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name
#define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup
#define bfd_elf32_bfd_copy_private_bfd_data v850_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags v850_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data v850_elf_print_private_bfd_data

View File

@ -2120,18 +2120,21 @@ elf64_alpha_output_extsym (h, data)
boolean strip;
asection *sec, *output_section;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
if (h->root.indx == -2)
strip = false;
else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|| (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
|| (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
strip = true;
else if (einfo->info->strip == strip_all
|| (einfo->info->strip == strip_some
&& bfd_hash_lookup (einfo->info->keep_hash,
h->root.root.root.string,
false, false) == NULL))
|| (einfo->info->strip == strip_some
&& bfd_hash_lookup (einfo->info->keep_hash,
h->root.root.root.string,
false, false) == NULL))
strip = true;
else
strip = false;
@ -2150,44 +2153,44 @@ elf64_alpha_output_extsym (h, data)
h->esym.asym.st = stGlobal;
if (h->root.root.type != bfd_link_hash_defined
&& h->root.root.type != bfd_link_hash_defweak)
h->esym.asym.sc = scAbs;
&& h->root.root.type != bfd_link_hash_defweak)
h->esym.asym.sc = scAbs;
else
{
const char *name;
{
const char *name;
sec = h->root.root.u.def.section;
output_section = sec->output_section;
sec = h->root.root.u.def.section;
output_section = sec->output_section;
/* When making a shared library and symbol h is the one from
the another shared library, OUTPUT_SECTION may be null. */
if (output_section == NULL)
h->esym.asym.sc = scUndefined;
else
{
name = bfd_section_name (output_section->owner, output_section);
/* When making a shared library and symbol h is the one from
the another shared library, OUTPUT_SECTION may be null. */
if (output_section == NULL)
h->esym.asym.sc = scUndefined;
else
{
name = bfd_section_name (output_section->owner, output_section);
if (strcmp (name, ".text") == 0)
h->esym.asym.sc = scText;
else if (strcmp (name, ".data") == 0)
h->esym.asym.sc = scData;
else if (strcmp (name, ".sdata") == 0)
h->esym.asym.sc = scSData;
else if (strcmp (name, ".rodata") == 0
|| strcmp (name, ".rdata") == 0)
h->esym.asym.sc = scRData;
else if (strcmp (name, ".bss") == 0)
h->esym.asym.sc = scBss;
else if (strcmp (name, ".sbss") == 0)
h->esym.asym.sc = scSBss;
else if (strcmp (name, ".init") == 0)
h->esym.asym.sc = scInit;
else if (strcmp (name, ".fini") == 0)
h->esym.asym.sc = scFini;
else
h->esym.asym.sc = scAbs;
}
}
if (strcmp (name, ".text") == 0)
h->esym.asym.sc = scText;
else if (strcmp (name, ".data") == 0)
h->esym.asym.sc = scData;
else if (strcmp (name, ".sdata") == 0)
h->esym.asym.sc = scSData;
else if (strcmp (name, ".rodata") == 0
|| strcmp (name, ".rdata") == 0)
h->esym.asym.sc = scRData;
else if (strcmp (name, ".bss") == 0)
h->esym.asym.sc = scBss;
else if (strcmp (name, ".sbss") == 0)
h->esym.asym.sc = scSBss;
else if (strcmp (name, ".init") == 0)
h->esym.asym.sc = scInit;
else if (strcmp (name, ".fini") == 0)
h->esym.asym.sc = scFini;
else
h->esym.asym.sc = scAbs;
}
}
h->esym.asym.reserved = 0;
h->esym.asym.index = indexNil;
@ -2199,18 +2202,18 @@ elf64_alpha_output_extsym (h, data)
|| h->root.root.type == bfd_link_hash_defweak)
{
if (h->esym.asym.sc == scCommon)
h->esym.asym.sc = scBss;
h->esym.asym.sc = scBss;
else if (h->esym.asym.sc == scSCommon)
h->esym.asym.sc = scSBss;
h->esym.asym.sc = scSBss;
sec = h->root.root.u.def.section;
output_section = sec->output_section;
if (output_section != NULL)
h->esym.asym.value = (h->root.root.u.def.value
+ sec->output_offset
+ output_section->vma);
h->esym.asym.value = (h->root.root.u.def.value
+ sec->output_offset
+ output_section->vma);
else
h->esym.asym.value = 0;
h->esym.asym.value = 0;
}
else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
{
@ -2232,8 +2235,8 @@ elf64_alpha_output_extsym (h, data)
}
if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap,
h->root.root.root.string,
&h->esym))
h->root.root.root.string,
&h->esym))
{
einfo->failed = true;
return false;
@ -2861,6 +2864,9 @@ elf64_alpha_calc_got_offsets_for_symbol (h, arg)
{
struct alpha_elf_got_entry *gotent;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
for (gotent = h->got_entries; gotent; gotent = gotent->next)
if (gotent->use_count > 0)
{
@ -3038,6 +3044,9 @@ elf64_alpha_calc_dynrel_sizes (h, info)
struct alpha_elf_link_hash_entry *h;
struct bfd_link_info *info;
{
if (h->root.root.type == bfd_link_hash_warning)
h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
/* If the symbol was defined as a common symbol in a regular object
file, and there was no definition in any dynamic object, then the
linker will have allocated space for the symbol in a common

File diff suppressed because it is too large Load Diff

View File

@ -2501,10 +2501,12 @@ func_desc_adjust (h, inf)
struct bfd_link_info *info;
struct ppc_link_hash_table *htab;
if (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
if (h->root.type == bfd_link_hash_indirect)
return true;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
info = (struct bfd_link_info *) inf;
htab = ppc_hash_table (info);
@ -2875,10 +2877,12 @@ allocate_dynrelocs (h, inf)
struct ppc_link_hash_entry *eh;
struct ppc_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
if (h->root.type == bfd_link_hash_indirect)
return true;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
info = (struct bfd_link_info *) inf;
htab = ppc_hash_table (info);
@ -3034,6 +3038,9 @@ readonly_dynrelocs (h, inf)
struct ppc_link_hash_entry *eh;
struct ppc_dyn_relocs *p;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
eh = (struct ppc_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{

View File

@ -1881,6 +1881,17 @@ sparc64_elf_relax_section (abfd, section, link_info, again)
return true;
}
/* This is the condition under which finish_dynamic_symbol will be called
from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol
routine, we'll need to do something about initializing any .plt and
.got entries in relocate_section. */
#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
((DYN) \
&& ((INFO)->shared \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
/* Relocate a SPARC64 ELF section. */
static boolean
@ -1928,9 +1939,10 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation;
bfd_vma relocation, off;
bfd_reloc_status_type r;
boolean is_plt = false;
boolean unresolved_reloc;
r_type = ELF64_R_TYPE_ID (rel->r_info);
if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
@ -1965,6 +1977,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
h = NULL;
sym = NULL;
sec = NULL;
unresolved_reloc = false;
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
@ -1977,116 +1990,30 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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;
relocation = 0;
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
boolean skip_it = false;
sec = h->root.u.def.section;
switch (r_type)
{
case R_SPARC_WPLT30:
case R_SPARC_PLT32:
case R_SPARC_HIPLT22:
case R_SPARC_LOPLT10:
case R_SPARC_PCPLT32:
case R_SPARC_PCPLT22:
case R_SPARC_PCPLT10:
case R_SPARC_PLT64:
if (h->plt.offset != (bfd_vma) -1)
skip_it = true;
break;
case R_SPARC_GOT10:
case R_SPARC_GOT13:
case R_SPARC_GOT22:
if (elf_hash_table(info)->dynamic_sections_created
&& (!info->shared
|| (!info->symbolic && h->dynindx != -1)
|| !(h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR)))
skip_it = true;
break;
case R_SPARC_PC10:
case R_SPARC_PC22:
case R_SPARC_PC_HH22:
case R_SPARC_PC_HM10:
case R_SPARC_PC_LM22:
if (!strcmp(h->root.root.string, "_GLOBAL_OFFSET_TABLE_"))
break;
/* FALLTHRU */
case R_SPARC_8:
case R_SPARC_16:
case R_SPARC_32:
case R_SPARC_DISP8:
case R_SPARC_DISP16:
case R_SPARC_DISP32:
case R_SPARC_WDISP30:
case R_SPARC_WDISP22:
case R_SPARC_HI22:
case R_SPARC_22:
case R_SPARC_13:
case R_SPARC_LO10:
case R_SPARC_UA32:
case R_SPARC_10:
case R_SPARC_11:
case R_SPARC_64:
case R_SPARC_OLO10:
case R_SPARC_HH22:
case R_SPARC_HM10:
case R_SPARC_LM22:
case R_SPARC_WDISP19:
case R_SPARC_WDISP16:
case R_SPARC_7:
case R_SPARC_5:
case R_SPARC_6:
case R_SPARC_DISP64:
case R_SPARC_HIX22:
case R_SPARC_LOX10:
case R_SPARC_H44:
case R_SPARC_M44:
case R_SPARC_L44:
case R_SPARC_UA64:
case R_SPARC_UA16:
if (info->shared
&& ((!info->symbolic && h->dynindx != -1)
|| !(h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR))
&& ((input_section->flags & SEC_ALLOC) != 0
/* DWARF will emit R_SPARC_{32,64} relocations in
its sections against symbols defined externally
in shared libraries. We can't do anything
with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
skip_it = true;
break;
}
if (skip_it)
{
/* In these cases, we don't need the relocation
value. We check specially because in some
obscure cases sec->output_section will be NULL. */
relocation = 0;
}
if (sec->output_section == NULL)
/* Set a flag that will be cleared later if we find a
relocation value for this symbol. output_section
is typically NULL for symbols satisfied by a shared
library. */
unresolved_reloc = true;
else
{
relocation = (h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset);
}
relocation = (h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset);
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
;
else if (info->shared
&& (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
;
else
{
if (! ((*info->callbacks->undefined_symbol)
@ -2107,7 +2034,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
}
do_dynreloc:
do_dynreloc:
/* When generating a shared object, these relocations are copied
into the output file to be resolved at run time. */
if (info->shared && r_symndx != 0 && (input_section->flags & SEC_ALLOC))
@ -2126,11 +2053,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_DISP8:
case R_SPARC_DISP16:
case R_SPARC_DISP32:
case R_SPARC_DISP64:
case R_SPARC_WDISP30:
case R_SPARC_WDISP22:
case R_SPARC_WDISP19:
case R_SPARC_WDISP16:
case R_SPARC_DISP64:
if (h == NULL)
break;
/* Fall through. */
@ -2219,6 +2146,18 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_UA64:
if (!(outrel.r_offset & 7)) r_type = R_SPARC_64;
break;
case R_SPARC_DISP8:
case R_SPARC_DISP16:
case R_SPARC_DISP32:
case R_SPARC_DISP64:
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_SPARC_NONE.
FIXME: Add code tracking needed dynamic relocs as
e.g. i386 has. */
if (h->dynindx == -1)
skip = true, relocate = true;
break;
}
if (skip)
@ -2326,14 +2265,18 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL)
{
bfd_vma off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
boolean dyn;
if (! elf_hash_table (info)->dynamic_sections_created
off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
dyn = elf_hash_table (info)->dynamic_sections_created;
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
|| (info->shared
&& (info->symbolic || h->dynindx == -1)
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR)))
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a -Bsymbolic
link and the symbol is defined locally, or the symbol
@ -2356,12 +2299,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
h->got.offset |= 1;
}
}
relocation = sgot->output_offset + off - got_base;
else
unresolved_reloc = false;
}
else
{
bfd_vma off;
BFD_ASSERT (local_got_offsets != NULL);
off = local_got_offsets[r_symndx];
BFD_ASSERT (off != (bfd_vma) -1);
@ -2407,8 +2349,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else
bfd_put_64 (output_bfd, relocation, sgot->contents + off);
}
relocation = sgot->output_offset + off - got_base;
}
relocation = sgot->output_offset + off - got_base;
goto do_default;
case R_SPARC_WPLT30:
@ -2440,6 +2382,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = (splt->output_section->vma
+ splt->output_offset
+ sparc64_elf_plt_entry_offset (h->plt.offset));
unresolved_reloc = false;
if (r_type == R_SPARC_WPLT30)
goto do_wplt30;
if (r_type == R_SPARC_PLT32 || r_type == R_SPARC_PLT64)
@ -2623,6 +2566,17 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
if (unresolved_reloc
&& !(info->shared
&& (input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset,
h->root.root.string);
switch (r)
{
case bfd_reloc_ok:

View File

@ -1118,6 +1118,9 @@ elf64_x86_64_discard_copies (h, inf)
struct elf64_x86_64_pcrel_relocs_copied *s;
struct bfd_link_info *info = (struct bfd_link_info *) inf;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct elf64_x86_64_link_hash_entry *) h->root.root.u.i.link;
/* If a symbol has been forced local or we have found a regular
definition for the symbolic link case, then we won't be needing
any relocs. */

View File

@ -1,5 +1,5 @@
/* ELF linking support for BFD.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -330,6 +330,9 @@ elf_link_renumber_hash_table_dynsyms (h, data)
{
size_t *count = (size_t *) data;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
if (h->dynindx != -1)
h->dynindx = ++(*count);

File diff suppressed because it is too large Load Diff

View File

@ -1016,9 +1016,6 @@ elfNN_ia64_section_from_shdr (abfd, hdr, name)
switch (hdr->sh_type)
{
case SHT_IA_64_UNWIND:
case SHT_INIT_ARRAY:
case SHT_FINI_ARRAY:
case SHT_PREINIT_ARRAY:
case SHT_IA_64_HP_OPT_ANOT:
break;
@ -1076,12 +1073,6 @@ elfNN_ia64_fake_sections (abfd, hdr, sec)
}
else if (strcmp (name, ELF_STRING_ia64_archext) == 0)
hdr->sh_type = SHT_IA_64_EXT;
else if (strcmp (name, ".init_array") == 0)
hdr->sh_type = SHT_INIT_ARRAY;
else if (strcmp (name, ".fini_array") == 0)
hdr->sh_type = SHT_FINI_ARRAY;
else if (strcmp (name, ".preinit_array") == 0)
hdr->sh_type = SHT_PREINIT_ARRAY;
else if (strcmp (name, ".HP.opt_annot") == 0)
hdr->sh_type = SHT_IA_64_HP_OPT_ANOT;
else if (strcmp (name, ".reloc") == 0)
@ -1719,6 +1710,9 @@ elfNN_ia64_global_dyn_sym_thunk (xentry, xdata)
= (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
struct elfNN_ia64_dyn_sym_info *dyn_i;
if (entry->root.root.type == bfd_link_hash_warning)
entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link;
for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
if (! (*data->func) (dyn_i, data->data))
return false;

View File

@ -1,5 +1,5 @@
/* Target definitions for NN-bit ELF
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -523,9 +523,9 @@ const bfd_target TARGET_BIG_SYM =
/* ar_max_namelen: maximum number of characters in an archive header
FIXME: this really has nothing to do with ELF, this is a characteristic
of the archiver and should be independently tunable. This value is
a WAG (wild a** guess) */
14,
of the archiver and should be independently tunable. The System V ABI,
Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
15,
/* Routines to byte-swap various sized integers from the data sections */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
@ -619,9 +619,9 @@ const bfd_target TARGET_LITTLE_SYM =
/* ar_max_namelen: maximum number of characters in an archive header
FIXME: this really has nothing to do with ELF, this is a characteristic
of the archiver and should be independently tunable. This value is
a WAG (wild a** guess) */
14,
of the archiver and should be independently tunable. The System V ABI,
Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
15,
/* Routines to byte-swap various sized integers from the data sections */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,

View File

@ -1,5 +1,5 @@
/* BFD back-end for linux flavored i386 a.out binaries.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -438,6 +438,9 @@ linux_tally_symbols (h, data)
struct linux_link_hash_entry *h1, *h2;
boolean exists;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct linux_link_hash_entry *) h->root.root.u.i.link;
if (h->root.root.type == bfd_link_hash_undefined
&& strncmp (h->root.root.root.string, NEEDS_SHRLIB,
sizeof NEEDS_SHRLIB - 1) == 0)

View File

@ -873,6 +873,11 @@ ihex_write_object_contents (abfd)
}
rec_addr = where - (extbase + segbase);
/* Output records shouldn't cross 64K boundaries. */
if (rec_addr + now > 0xfffff)
now = 0xffff - rec_addr;
if (! ihex_write_record (abfd, now, rec_addr, 0, p))
return false;

View File

@ -593,7 +593,7 @@ INTERNAL_FUNCTION
bfd_write_bigendian_4byte_int
SYNOPSIS
void bfd_write_bigendian_4byte_int (bfd *, unsigned int);
boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int);
DESCRIPTION
Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big
@ -601,15 +601,14 @@ DESCRIPTION
archives.
*/
void
boolean
bfd_write_bigendian_4byte_int (abfd, i)
bfd *abfd;
unsigned int i;
{
bfd_byte buffer[4];
bfd_putb32 ((bfd_vma) i, buffer);
if (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) != 4)
abort ();
return bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4;
}
bfd_vma

View File

@ -586,7 +586,7 @@ extern boolean _bfd_sh_align_load_span
/* And more follows */
void
boolean
bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int));
unsigned int

View File

@ -58,153 +58,167 @@ PE/PEI rearrangement (and code added): Donn Terry
#ifndef GET_FCN_LNNOPTR
#define GET_FCN_LNNOPTR(abfd, ext) \
bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
#endif
#ifndef GET_FCN_ENDNDX
#define GET_FCN_ENDNDX(abfd, ext) \
bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx)
#define GET_FCN_ENDNDX(abfd, ext) \
H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx)
#endif
#ifndef PUT_FCN_LNNOPTR
#define PUT_FCN_LNNOPTR(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
#define PUT_FCN_LNNOPTR(abfd, in, ext) \
H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
#endif
#ifndef PUT_FCN_ENDNDX
#define PUT_FCN_ENDNDX(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx)
#define PUT_FCN_ENDNDX(abfd, in, ext) \
H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx)
#endif
#ifndef GET_LNSZ_LNNO
#define GET_LNSZ_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_lnno)
#define GET_LNSZ_LNNO(abfd, ext) \
H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno)
#endif
#ifndef GET_LNSZ_SIZE
#define GET_LNSZ_SIZE(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_size)
#define GET_LNSZ_SIZE(abfd, ext) \
H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size)
#endif
#ifndef PUT_LNSZ_LNNO
#define PUT_LNSZ_LNNO(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno)
#define PUT_LNSZ_LNNO(abfd, in, ext) \
H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno)
#endif
#ifndef PUT_LNSZ_SIZE
#define PUT_LNSZ_SIZE(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size)
#define PUT_LNSZ_SIZE(abfd, in, ext) \
H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size)
#endif
#ifndef GET_SCN_SCNLEN
#define GET_SCN_SCNLEN(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen)
#define GET_SCN_SCNLEN(abfd, ext) \
H_GET_32 (abfd, ext->x_scn.x_scnlen)
#endif
#ifndef GET_SCN_NRELOC
#define GET_SCN_NRELOC(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nreloc)
#define GET_SCN_NRELOC(abfd, ext) \
H_GET_16 (abfd, ext->x_scn.x_nreloc)
#endif
#ifndef GET_SCN_NLINNO
#define GET_SCN_NLINNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nlinno)
#define GET_SCN_NLINNO(abfd, ext) \
H_GET_16 (abfd, ext->x_scn.x_nlinno)
#endif
#ifndef PUT_SCN_SCNLEN
#define PUT_SCN_SCNLEN(abfd,in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_scn.x_scnlen)
#define PUT_SCN_SCNLEN(abfd, in, ext) \
H_PUT_32(abfd, in, ext->x_scn.x_scnlen)
#endif
#ifndef PUT_SCN_NRELOC
#define PUT_SCN_NRELOC(abfd,in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_scn.x_nreloc)
#define PUT_SCN_NRELOC(abfd, in, ext) \
H_PUT_16(abfd, in, ext->x_scn.x_nreloc)
#endif
#ifndef PUT_SCN_NLINNO
#define PUT_SCN_NLINNO(abfd,in, ext) bfd_h_put_16(abfd,in, (bfd_byte *) ext->x_scn.x_nlinno)
#define PUT_SCN_NLINNO(abfd, in, ext) \
H_PUT_16(abfd,in, ext->x_scn.x_nlinno)
#endif
#ifndef GET_LINENO_LNNO
#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
#define GET_LINENO_LNNO(abfd, ext) \
H_GET_16 (abfd, ext->l_lnno);
#endif
#ifndef PUT_LINENO_LNNO
#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno));
#define PUT_LINENO_LNNO(abfd, val, ext) \
H_PUT_16(abfd,val, ext->l_lnno);
#endif
/* The f_symptr field in the filehdr is sometimes 64 bits. */
#ifndef GET_FILEHDR_SYMPTR
#define GET_FILEHDR_SYMPTR bfd_h_get_32
#define GET_FILEHDR_SYMPTR H_GET_32
#endif
#ifndef PUT_FILEHDR_SYMPTR
#define PUT_FILEHDR_SYMPTR bfd_h_put_32
#define PUT_FILEHDR_SYMPTR H_PUT_32
#endif
/* Some fields in the aouthdr are sometimes 64 bits. */
#ifndef GET_AOUTHDR_TSIZE
#define GET_AOUTHDR_TSIZE bfd_h_get_32
#define GET_AOUTHDR_TSIZE H_GET_32
#endif
#ifndef PUT_AOUTHDR_TSIZE
#define PUT_AOUTHDR_TSIZE bfd_h_put_32
#define PUT_AOUTHDR_TSIZE H_PUT_32
#endif
#ifndef GET_AOUTHDR_DSIZE
#define GET_AOUTHDR_DSIZE bfd_h_get_32
#define GET_AOUTHDR_DSIZE H_GET_32
#endif
#ifndef PUT_AOUTHDR_DSIZE
#define PUT_AOUTHDR_DSIZE bfd_h_put_32
#define PUT_AOUTHDR_DSIZE H_PUT_32
#endif
#ifndef GET_AOUTHDR_BSIZE
#define GET_AOUTHDR_BSIZE bfd_h_get_32
#define GET_AOUTHDR_BSIZE H_GET_32
#endif
#ifndef PUT_AOUTHDR_BSIZE
#define PUT_AOUTHDR_BSIZE bfd_h_put_32
#define PUT_AOUTHDR_BSIZE H_PUT_32
#endif
#ifndef GET_AOUTHDR_ENTRY
#define GET_AOUTHDR_ENTRY bfd_h_get_32
#define GET_AOUTHDR_ENTRY H_GET_32
#endif
#ifndef PUT_AOUTHDR_ENTRY
#define PUT_AOUTHDR_ENTRY bfd_h_put_32
#define PUT_AOUTHDR_ENTRY H_PUT_32
#endif
#ifndef GET_AOUTHDR_TEXT_START
#define GET_AOUTHDR_TEXT_START bfd_h_get_32
#define GET_AOUTHDR_TEXT_START H_GET_32
#endif
#ifndef PUT_AOUTHDR_TEXT_START
#define PUT_AOUTHDR_TEXT_START bfd_h_put_32
#define PUT_AOUTHDR_TEXT_START H_PUT_32
#endif
#ifndef GET_AOUTHDR_DATA_START
#define GET_AOUTHDR_DATA_START bfd_h_get_32
#define GET_AOUTHDR_DATA_START H_GET_32
#endif
#ifndef PUT_AOUTHDR_DATA_START
#define PUT_AOUTHDR_DATA_START bfd_h_put_32
#define PUT_AOUTHDR_DATA_START H_PUT_32
#endif
/* Some fields in the scnhdr are sometimes 64 bits. */
#ifndef GET_SCNHDR_PADDR
#define GET_SCNHDR_PADDR bfd_h_get_32
#define GET_SCNHDR_PADDR H_GET_32
#endif
#ifndef PUT_SCNHDR_PADDR
#define PUT_SCNHDR_PADDR bfd_h_put_32
#define PUT_SCNHDR_PADDR H_PUT_32
#endif
#ifndef GET_SCNHDR_VADDR
#define GET_SCNHDR_VADDR bfd_h_get_32
#define GET_SCNHDR_VADDR H_GET_32
#endif
#ifndef PUT_SCNHDR_VADDR
#define PUT_SCNHDR_VADDR bfd_h_put_32
#define PUT_SCNHDR_VADDR H_PUT_32
#endif
#ifndef GET_SCNHDR_SIZE
#define GET_SCNHDR_SIZE bfd_h_get_32
#define GET_SCNHDR_SIZE H_GET_32
#endif
#ifndef PUT_SCNHDR_SIZE
#define PUT_SCNHDR_SIZE bfd_h_put_32
#define PUT_SCNHDR_SIZE H_PUT_32
#endif
#ifndef GET_SCNHDR_SCNPTR
#define GET_SCNHDR_SCNPTR bfd_h_get_32
#define GET_SCNHDR_SCNPTR H_GET_32
#endif
#ifndef PUT_SCNHDR_SCNPTR
#define PUT_SCNHDR_SCNPTR bfd_h_put_32
#define PUT_SCNHDR_SCNPTR H_PUT_32
#endif
#ifndef GET_SCNHDR_RELPTR
#define GET_SCNHDR_RELPTR bfd_h_get_32
#define GET_SCNHDR_RELPTR H_GET_32
#endif
#ifndef PUT_SCNHDR_RELPTR
#define PUT_SCNHDR_RELPTR bfd_h_put_32
#define PUT_SCNHDR_RELPTR H_PUT_32
#endif
#ifndef GET_SCNHDR_LNNOPTR
#define GET_SCNHDR_LNNOPTR bfd_h_get_32
#define GET_SCNHDR_LNNOPTR H_GET_32
#endif
#ifndef PUT_SCNHDR_LNNOPTR
#define PUT_SCNHDR_LNNOPTR bfd_h_put_32
#define PUT_SCNHDR_LNNOPTR H_PUT_32
#endif
#ifdef COFF_WITH_pep
#define GET_OPTHDR_IMAGE_BASE bfd_h_get_64
#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_64
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_64
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_64
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_64
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_64
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_64
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_64
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_64
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_64
#define GET_OPTHDR_IMAGE_BASE H_GET_64
#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
#define GET_PDATA_ENTRY bfd_get_64
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common
@ -227,16 +241,16 @@ PE/PEI rearrangement (and code added): Donn Terry
#else /* !COFF_WITH_pep */
#define GET_OPTHDR_IMAGE_BASE bfd_h_get_32
#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_32
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_32
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_32
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_32
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_32
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_32
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_32
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_32
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_32
#define GET_OPTHDR_IMAGE_BASE H_GET_32
#define PUT_OPTHDR_IMAGE_BASE H_PUT_32
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32
#define GET_PDATA_ENTRY bfd_get_32
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common

View File

@ -1419,7 +1419,7 @@ static const enum link_action link_action[8][8] =
/* DEFW_ROW */ {DEFW, DEFW, DEFW, NOACT, NOACT, NOACT, NOACT, CYCLE },
/* COMMON_ROW */ {COM, COM, COM, CREF, COM, BIG, REFC, WARNC },
/* INDR_ROW */ {IND, IND, IND, MDEF, IND, CIND, MIND, CYCLE },
/* WARN_ROW */ {MWARN, WARN, WARN, CWARN, CWARN, WARN, CWARN, MWARN },
/* WARN_ROW */ {MWARN, WARN, WARN, CWARN, CWARN, WARN, CWARN, NOACT },
/* SET_ROW */ {SET, SET, SET, SET, SET, SET, CYCLE, CYCLE }
};
@ -2456,6 +2456,9 @@ _bfd_generic_link_write_global_symbol (h, data)
(struct generic_write_global_symbol_info *) data;
asymbol *sym;
if (h->root.type == bfd_link_hash_warning)
h = (struct generic_link_hash_entry *) h->root.u.i.link;
if (h->written)
return true;

View File

@ -804,6 +804,9 @@ _bfd_merge_sections (abfd, xsinfo, remove_hook)
if (secinfo)
continue;
if (sinfo->htab->first == NULL)
continue;
if (sinfo->htab->strings)
merge_strings (sinfo);
else

View File

@ -1,5 +1,6 @@
/* BFD backend for MIPS BSD (a.out) binaries.
Copyright (C) 1993, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Written by Ralph Campbell.
This file is part of BFD, the Binary File Descriptor library.
@ -35,7 +36,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|| (mtype) == M_MIPS1 || (mtype) == M_MIPS2)
#define MY_symbol_leading_char '\0'
#define MY(OP) CAT(mipsbsd_,OP)
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
#define MY(OP) CONCAT2 (mipsbsd_,OP)
#include "bfd.h"
#include "sysdep.h"
@ -43,15 +47,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libaout.h"
#define SET_ARCH_MACH(ABFD, EXEC) \
MY(set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \
MY(choose_reloc_size)(ABFD);
static void MY(set_arch_mach) PARAMS ((bfd *abfd, int machtype));
MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
MY(choose_reloc_size) (ABFD);
static void MY(set_arch_mach) PARAMS ((bfd *abfd, unsigned long machtype));
static void MY(choose_reloc_size) PARAMS ((bfd *abfd));
#define MY_write_object_contents MY(write_object_contents)
static boolean MY(write_object_contents) PARAMS ((bfd *abfd));
/* We can't use MY(x) here because it leads to a recursive call to CAT
/* We can't use MY(x) here because it leads to a recursive call to CONCAT2
when expanded inside JUMP_TABLE. */
#define MY_bfd_reloc_type_lookup mipsbsd_reloc_howto_type_lookup
#define MY_canonicalize_reloc mipsbsd_canonicalize_reloc
@ -66,50 +70,60 @@ static boolean MY(write_object_contents) PARAMS ((bfd *abfd));
#include "aout-target.h"
static bfd_reloc_status_type mips_fix_jmp_addr
PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
bfd *, char **));
static reloc_howto_type *MY(reloc_howto_type_lookup)
PARAMS ((bfd *, bfd_reloc_code_real_type));
long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
static void
MY(set_arch_mach) (abfd, machtype)
bfd *abfd;
int machtype;
unsigned long machtype;
{
enum bfd_architecture arch;
long machine;
unsigned int machine;
/* Determine the architecture and machine type of the object file. */
switch (machtype) {
/* Determine the architecture and machine type of the object file. */
switch (machtype)
{
case M_MIPS1:
arch = bfd_arch_mips;
machine = 3000;
break;
case M_MIPS1:
arch = bfd_arch_mips;
machine = 3000;
break;
case M_MIPS2:
arch = bfd_arch_mips;
machine = 4000;
break;
case M_MIPS2:
arch = bfd_arch_mips;
machine = 4000;
break;
default:
arch = bfd_arch_obscure;
machine = 0;
break;
}
default:
arch = bfd_arch_obscure;
machine = 0;
break;
}
bfd_set_arch_mach(abfd, arch, machine);
bfd_set_arch_mach (abfd, arch, machine);
}
/* Determine the size of a relocation entry, based on the architecture */
static void
MY(choose_reloc_size) (abfd)
MY (choose_reloc_size) (abfd)
bfd *abfd;
{
switch (bfd_get_arch(abfd)) {
case bfd_arch_sparc:
case bfd_arch_a29k:
case bfd_arch_mips:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
switch (bfd_get_arch (abfd))
{
case bfd_arch_sparc:
case bfd_arch_a29k:
case bfd_arch_mips:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
}
/* Write an object file in BSD a.out format.
@ -117,59 +131,60 @@ MY(choose_reloc_size) (abfd)
file header, symbols, and relocation. */
static boolean
MY(write_object_contents) (abfd)
MY (write_object_contents) (abfd)
bfd *abfd;
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
/* Magic number, maestro, please! */
switch (bfd_get_arch(abfd)) {
case bfd_arch_m68k:
switch (bfd_get_mach(abfd)) {
case bfd_mach_m68010:
N_SET_MACHTYPE(*execp, M_68010);
switch (bfd_get_arch (abfd))
{
case bfd_arch_m68k:
switch (bfd_get_mach (abfd))
{
case bfd_mach_m68010:
N_SET_MACHTYPE (*execp, M_68010);
break;
default:
case bfd_mach_m68020:
N_SET_MACHTYPE (*execp, M_68020);
break;
}
break;
case bfd_arch_sparc:
N_SET_MACHTYPE (*execp, M_SPARC);
break;
case bfd_arch_i386:
N_SET_MACHTYPE (*execp, M_386);
break;
case bfd_arch_a29k:
N_SET_MACHTYPE (*execp, M_29K);
break;
case bfd_arch_mips:
switch (bfd_get_mach (abfd))
{
case 4000:
case 6000:
N_SET_MACHTYPE (*execp, M_MIPS2);
break;
default:
N_SET_MACHTYPE (*execp, M_MIPS1);
break;
}
break;
default:
case bfd_mach_m68020:
N_SET_MACHTYPE(*execp, M_68020);
break;
N_SET_MACHTYPE (*execp, M_UNKNOWN);
}
break;
case bfd_arch_sparc:
N_SET_MACHTYPE(*execp, M_SPARC);
break;
case bfd_arch_i386:
N_SET_MACHTYPE(*execp, M_386);
break;
case bfd_arch_a29k:
N_SET_MACHTYPE(*execp, M_29K);
break;
case bfd_arch_mips:
switch (bfd_get_mach(abfd)) {
case 4000:
case 6000:
N_SET_MACHTYPE(*execp, M_MIPS2);
break;
default:
N_SET_MACHTYPE(*execp, M_MIPS1);
break;
}
break;
default:
N_SET_MACHTYPE(*execp, M_UNKNOWN);
}
MY(choose_reloc_size)(abfd);
MY (choose_reloc_size) (abfd);
WRITE_HEADERS(abfd, execp);
WRITE_HEADERS (abfd, execp);
return true;
}
/*
* MIPS relocation types.
*/
/* MIPS relocation types. */
#define MIPS_RELOC_32 0
#define MIPS_RELOC_JMP 1
#define MIPS_RELOC_WDISP16 2
@ -177,26 +192,27 @@ MY(write_object_contents) (abfd)
#define MIPS_RELOC_HI16_S 4
#define MIPS_RELOC_LO16 5
/*
* This is only called when performing a BFD_RELOC_MIPS_JMP relocation.
* The jump destination address is formed from the upper 4 bits of the
* "current" program counter concatenated with the jump instruction's
* 26 bit field and two trailing zeros.
* If the destination address is not in the same segment as the "current"
* program counter, then we need to signal an error.
*/
/* This is only called when performing a BFD_RELOC_MIPS_JMP relocation.
The jump destination address is formed from the upper 4 bits of the
"current" program counter concatenated with the jump instruction's
26 bit field and two trailing zeros.
If the destination address is not in the same segment as the "current"
program counter, then we need to signal an error. */
static bfd_reloc_status_type
mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd)
mips_fix_jmp_addr (abfd, reloc_entry, symbol, data, input_section, output_bfd,
error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
struct symbol_cache_entry *symbol;
PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation, pc;
/* If this is a partial relocation, just continue. */
/* If this is a partial relocation, just continue. */
if (output_bfd != (bfd *)NULL)
return bfd_reloc_continue;
@ -205,10 +221,8 @@ mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd)
&& (symbol->flags & BSF_WEAK) == 0)
return bfd_reloc_undefined;
/*
* Work out which section the relocation is targetted at and the
* initial relocation command value.
*/
/* Work out which section the relocation is targetted at and the
initial relocation command value. */
if (bfd_is_com_section (symbol->section))
relocation = 0;
else
@ -227,12 +241,11 @@ mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd)
return bfd_reloc_continue;
}
/*
* This is only called when performing a BFD_RELOC_HI16_S relocation.
* We need to see if bit 15 is set in the result. If it is, we add
* 0x10000 and continue normally. This will compensate for the sign extension
* when the low bits are added at run time.
*/
/* This is only called when performing a BFD_RELOC_HI16_S relocation.
We need to see if bit 15 is set in the result. If it is, we add
0x10000 and continue normally. This will compensate for the sign extension
when the low bits are added at run time. */
static bfd_reloc_status_type
mips_fix_hi16_s PARAMS ((bfd *, arelent *, asymbol *, PTR,
asection *, bfd *, char **));
@ -249,20 +262,18 @@ mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section,
char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation;
/* If this is a partial relocation, just continue. */
/* If this is a partial relocation, just continue. */
if (output_bfd != (bfd *)NULL)
return bfd_reloc_continue;
/* If this is an undefined symbol, return error */
/* If this is an undefined symbol, return error. */
if (bfd_is_und_section (symbol->section)
&& (symbol->flags & BSF_WEAK) == 0)
return bfd_reloc_undefined;
/*
* Work out which section the relocation is targetted at and the
* initial relocation command value.
*/
/* Work out which section the relocation is targetted at and the
initial relocation command value. */
if (bfd_is_com_section (symbol->section))
relocation = 0;
else
@ -324,12 +335,10 @@ MY(reloc_howto_type_lookup) (abfd, code)
}
}
/*
* This is just like the standard aoutx.h version but we need to do our
* own mapping of external reloc type values to howto entries.
*/
/* This is just like the standard aoutx.h version but we need to do our
own mapping of external reloc type values to howto entries. */
long
MY(canonicalize_reloc)(abfd, section, relptr, symbols)
MY(canonicalize_reloc) (abfd, section, relptr, symbols)
bfd *abfd;
sec_ptr section;
arelent **relptr;
@ -339,30 +348,34 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols)
unsigned int count, c;
extern reloc_howto_type NAME(aout,ext_howto_table)[];
/* If we have already read in the relocation table, return the values. */
if (section->flags & SEC_CONSTRUCTOR) {
arelent_chain *chain = section->constructor_chain;
/* If we have already read in the relocation table, return the values. */
if (section->flags & SEC_CONSTRUCTOR)
{
arelent_chain *chain = section->constructor_chain;
for (count = 0; count < section->reloc_count; count++) {
*relptr++ = &chain->relent;
chain = chain->next;
for (count = 0; count < section->reloc_count; count++)
{
*relptr++ = &chain->relent;
chain = chain->next;
}
*relptr = 0;
return section->reloc_count;
}
*relptr = 0;
return section->reloc_count;
}
if (tblptr && section->reloc_count) {
for (count = 0; count++ < section->reloc_count;)
*relptr++ = tblptr++;
*relptr = 0;
return section->reloc_count;
}
if (!NAME(aout,slurp_reloc_table)(abfd, section, symbols))
if (tblptr && section->reloc_count)
{
for (count = 0; count++ < section->reloc_count;)
*relptr++ = tblptr++;
*relptr = 0;
return section->reloc_count;
}
if (!NAME(aout,slurp_reloc_table) (abfd, section, symbols))
return -1;
tblptr = section->relocation;
/* fix up howto entries */
for (count = 0; count++ < section->reloc_count;)
/* fix up howto entries. */
for (count = 0; count++ < section->reloc_count;)
{
c = tblptr->howto - NAME(aout,ext_howto_table);
tblptr->howto = &mips_howto_table_ext[c];
@ -373,7 +386,7 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols)
return section->reloc_count;
}
static CONST struct aout_backend_data MY(backend_data) = {
static const struct aout_backend_data MY(backend_data) = {
0, /* zmagic contiguous */
1, /* text incl header */
0, /* entry is text address */
@ -392,83 +405,83 @@ static CONST struct aout_backend_data MY(backend_data) = {
extern const bfd_target aout_mips_big_vec;
const bfd_target aout_mips_little_vec =
{
"a.out-mips-little", /* name */
bfd_target_aout_flavour,
BFD_ENDIAN_LITTLE, /* target byte order (little) */
BFD_ENDIAN_LITTLE, /* target headers byte order (little) */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
MY_symbol_leading_char,
' ', /* ar_pad_char */
15, /* ar_max_namelen */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
{
"a.out-mips-little", /* name */
bfd_target_aout_flavour,
BFD_ENDIAN_LITTLE, /* target byte order (little) */
BFD_ENDIAN_LITTLE, /* target headers byte order (little) */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
MY_symbol_leading_char,
' ', /* ar_pad_char */
15, /* ar_max_namelen */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
{_bfd_dummy_target, MY_object_p, /* bfd_check_format */
bfd_generic_archive_p, MY_core_file_p},
bfd_generic_archive_p, MY_core_file_p},
{bfd_false, MY_mkobject, /* bfd_set_format */
_bfd_generic_mkarchive, bfd_false},
_bfd_generic_mkarchive, bfd_false},
{bfd_false, MY_write_object_contents, /* bfd_write_contents */
_bfd_write_archive_contents, bfd_false},
_bfd_write_archive_contents, bfd_false},
BFD_JUMP_TABLE_GENERIC (MY),
BFD_JUMP_TABLE_COPY (MY),
BFD_JUMP_TABLE_CORE (MY),
BFD_JUMP_TABLE_ARCHIVE (MY),
BFD_JUMP_TABLE_SYMBOLS (MY),
BFD_JUMP_TABLE_RELOCS (MY),
BFD_JUMP_TABLE_WRITE (MY),
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
BFD_JUMP_TABLE_GENERIC (MY),
BFD_JUMP_TABLE_COPY (MY),
BFD_JUMP_TABLE_CORE (MY),
BFD_JUMP_TABLE_ARCHIVE (MY),
BFD_JUMP_TABLE_SYMBOLS (MY),
BFD_JUMP_TABLE_RELOCS (MY),
BFD_JUMP_TABLE_WRITE (MY),
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
& aout_mips_big_vec,
(PTR) MY_backend_data
};
& aout_mips_big_vec,
(PTR) MY_backend_data
};
const bfd_target aout_mips_big_vec =
{
"a.out-mips-big", /* name */
bfd_target_aout_flavour,
BFD_ENDIAN_BIG, /* target byte order (big) */
BFD_ENDIAN_BIG, /* target headers byte order (big) */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
MY_symbol_leading_char,
' ', /* ar_pad_char */
15, /* ar_max_namelen */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
{
"a.out-mips-big", /* name */
bfd_target_aout_flavour,
BFD_ENDIAN_BIG, /* target byte order (big) */
BFD_ENDIAN_BIG, /* target headers byte order (big) */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
MY_symbol_leading_char,
' ', /* ar_pad_char */
15, /* ar_max_namelen */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
{_bfd_dummy_target, MY_object_p, /* bfd_check_format */
bfd_generic_archive_p, MY_core_file_p},
bfd_generic_archive_p, MY_core_file_p},
{bfd_false, MY_mkobject, /* bfd_set_format */
_bfd_generic_mkarchive, bfd_false},
_bfd_generic_mkarchive, bfd_false},
{bfd_false, MY_write_object_contents, /* bfd_write_contents */
_bfd_write_archive_contents, bfd_false},
_bfd_write_archive_contents, bfd_false},
BFD_JUMP_TABLE_GENERIC (MY),
BFD_JUMP_TABLE_COPY (MY),
BFD_JUMP_TABLE_CORE (MY),
BFD_JUMP_TABLE_ARCHIVE (MY),
BFD_JUMP_TABLE_SYMBOLS (MY),
BFD_JUMP_TABLE_RELOCS (MY),
BFD_JUMP_TABLE_WRITE (MY),
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
BFD_JUMP_TABLE_GENERIC (MY),
BFD_JUMP_TABLE_COPY (MY),
BFD_JUMP_TABLE_CORE (MY),
BFD_JUMP_TABLE_ARCHIVE (MY),
BFD_JUMP_TABLE_SYMBOLS (MY),
BFD_JUMP_TABLE_RELOCS (MY),
BFD_JUMP_TABLE_WRITE (MY),
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
& aout_mips_little_vec,
(PTR) MY_backend_data
};
& aout_mips_little_vec,
(PTR) MY_backend_data
};

View File

@ -1,5 +1,6 @@
/* BFD back-end for MIPS PE COFF files.
Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001 Free Software Foundation, Inc.
Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
This file is part of BFD, the Binary File Descriptor library.
@ -34,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libcoff.h"
static bfd_reloc_status_type coff_mips_reloc
static bfd_reloc_status_type coff_mips_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static reloc_howto_type *coff_mips_rtype_to_howto
PARAMS ((bfd *, asection *, struct internal_reloc *,
@ -53,6 +54,15 @@ static void mips_adjust_reloc_in PARAMS ((bfd *,
static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *,
struct internal_reloc *));
#endif
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
static reloc_howto_type * coff_mips_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
static void mips_swap_reloc_in PARAMS ((bfd *, PTR, PTR));
static unsigned int mips_swap_reloc_out PARAMS ((bfd *, PTR, PTR));
static boolean coff_pe_mips_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
/* The page size is a guess based on ELF. */
@ -143,7 +153,7 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
{
short x = bfd_get_16 (abfd, addr);
DOIT (x);
bfd_put_16 (abfd, x, addr);
bfd_put_16 (abfd, (bfd_vma) x, addr);
}
break;
@ -151,7 +161,7 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
{
long x = bfd_get_32 (abfd, addr);
DOIT (x);
bfd_put_32 (abfd, x, addr);
bfd_put_32 (abfd, (bfd_vma) x, addr);
}
break;
@ -166,21 +176,22 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
#ifdef COFF_WITH_PE
/* Return true if this relocation should
appear in the output .reloc section. */
appear in the output .reloc section. */
static boolean in_reloc_p(abfd, howto)
static boolean
in_reloc_p (abfd, howto)
bfd * abfd ATTRIBUTE_UNUSED;
reloc_howto_type *howto;
{
return ! howto->pc_relative && howto->type != MIPS_R_RVA;
}
}
#endif
#ifndef PCRELOFFSET
#define PCRELOFFSET false
#endif
static reloc_howto_type howto_table[] =
static reloc_howto_type howto_table[] =
{
/* Reloc type 0 is ignored. The reloc reading code ensures that
this is a reference to the .abs section, which will cause
@ -336,33 +347,33 @@ static reloc_howto_type howto_table[] =
EMPTY_HOWTO (31),
EMPTY_HOWTO (32),
EMPTY_HOWTO (33),
HOWTO (MIPS_R_RVA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
HOWTO (MIPS_R_RVA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
coff_mips_reloc, /* special_function */
"rva32", /* name */
true, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
coff_mips_reloc, /* special_function */
"rva32", /* name */
true, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
EMPTY_HOWTO (35),
EMPTY_HOWTO (36),
HOWTO (MIPS_R_PAIR, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
HOWTO (MIPS_R_PAIR, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
coff_mips_reloc, /* special_function */
"PAIR", /* name */
true, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
coff_mips_reloc, /* special_function */
"PAIR", /* name */
true, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
};
@ -408,7 +419,6 @@ static reloc_howto_type howto_table[] =
cache_ptr->addend += asect->vma; \
}
/* Convert an rtype to howto for the COFF backend linker. */
static reloc_howto_type *
@ -439,7 +449,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
function will be adding in the final value of the symbol. We
need to subtract out the current size in order to get the
correct result. */
BFD_ASSERT (h != NULL);
#ifndef COFF_WITH_PE
@ -458,7 +468,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
/* If the output symbol is common (in which case this must be a
relocateable link), we need to add in the final size of the
common symbol. */
if (h != NULL && h->root.type == bfd_link_hash_common)
if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
#endif
@ -488,11 +498,8 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
#define coff_rtype_to_howto coff_mips_rtype_to_howto
#define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup
/* Get the howto structure for a generic reloc type. */
static reloc_howto_type *
@ -520,7 +527,7 @@ coff_mips_reloc_type_lookup (abfd, code)
case BFD_RELOC_LO16:
mips_type = MIPS_R_REFLO;
break;
case BFD_RELOC_MIPS_GPREL:
case BFD_RELOC_GPREL16:
mips_type = MIPS_R_GPREL;
break;
case BFD_RELOC_MIPS_LITERAL:
@ -560,10 +567,9 @@ mips_swap_reloc_in (abfd, src, dst)
RELOC *reloc_src = (RELOC *) src;
struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr);
reloc_dst->r_symndx =
bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
reloc_dst->r_type = bfd_h_get_16(abfd, (bfd_byte *) reloc_src->r_type);
reloc_dst->r_vaddr = H_GET_32 (abfd, reloc_src->r_vaddr);
reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx);
reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type);
reloc_dst->r_size = 0;
reloc_dst->r_extern = 0;
reloc_dst->r_offset = 0;
@ -577,7 +583,7 @@ mips_swap_reloc_in (abfd, src, dst)
reloc_dst->r_offset = reloc_dst->r_symndx;
if (reloc_dst->r_offset & 0x8000)
reloc_dst->r_offset -= 0x10000;
/*printf("dj: pair offset is %08x\n", reloc_dst->r_offset);*/
/*printf ("dj: pair offset is %08x\n", reloc_dst->r_offset);*/
reloc_dst->r_symndx = pair_prev.r_symndx;
break;
}
@ -607,23 +613,18 @@ mips_swap_reloc_out (abfd, src, dst)
the same address as a REFHI, we assume this is the matching
PAIR reloc and output it accordingly. The symndx is really
the low 16 bits of the addend */
bfd_h_put_32 (abfd, reloc_src->r_vaddr,
(bfd_byte *) reloc_dst->r_vaddr);
bfd_h_put_32 (abfd, reloc_src->r_symndx,
(bfd_byte *) reloc_dst->r_symndx);
bfd_h_put_16(abfd, MIPS_R_PAIR, (bfd_byte *)
reloc_dst->r_type);
H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
H_PUT_16 (abfd, MIPS_R_PAIR, reloc_dst->r_type);
return RELSZ;
}
break;
}
bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
bfd_h_put_16(abfd, reloc_src->r_type, (bfd_byte *)
reloc_dst->r_type);
H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type);
return RELSZ;
}
@ -654,9 +655,9 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
if (info->relocateable)
{
(*_bfd_error_handler)(_("\
(*_bfd_error_handler) (_("\
%s: `ld -r' not supported with PE MIPS objects\n"),
bfd_get_filename (input_bfd));
bfd_archive_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
}
@ -665,7 +666,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
== output_bfd->xvec->byteorder);
#if 0
printf("dj: relocate %s(%s) %08x\n",
printf ("dj: relocate %s(%s) %08x\n",
input_bfd->filename, input_section->name,
input_section->output_section->vma + input_section->output_offset);
#endif
@ -700,7 +701,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
sym = NULL;
}
else
{
{
h = obj_coff_sym_hashes (input_bfd)[symndx];
sym = syms + symndx;
}
@ -715,7 +716,6 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
else
addend = 0;
howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
sym, &addend);
if (howto == NULL)
@ -779,7 +779,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
src = rel->r_vaddr + input_section->output_section->vma
+ input_section->output_offset;
#if 0
printf("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n",
printf ("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n",
rel->r_type, howto_table[rel->r_type].name,
src, rel->r_vaddr, *(unsigned long *)mem, val, rel->r_offset,
h?h->root.root.string:"(none)");
@ -791,8 +791,8 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
val = VMA of what we need to refer to
*/
#define UI(x) (*_bfd_error_handler)(_("%s: unimplemented %s\n"), \
bfd_get_filename (input_bfd), x); \
#define UI(x) (*_bfd_error_handler) (_("%s: unimplemented %s\n"), \
bfd_archive_filename (input_bfd), x); \
bfd_set_error (bfd_error_bad_value);
switch (rel->r_type)
@ -807,7 +807,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
case MIPS_R_REFWORD:
tmp = bfd_get_32(input_bfd, mem);
/* printf("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */
/* printf ("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */
tmp += val;
bfd_put_32(input_bfd, tmp, mem);
break;
@ -817,8 +817,8 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
targ = val + (tmp&0x03ffffff)*4;
if ((src & 0xf0000000) != (targ & 0xf0000000))
{
(*_bfd_error_handler)(_("%s: jump too far away\n"),
bfd_get_filename (input_bfd));
(*_bfd_error_handler) (_("%s: jump too far away\n"),
bfd_archive_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
}
@ -844,8 +844,8 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
targ = val + low + ((tmp & 0xffff) << 16);
break;
default:
(*_bfd_error_handler)(_("%s: bad pair/reflo after refhi\n"),
bfd_get_filename (input_bfd));
(*_bfd_error_handler) (_("%s: bad pair/reflo after refhi\n"),
bfd_archive_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
}
@ -857,7 +857,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
case MIPS_R_REFLO:
tmp = bfd_get_32(input_bfd, mem);
targ = val + (tmp & 0xffff);
/* printf("refword: src=%08x targ=%08x\n", src, targ); */
/* printf ("refword: src=%08x targ=%08x\n", src, targ); */
tmp &= 0xffff0000;
tmp |= targ & 0xffff;
bfd_put_32(input_bfd, tmp, mem);
@ -886,7 +886,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
case MIPS_R_RVA:
tmp = bfd_get_32 (input_bfd, mem);
/* printf("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
/* printf ("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
tmp += val
- pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
bfd_put_32 (input_bfd, tmp, mem);
@ -974,7 +974,7 @@ const bfd_target
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
/* Note that we allow an object file to be treated as a core file as well. */
/* Note that we allow an object file to be treated as a core file as well. */
{_bfd_dummy_target, coff_object_p, /* bfd_check_format */
bfd_generic_archive_p, coff_object_p},
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
@ -993,6 +993,6 @@ const bfd_target
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
COFF_SWAP_TABLE
};

View File

@ -139,7 +139,7 @@ static void pe_ILF_make_a_reloc PARAMS ((pe_ILF_vars *, bfd_vm
static void pe_ILF_make_a_symbol PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword));
static void pe_ILF_save_relocs PARAMS ((pe_ILF_vars *, asection_ptr));
static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int));
static boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned short, bfd_byte *, bfd_byte *, unsigned int, unsigned int));
static boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned int, bfd_byte *, bfd_byte *, unsigned int, unsigned int));
static const bfd_target * pe_ILF_object_p PARAMS ((bfd *));
static const bfd_target * pe_bfd_object_p PARAMS ((bfd *));
#endif /* COFF_IMAGE_WITH_PE */
@ -156,14 +156,13 @@ coff_swap_reloc_in (abfd, src, dst)
RELOC *reloc_src = (RELOC *) src;
struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr);
reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
reloc_dst->r_vaddr = H_GET_32 (abfd, reloc_src->r_vaddr);
reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx);
reloc_dst->r_type = bfd_h_get_16(abfd, (bfd_byte *) reloc_src->r_type);
reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type);
#ifdef SWAP_IN_RELOC_OFFSET
reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET(abfd,
(bfd_byte *) reloc_src->r_offset);
reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset);
#endif
}
@ -175,19 +174,16 @@ coff_swap_reloc_out (abfd, src, dst)
{
struct internal_reloc *reloc_src = (struct internal_reloc *)src;
struct external_reloc *reloc_dst = (struct external_reloc *)dst;
bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
bfd_h_put_16(abfd, reloc_src->r_type, (bfd_byte *)
reloc_dst->r_type);
H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type);
#ifdef SWAP_OUT_RELOC_OFFSET
SWAP_OUT_RELOC_OFFSET(abfd,
reloc_src->r_offset,
(bfd_byte *) reloc_dst->r_offset);
SWAP_OUT_RELOC_OFFSET (abfd, reloc_src->r_offset, reloc_dst->r_offset);
#endif
#ifdef SWAP_OUT_RELOC_EXTRA
SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst);
SWAP_OUT_RELOC_EXTRA(abfd, reloc_src, reloc_dst);
#endif
return RELSZ;
}
@ -201,13 +197,13 @@ coff_swap_filehdr_in (abfd, src, dst)
{
FILHDR *filehdr_src = (FILHDR *) src;
struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst;
filehdr_dst->f_magic = bfd_h_get_16(abfd, (bfd_byte *) filehdr_src->f_magic);
filehdr_dst->f_nscns = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_nscns);
filehdr_dst->f_timdat = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_timdat);
filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->f_magic);
filehdr_dst->f_nscns = H_GET_16 (abfd, filehdr_src-> f_nscns);
filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src-> f_timdat);
filehdr_dst->f_nsyms = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_nsyms);
filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags);
filehdr_dst->f_symptr = bfd_h_get_32 (abfd, (bfd_byte *) filehdr_src->f_symptr);
filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src-> f_nsyms);
filehdr_dst->f_flags = H_GET_16 (abfd, filehdr_src-> f_flags);
filehdr_dst->f_symptr = H_GET_32 (abfd, filehdr_src->f_symptr);
/* Other people's tools sometimes generate headers with an nsyms but
a zero symptr. */
@ -217,8 +213,7 @@ coff_swap_filehdr_in (abfd, src, dst)
filehdr_dst->f_flags |= F_LSYMS;
}
filehdr_dst->f_opthdr = bfd_h_get_16(abfd,
(bfd_byte *)filehdr_src-> f_opthdr);
filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src-> f_opthdr);
}
#ifdef COFF_IMAGE_WITH_PE
@ -237,33 +232,24 @@ coff_swap_scnhdr_in (abfd, ext, in)
struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name));
scnhdr_int->s_vaddr =
GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr);
scnhdr_int->s_paddr =
GET_SCNHDR_PADDR (abfd, (bfd_byte *) scnhdr_ext->s_paddr);
scnhdr_int->s_size =
GET_SCNHDR_SIZE (abfd, (bfd_byte *) scnhdr_ext->s_size);
scnhdr_int->s_scnptr =
GET_SCNHDR_SCNPTR (abfd, (bfd_byte *) scnhdr_ext->s_scnptr);
scnhdr_int->s_relptr =
GET_SCNHDR_RELPTR (abfd, (bfd_byte *) scnhdr_ext->s_relptr);
scnhdr_int->s_lnnoptr =
GET_SCNHDR_LNNOPTR (abfd, (bfd_byte *) scnhdr_ext->s_lnnoptr);
scnhdr_int->s_flags = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_flags);
scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, scnhdr_ext->s_vaddr);
scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr);
scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size);
scnhdr_int->s_scnptr = GET_SCNHDR_SCNPTR (abfd, scnhdr_ext->s_scnptr);
scnhdr_int->s_relptr = GET_SCNHDR_RELPTR (abfd, scnhdr_ext->s_relptr);
scnhdr_int->s_lnnoptr = GET_SCNHDR_LNNOPTR (abfd, scnhdr_ext->s_lnnoptr);
scnhdr_int->s_flags = H_GET_32 (abfd, scnhdr_ext->s_flags);
/* MS handles overflow of line numbers by carrying into the reloc
field (it appears). Since it's supposed to be zero for PE
*IMAGE* format, that's safe. This is still a bit iffy. */
#ifdef COFF_IMAGE_WITH_PE
scnhdr_int->s_nlnno =
(bfd_h_get_16 (abfd, (bfd_byte *) scnhdr_ext->s_nlnno)
+ (bfd_h_get_16 (abfd, (bfd_byte *) scnhdr_ext->s_nreloc) << 16));
scnhdr_int->s_nlnno = (H_GET_16 (abfd, scnhdr_ext->s_nlnno)
+ (H_GET_16 (abfd, scnhdr_ext->s_nreloc) << 16));
scnhdr_int->s_nreloc = 0;
#else
scnhdr_int->s_nreloc = bfd_h_get_16 (abfd,
(bfd_byte *) scnhdr_ext->s_nreloc);
scnhdr_int->s_nlnno = bfd_h_get_16 (abfd,
(bfd_byte *) scnhdr_ext->s_nlnno);
scnhdr_int->s_nreloc = H_GET_16 (abfd, scnhdr_ext->s_nreloc);
scnhdr_int->s_nlnno = H_GET_16 (abfd, scnhdr_ext->s_nlnno);
#endif
if (scnhdr_int->s_vaddr != 0)
@ -292,8 +278,9 @@ pe_mkobject (abfd)
bfd * abfd;
{
pe_data_type *pe;
abfd->tdata.pe_obj_data =
(struct pe_tdata *) bfd_zalloc (abfd, sizeof (pe_data_type));
bfd_size_type amt = sizeof (pe_data_type);
abfd->tdata.pe_obj_data = (struct pe_tdata *) bfd_zalloc (abfd, amt);
if (abfd->tdata.pe_obj_data == 0)
return false;
@ -541,7 +528,7 @@ pe_ILF_save_relocs (pe_ILF_vars * vars,
vars->int_reltab += vars->relcount;
vars->relcount = 0;
BFD_ASSERT ((bfd_byte *)vars->int_reltab < (bfd_byte *)vars->string_table);
BFD_ASSERT ((bfd_byte *) vars->int_reltab < (bfd_byte *) vars->string_table);
}
/* Create a global symbol and add it to the relevant tables. */
@ -587,8 +574,9 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars,
section = (asection_ptr) & bfd_und_section;
/* Initialise the external symbol. */
bfd_h_put_32 (vars->abfd, vars->string_ptr - vars->string_table, (bfd_byte *) esym->e.e.e_offset);
bfd_h_put_16 (vars->abfd, section->target_index, (bfd_byte *) esym->e_scnum);
H_PUT_32 (vars->abfd, vars->string_ptr - vars->string_table,
esym->e.e.e_offset);
H_PUT_16 (vars->abfd, section->target_index, esym->e_scnum);
esym->e_sclass[0] = sclass;
/* The following initialisations are unnecessary - the memory is
@ -666,7 +654,7 @@ pe_ILF_make_a_section (pe_ILF_vars * vars,
/* Set the section size and contents. The actual
contents are filled in by our parent. */
bfd_set_section_size (vars->abfd, sec, size);
bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size);
sec->contents = vars->data;
sec->target_index = vars->sec_index ++;
@ -767,7 +755,7 @@ static jump_table jtab[] =
/* Build a full BFD from the information supplied in a ILF object. */
static boolean
pe_ILF_build_a_bfd (bfd * abfd,
unsigned short magic,
unsigned int magic,
bfd_byte * symbol_name,
bfd_byte * source_dll,
unsigned int ordinal,
@ -795,12 +783,12 @@ pe_ILF_build_a_bfd (bfd * abfd,
case IMPORT_CONST:
/* XXX code yet to be written. */
_bfd_error_handler (_("%s: Unhandled import type; %x"),
bfd_get_filename (abfd), import_type);
bfd_archive_filename (abfd), import_type);
return false;
default:
_bfd_error_handler (_("%s: Unrecognised import type; %x"),
bfd_get_filename (abfd), import_type);
bfd_archive_filename (abfd), import_type);
return false;
}
@ -814,7 +802,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
default:
_bfd_error_handler (_("%s: Unrecognised import name type; %x"),
bfd_get_filename (abfd), import_name_type);
bfd_archive_filename (abfd), import_name_type);
return false;
}
@ -825,7 +813,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
We are going to construct the contents of the BFD in memory,
so allocate all the space that we will need right now. */
ptr = bfd_zalloc (abfd, ILF_DATA_SIZE);
ptr = bfd_zalloc (abfd, (bfd_size_type) ILF_DATA_SIZE);
if (ptr == NULL)
return false;
@ -933,11 +921,11 @@ pe_ILF_build_a_bfd (bfd * abfd,
if (import_name_type != IMPORT_ORDINAL)
{
pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6);
pe_ILF_save_relocs (& vars, id4);
pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6);
pe_ILF_save_relocs (&vars, id4);
pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6);
pe_ILF_save_relocs (& vars, id5);
pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6);
pe_ILF_save_relocs (&vars, id5);
}
/* Create extra sections depending upon the type of import we are dealing with. */
@ -976,16 +964,19 @@ pe_ILF_build_a_bfd (bfd * abfd,
#ifdef MIPS_ARCH_MAGIC_WINCE
if (magic == MIPS_ARCH_MAGIC_WINCE)
{
pe_ILF_make_a_symbol_reloc (& vars, 0, BFD_RELOC_HI16_S,
(struct symbol_cache_entry **) imp_sym, imp_index);
pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text);
pe_ILF_make_a_symbol_reloc (& vars, 4, BFD_RELOC_LO16,
(struct symbol_cache_entry **) imp_sym, imp_index);
pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 0, BFD_RELOC_HI16_S,
(struct symbol_cache_entry **) imp_sym,
imp_index);
pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_LO16, text);
pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 4, BFD_RELOC_LO16,
(struct symbol_cache_entry **) imp_sym,
imp_index);
}
else
#endif
pe_ILF_make_a_symbol_reloc (& vars, jtab[i].offset, BFD_RELOC_32,
(asymbol **) imp_sym, imp_index);
pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) jtab[i].offset,
BFD_RELOC_32, (asymbol **) imp_sym,
imp_index);
pe_ILF_save_relocs (& vars, text);
break;
@ -1006,7 +997,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
internal_f.f_nsyms = 0;
internal_f.f_flags = F_AR32WR | F_LNNO; /* XXX is this correct ? */
if ( ! bfd_set_start_address (abfd, 0)
if ( ! bfd_set_start_address (abfd, (bfd_vma) 0)
|| ! bfd_coff_set_arch_mach_hook (abfd, & internal_f))
return false;
@ -1031,8 +1022,6 @@ pe_ILF_build_a_bfd (bfd * abfd,
/* Now create a symbol describing the imported value. */
switch (import_type)
{
bfd_byte * ptr;
case IMPORT_CODE:
pe_ILF_make_a_symbol (& vars, "", symbol_name, text,
BSF_NOT_AT_END | BSF_FUNCTION);
@ -1087,23 +1076,23 @@ pe_ILF_object_p (bfd * abfd)
bfd_byte * symbol_name;
bfd_byte * source_dll;
unsigned int machine;
unsigned long size;
bfd_size_type size;
unsigned int ordinal;
unsigned int types;
unsigned short magic;
unsigned int magic;
/* Upon entry the first four buyes of the ILF header have
already been read. Now read the rest of the header. */
if (bfd_read (buffer, 1, 16, abfd) != 16)
if (bfd_bread (buffer, (bfd_size_type) 16, abfd) != 16)
return NULL;
ptr = buffer;
/* We do not bother to check the version number.
version = bfd_h_get_16 (abfd, ptr); */
version = H_GET_16 (abfd, ptr); */
ptr += 2;
machine = bfd_h_get_16 (abfd, ptr);
machine = H_GET_16 (abfd, ptr);
ptr += 2;
/* Check that the machine type is recognised. */
@ -1171,7 +1160,7 @@ pe_ILF_object_p (bfd * abfd)
_bfd_error_handler
(
_("%s: Unrecognised machine type (0x%x) in Import Library Format archive"),
bfd_get_filename (abfd), machine);
bfd_archive_filename (abfd), machine);
bfd_set_error (bfd_error_malformed_archive);
return NULL;
@ -1183,33 +1172,33 @@ _("%s: Unrecognised machine type (0x%x) in Import Library Format archive"),
_bfd_error_handler
(
_("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"),
bfd_get_filename (abfd), machine);
bfd_archive_filename (abfd), machine);
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
/* We do not bother to check the date.
date = bfd_h_get_32 (abfd, ptr); */
date = H_GET_32 (abfd, ptr); */
ptr += 4;
size = bfd_h_get_32 (abfd, ptr);
size = H_GET_32 (abfd, ptr);
ptr += 4;
if (size == 0)
{
_bfd_error_handler
(_("%s: size field is zero in Import Library Format header"),
bfd_get_filename (abfd));
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_malformed_archive);
return NULL;
}
ordinal = bfd_h_get_16 (abfd, ptr);
ordinal = H_GET_16 (abfd, ptr);
ptr += 2;
types = bfd_h_get_16 (abfd, ptr);
types = H_GET_16 (abfd, ptr);
/* ptr += 2; */
/* Now read in the two strings that follow. */
@ -1217,7 +1206,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
if (ptr == NULL)
return NULL;
if (bfd_read (ptr, 1, size, abfd) != size)
if (bfd_bread (ptr, size, abfd) != size)
return NULL;
symbol_name = ptr;
@ -1228,7 +1217,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
{
_bfd_error_handler
(_("%s: string not null terminated in ILF object file."),
bfd_get_filename (abfd));
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_malformed_archive);
return NULL;
@ -1251,19 +1240,19 @@ pe_bfd_object_p (bfd * abfd)
file_ptr offset;
/* Detect if this a Microsoft Import Library Format element. */
if (bfd_seek (abfd, 0x00, SEEK_SET) != 0
|| bfd_read (buffer, 1, 4, abfd) != 4)
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|| bfd_bread (buffer, (bfd_size_type) 4, abfd) != 4)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
if (bfd_h_get_32 (abfd, buffer) == 0xffff0000)
if (H_GET_32 (abfd, buffer) == 0xffff0000)
return pe_ILF_object_p (abfd);
if (bfd_seek (abfd, 0x00, SEEK_SET) != 0
|| bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd)
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|| bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd)
!= sizeof (dos_hdr))
{
if (bfd_get_error () != bfd_error_system_call)
@ -1281,24 +1270,23 @@ pe_bfd_object_p (bfd * abfd)
correctly for a PEI file, check the e_magic number here, and, if
it doesn't match, clobber the f_magic number so that we don't get
a false match. */
if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC)
if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC)
{
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew);
if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0
|| bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd)
!= sizeof (image_hdr))
offset = H_GET_32 (abfd, dos_hdr.e_lfanew);
if (bfd_seek (abfd, offset, SEEK_SET) != 0
|| (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd)
!= sizeof (image_hdr)))
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature)
!= 0x4550)
if (H_GET_32 (abfd, image_hdr.nt_signature) != 0x4550)
{
bfd_set_error (bfd_error_wrong_format);
return NULL;
@ -1307,10 +1295,7 @@ pe_bfd_object_p (bfd * abfd)
/* Here is the hack. coff_object_p wants to read filhsz bytes to
pick up the COFF header for PE, see "struct external_PEI_filehdr"
in include/coff/pe.h. We adjust so that that will work. */
if (bfd_seek (abfd,
(file_ptr) (offset - sizeof (dos_hdr)),
SEEK_SET)
!= 0)
if (bfd_seek (abfd, (file_ptr) (offset - sizeof (dos_hdr)), SEEK_SET) != 0)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);

View File

@ -1,5 +1,5 @@
/* BFD back-end for linux flavored sparc a.out binaries.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -439,6 +439,9 @@ linux_tally_symbols (h, data)
struct linux_link_hash_entry *h1, *h2;
boolean exists;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct linux_link_hash_entry *) h->root.root.u.i.link;
if (h->root.root.type == bfd_link_hash_undefined
&& strncmp (h->root.root.root.string, NEEDS_SHRLIB,
sizeof NEEDS_SHRLIB - 1) == 0)

View File

@ -167,13 +167,13 @@ srec_init ()
}
}
/* The maximum number of bytes on a line is FF. */
/* The maximum number of address+data+crc bytes on a line is FF. */
#define MAXCHUNK 0xff
/* Default size for a CHUNK. */
#define DEFAULT_CHUNK 16
/* The number of bytes we actually fit onto a line on output.
/* The number of data bytes we actually fit onto a line on output.
This variable can be modified by objcopy's --srec-len parameter.
For a 0x75 byte record you should set --srec-len=0x70. */
unsigned int Chunk = DEFAULT_CHUNK;
@ -936,7 +936,7 @@ srec_write_record (abfd, type, address, data, end)
const bfd_byte *data;
const bfd_byte *end;
{
char buffer[MAXCHUNK];
char buffer[2 * MAXCHUNK + 6];
unsigned int check_sum = 0;
const bfd_byte *src = data;
char *dst = buffer;
@ -994,15 +994,14 @@ static boolean
srec_write_header (abfd)
bfd *abfd;
{
bfd_byte buffer[MAXCHUNK];
bfd_byte *dst = buffer;
unsigned int i;
unsigned int len = strlen (abfd->filename);
/* I'll put an arbitary 40 char limit on header size. */
for (i = 0; i < 40 && abfd->filename[i]; i++)
*dst++ = abfd->filename[i];
if (len > 40)
len = 40;
return srec_write_record (abfd, 0, (bfd_vma) 0, buffer, dst);
return srec_write_record (abfd, 0, (bfd_vma) 0,
abfd->filename, abfd->filename + len);
}
static boolean
@ -1014,6 +1013,17 @@ srec_write_section (abfd, tdata, list)
unsigned int octets_written = 0;
bfd_byte *location = list->data;
/* Validate number of data bytes to write. The srec length byte
counts the address, data and crc bytes. S1 (tdata->type == 1)
records have two address bytes, S2 (tdata->type == 2) records
have three, and S3 (tdata->type == 3) records have four.
The total length can't exceed 255, and a zero data length will
spin for a long time. */
if (Chunk == 0)
Chunk = 1;
else if (Chunk > MAXCHUNK - tdata->type - 2)
Chunk = MAXCHUNK - tdata->type - 2;
while (octets_written < list->size)
{
bfd_vma address;
@ -1043,17 +1053,14 @@ srec_write_terminator (abfd, tdata)
bfd *abfd;
tdata_type *tdata;
{
bfd_byte buffer[2];
return srec_write_record (abfd, 10 - tdata->type,
abfd->start_address, buffer, buffer);
abfd->start_address, NULL, NULL);
}
static boolean
srec_write_symbols (abfd)
bfd *abfd;
{
char buffer[MAXCHUNK];
/* Dump out the symbols of a bfd. */
int i;
int count = bfd_get_symcount (abfd);
@ -1062,10 +1069,10 @@ srec_write_symbols (abfd)
{
bfd_size_type len;
asymbol **table = bfd_get_outsymbols (abfd);
sprintf (buffer, "$$ %s\r\n", abfd->filename);
len = strlen (buffer);
if (bfd_bwrite (buffer, len, abfd) != len)
len = strlen (abfd->filename);
if (bfd_bwrite ("$$ ", (bfd_size_type) 3, abfd) != 3
|| bfd_bwrite (abfd->filename, len, abfd) != len
|| bfd_bwrite ("\r\n", (bfd_size_type) 2, abfd) != 2)
return false;
for (i = 0; i < count; i++)
@ -1075,23 +1082,29 @@ srec_write_symbols (abfd)
&& (s->flags & BSF_DEBUGGING) == 0)
{
/* Just dump out non debug symbols. */
char buf2[40], *p;
char buf[42], *p;
sprintf_vma (buf2,
s->value + s->section->output_section->lma
+ s->section->output_offset);
p = buf2;
len = strlen (s->name);
if (bfd_bwrite (" ", (bfd_size_type) 2, abfd) != 2
|| bfd_bwrite (s->name, len, abfd) != len)
return false;
sprintf_vma (buf + 1, (s->value
+ s->section->output_section->lma
+ s->section->output_offset));
p = buf + 1;
while (p[0] == '0' && p[1] != 0)
p++;
sprintf (buffer, " %s $%s\r\n", s->name, p);
len = strlen (buffer);
if (bfd_bwrite (buffer, len, abfd) != len)
len = strlen (p);
p[len] = '\r';
p[len + 1] = '\n';
*--p = ' ';
len += 3;
if (bfd_bwrite (p, len, abfd) != len)
return false;
}
}
sprintf (buffer, "$$ \r\n");
len = strlen (buffer);
if (bfd_bwrite (buffer, len, abfd) != len)
if (bfd_bwrite ("$$ \r\n", (bfd_size_type) 5, abfd) != 5)
return false;
}

View File

@ -2052,6 +2052,9 @@ sunos_scan_dynamic_symbol (h, data)
{
struct bfd_link_info *info = (struct bfd_link_info *) data;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct sunos_link_hash_entry *) h->root.root.u.i.link;
/* Set the written flag for symbols we do not want to write out as
part of the regular symbol table. This is all symbols which are
not defined in a regular object file. For some reason symbols

View File

@ -545,23 +545,25 @@ struct section_to_type
adding entries. Since it is so short, a linear search is used. */
static const struct section_to_type stt[] =
{
{"*DEBUG*", 'N'},
{".bss", 'b'},
{"zerovars", 'b'}, /* MRI .bss */
{"code", 't'}, /* MRI .text */
{".data", 'd'},
{"vars", 'd'}, /* MRI .data */
{"*DEBUG*", 'N'},
{".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */
{".drectve", 'i'}, /* MSVC's .drective section */
{".edata", 'e'}, /* MSVC's .edata (export) section */
{".fini", 't'}, /* ELF fini section */
{".idata", 'i'}, /* MSVC's .idata (import) section */
{".init", 't'}, /* ELF init section */
{".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
{".rdata", 'r'}, /* Read only data. */
{".rodata", 'r'}, /* Read only data. */
{".sbss", 's'}, /* Small BSS (uninitialized data). */
{".scommon", 'c'}, /* Small common. */
{".sdata", 'g'}, /* Small initialized data. */
{".text", 't'},
{"code", 't'}, /* MRI .text */
{".drectve", 'i'}, /* MSVC's .drective section */
{".idata", 'i'}, /* MSVC's .idata (import) section */
{".edata", 'e'}, /* MSVC's .edata (export) section */
{".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
{".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */
{"vars", 'd'}, /* MRI .data */
{"zerovars", 'b'}, /* MRI .bss */
{0, 0}
};
@ -1236,9 +1238,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
for (; stab < (indexentry+1)->stab; stab += STABSIZE)
{
boolean done;
boolean done, saw_line, saw_func;
bfd_vma val;
saw_line = false;
saw_func = false;
done = false;
switch (stab[TYPEOFF])
@ -1259,7 +1263,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
/* A line number. The value is relative to the start of the
current function. */
val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF);
if (val <= offset)
/* If this line starts before our desired offset, or if it's
the first line we've been able to find, use it. The
!saw_line check works around a bug in GCC 2.95.3, which emits
the first N_SLINE late. */
if (!saw_line || val <= offset)
{
*pline = bfd_get_16 (abfd, stab + DESCOFF);
@ -1272,11 +1280,14 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
}
if (val > offset)
done = true;
saw_line = true;
break;
case N_FUN:
case N_SO:
done = true;
if (saw_func || saw_line)
done = true;
saw_func = true;
break;
}

View File

@ -1 +1 @@
#define BFD_VERSION_DATE 20020209
#define BFD_VERSION_DATE 20020412

View File

@ -97,6 +97,7 @@ extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd));
coff_bfd_get_relocated_section_contents
#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section
#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections
#define _bfd_xcoff_bfd_merge_sections coff_bfd_merge_sections
#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section
/* XCOFF archives do not have anything which corresponds to an

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,15 @@
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* dep-in.sed: Cope with absolute paths.
* Makefile.am (dep.sed): Subst TOPDIR.
Run "make dep-am".
* Makefile.in: Regenerate.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* aclocal.m4: Regenerate.
* configure: Regenerate.
2002-03-07 Daniel Jacobowitz <drow@mvista.com>
* README: Update some version numbers.

View File

@ -307,7 +307,8 @@ dep.sed: dep-in.sed config.status
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@BFDDIR@!$(BFDDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!' \
-e "s!@OBJDIR@!$${objdir}!"
-e "s!@OBJDIR@!$${objdir}!" \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/binutils$$,,`'!'
dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@ -376,11 +377,13 @@ arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h
coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h coffgrok.h
coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h $(INCDIR)/libiberty.h coffgrok.h \
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h
debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h
@ -435,21 +438,24 @@ rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h
srconv.o: srconv.c bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h sysroff.c
srconv.o: srconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
sysroff.c
stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
$(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h sysroff.h \
sysroff.c
$(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \
sysroff.h sysroff.c
version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h
@ -508,7 +514,8 @@ underscore.o: underscore.c
arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h arsup.h
arlex.o: arlex.c $(INCDIR)/libiberty.h arparse.h
arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
arparse.h
sysroff.o: sysroff.c
sysinfo.o: sysinfo.c
syslex.o: syslex.c sysinfo.h
@ -517,8 +524,8 @@ defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/fopen-same.h dlltool.h
deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
defparse.h dlltool.h
nlmheader.o: nlmheader.c $(INCDIR)/safe-ctype.h ../bfd/bfd.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
nlmheader.o: nlmheader.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \
../bfd/bfd.h $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
nlmconv.h
rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \

View File

@ -1032,7 +1032,8 @@ dep.sed: dep-in.sed config.status
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@BFDDIR@!$(BFDDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!' \
-e "s!@OBJDIR@!$${objdir}!"
-e "s!@OBJDIR@!$${objdir}!" \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/binutils$$,,`'!'
dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@ -1095,11 +1096,13 @@ arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h
coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h coffgrok.h
coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h $(INCDIR)/libiberty.h coffgrok.h \
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h
debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h
@ -1154,21 +1157,24 @@ rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h
srconv.o: srconv.c bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h sysroff.c
srconv.o: srconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
sysroff.c
stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
$(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h sysroff.h \
sysroff.c
$(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \
sysroff.h sysroff.c
version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h
@ -1227,7 +1233,8 @@ underscore.o: underscore.c
arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h arsup.h
arlex.o: arlex.c $(INCDIR)/libiberty.h arparse.h
arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
arparse.h
sysroff.o: sysroff.c
sysinfo.o: sysinfo.c
syslex.o: syslex.c sysinfo.h
@ -1236,8 +1243,8 @@ defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/fopen-same.h dlltool.h
deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
defparse.h dlltool.h
nlmheader.o: nlmheader.c $(INCDIR)/safe-ctype.h ../bfd/bfd.h \
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
nlmheader.o: nlmheader.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \
../bfd/bfd.h $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
$(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
nlmconv.h
rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \

View File

@ -1,6 +1,6 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -37,24 +37,6 @@ AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex])
AC_PROG_LEX
AC_DECL_YYTEXT])
#serial 1
# This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package)
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
# give these diagnostics:
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
undefine([AC_ISC_POSIX])
AC_DEFUN(AC_ISC_POSIX,
[
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
]
)
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@ -64,7 +46,7 @@ AC_DEFUN(AC_ISC_POSIX,
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
@ -92,7 +74,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
@ -133,7 +115,7 @@ AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
AC_DEFUN([AM_MISSING_PROG],
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
@ -149,7 +131,7 @@ AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
AC_DEFUN([AM_CONFIG_HEADER],
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
@ -175,7 +157,7 @@ changequote([,]))])
# serial 1
AC_DEFUN(AM_MAINTAINER_MODE,
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
@ -192,7 +174,7 @@ AC_DEFUN(AM_MAINTAINER_MODE,
# Define a conditional.
AC_DEFUN(AM_CONDITIONAL,
AC_DEFUN([AM_CONDITIONAL],
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ AC_CANONICAL_SYSTEM
AC_ISC_POSIX
changequote(,)dnl
BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
BFD_VERSION_STRING=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
changequote([,])dnl
AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})

View File

@ -3,7 +3,9 @@
/\\$/b loop
s!@INCDIR@!$(INCDIR)!g
s!@TOPDIR@/include!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
s!@TOPDIR@/bfd!$(BFDDIR)!g
s!@SRCDIR@/!!g
s!@OBJDIR@/!!g

View File

@ -1071,7 +1071,7 @@ unw_decode_b3_x4 (dp, code, arg)
}
typedef const unsigned char *(*unw_decoder)
PARAMS ((const unsigned char *, unsigned char, void *));
PARAMS ((const unsigned char *, unsigned int, void *));
static unw_decoder unw_decode_table[2][8] =
{

View File

@ -1,3 +1,112 @@
2002-04-10 Alan Modra <amodra@bigpond.net.au>
* as.c (parse_args <OPTION_VERSION>): Use VERSION is
BFD_VERSION_STRING unavailable.
* config/tc-i386.c (INLINE): Define (for non-BFD assembler).
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* dep-in.sed: Cope with absolute paths.
* Makefile.am (dep.sed): Subst TOPDIR.
Run "make dep-am".
* Makefile.in: Regenerate.
2002-04-01 Jessica Han <jessica@cup.hp.com>
* config/tc-ia64.c (ia64_cons_fix_new): Handle 8 byte iplt reloc
in 32-bit mode.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
Merge from mainline.
2002-03-12 Andreas Schwab <schwab@suse.de>
* config/tc-ia64.c (fixup_unw_records): Clear region when seeing a
body record so that an error is given for misplaced .save
pseudo-ops.
2002-03-09 Alan Modra <amodra@bigpond.net.au>
* config/tc-i386.h (REX_OPCODE): Define.
(REX_MODE64, REX_EXTX, REX_EXTY, REX_EXTZ): Define.
(rex_byte): typedef to int.
* config/tc-i386.c: Group prototypes and vars together.
Formatting fixes. Remove occurrences of "register" keyword.
(true): Delete.
(false): Delete.
(mode_from_disp_size): Add INLINE keyword to prototype.
(fits_in_signed_byte): Likewise.
(fits_in_unsigned_byte): Likewise.
(fits_in_unsigned_word): Likewise.
(fits_in_signed_word): Likewise.
(fits_in_unsigned_long): Likewise.
(fits_in_signed_long): Likewise.
(type_names): Constify.
(intel_float_operand): Constify param.
(add_prefix): Use REX_OPCODE.
(md_assemble): Likewise. Modify for changed rex_byte.
(parse_insn): Split out of md_assemble.
(parse_operands): Likewise.
(swap_operands): Likewise.
(optimize_imm): Likewise.
(optimize_disp): Likewise.
(match_template): Likewise.
(check_string): Likewise.
(process_suffix): Likewise.
(check_byte_reg): Likewise.
(check_long_reg): Likewise.
(check_qword_reg): Likewise.
(check_word_reg): Likewise.
(finalize_imm): Likewise.
(process_operands): Likewise.
(build_modrm_byte): Likewise.
(output_insn): Likewise.
(output_branch): Likewise.
(output_jump): Likewise.
(output_interseg_jump): Likewise.
(output_disp): Likewise.
(output_imm): Likewise.
2002-03-06 Alan Modra <amodra@bigpond.net.au>
* config/tc-i386.c (tc_gen_reloc): Don't attempt to handle 8 byte
relocs except when BFD64.
* write.c (number_to_chars_bigendian): Don't abort when N is
larger than sizeof (VAL).
(number_to_chars_littleendian): Likewise.
2002-03-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
* config/tc-hppa.c (md_apply_fix3): Add cast.
(hppa_fix_adjustable): Adjust list of selectors using e_lrsel and
e_rrsel.
2002-03-04 H.J. Lu <hjl@gnu.org>
* config/obj-elf.c (special_section): Add .init_array,
.fini_array and .preinit_array.
* config/tc-ia64.h (ELF_TC_SPECIAL_SECTIONS): Remove
.init_array and .fini_array.
2002-03-01 Jakub Jelinek <jakub@redhat.com>
* config/obj-elf.c (elf_copy_symbol_attributes): Don't copy
visibility.
(obj_frob_symbol): Copy visibility.
2002-03-27 Andreas Schwab <schwab@suse.de>
* config/tc-i386.c (md_assemble): Set fx_pcrel_adjust to size of
field for pc-relative fixups.
(md_estimate_size_before_relax): Likewise.
(tc_gen_reloc): Subtract fx_pcrel_adjust instead of fx_size for
pc-relative fixups in 64bit mode.
2002-03-20 Albert Chin-A-Young <china@thewrittenword.com>
* config/tc-arm.c (vfp_dp_reg_required_here): Fix typo
(vfp_sp_reg_pos -> vfp_dp_reg_pos).
2002-03-19 Alexandre Oliva <aoliva@redhat.com>
* config/tc-mips.c (md_estimate_size_before_relax): Do not modify
@ -146,7 +255,7 @@ Fri Feb 15 15:18:51 CET 2002 Jan Hubicka <jh@suse.cz>
2002-02-11 Tom Rix <trix@redhat.com>
* config/tc-ppc.c (md_apply_fix3): Check for insert fop invalid for
* config/tc-ppc.c (md_apply_fix3): Check for insert fop invalid for
xcoff64.
2002-02-11 Alexandre Oliva <aoliva@redhat.com>
@ -364,7 +473,7 @@ Fri Feb 15 15:18:51 CET 2002 Jan Hubicka <jh@suse.cz>
BFD_RELOC_SH_PT_16>: Set lowest bit in field to be relocated to 1.
(shmedia_md_convert_frag) <case C (SH64PCREL16_32, SH64PCREL16) et
al>: Set lowest bit of field to relocate to 1 and rest to empty,
if reloc is emitted.
if reloc is emitted.
2000-12-31 Hans-Peter Nilsson <hpn@cygnus.com>
New options plus bugfixes.
* config/tc-sh.c (md_longopts): New options "-no-expand" and
@ -673,7 +782,7 @@ Fri Feb 15 15:18:51 CET 2002 Jan Hubicka <jh@suse.cz>
* config/tc-sh.c (parse_at): Install the correct version of
2002-02-04's patch.
* config/tc-sh.c (md_apply_fix3) <BFD_RELOC_32_PLT_PCREL>: Don't
assume fixP->fx_subsy is non-NULL.
@ -730,7 +839,7 @@ Fri Feb 15 15:18:51 CET 2002 Jan Hubicka <jh@suse.cz>
Support on-demand global register allocation by passing on
base-plus-offset relocs to the linker.
* config/tc-mmix.c: Tweak and fix typos in comments.
(allocate_undefined_gregs_in_linker): New variable.
(allocate_undefined_gregs_in_linker): New variable.
(OPTION_LINKER_ALLOCATED_GREGS): New option macro.
(md_longopts): Add --linker-allocated-gregs.
(md_parse_option) <case 'x'>: Imply --linker-allocated-gregs.
@ -846,7 +955,7 @@ Fri Feb 15 15:18:51 CET 2002 Jan Hubicka <jh@suse.cz>
2002-01-21 Jason Thorpe <thorpej@wasabisystems.com>
* configure.in (ia64-*-netbsd*): New target.
* configure: Regenerate.
* configure: Regenerate.
2002-01-21 Hans-Peter Nilsson <hp@bitrange.com>
@ -885,7 +994,7 @@ Fri Feb 15 15:18:51 CET 2002 Jan Hubicka <jh@suse.cz>
* NEWS: Mention new ARM command-line options and VFP support.
* config/tc-arm.c (ARM_CEXT_XSCALE): Replaces ARM_EXT_XSCALE. All
* config/tc-arm.c (ARM_CEXT_XSCALE): Replaces ARM_EXT_XSCALE. All
uses changed.
(ARM_CEXT_MAVERICK): Similarly.
(ARM_ANY): Now means any core instruction.

View File

@ -921,7 +921,8 @@ dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
-e "s!@INCDIR@!$${srcdir}/../include!" \
-e "s!@BFDDIR@!$${srcdir}/../bfd!" \
-e "s!@SRCDIR@!$${srcdir}!"
-e "s!@SRCDIR@!$${srcdir}!" \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gas,,`'!'
dep: DEP
sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \
@ -1084,12 +1085,14 @@ DEPTC_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \
dwarf2dbg.h
DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-ia64.h $(INCDIR)/coff/internal.h \
$(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h
DEPTC_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \
$(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h
DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \
@ -1413,15 +1416,23 @@ DEPTC_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \
subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h
DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \
dwarf2dbg.h
$(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/v850.h dwarf2dbg.h
DEPTC_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/v850.h dwarf2dbg.h
$(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \
dwarf2dbg.h
DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
$(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \
$(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h
DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
@ -1787,20 +1798,6 @@ DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(srcdir)/../opcodes/sh64-opc.h $(srcdir)/config/tc-sh.c \
subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \
struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
dwarf2dbg.h $(INCDIR)/symcat.h
DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h $(INCDIR)/elf/sh.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h
DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
$(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
@ -1889,6 +1886,17 @@ DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@ -2193,6 +2201,14 @@ DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h
DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h
@ -2237,8 +2253,8 @@ input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \
$(INCDIR)/safe-ctype.h
input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \
sb.h
listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \
input-file.h subsegs.h
listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \
$(INCDIR)/safe-ctype.h input-file.h subsegs.h
literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h
macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h
messages.o: messages.c $(INCDIR)/symcat.h
@ -2253,7 +2269,8 @@ symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/obstack.h subsegs.h struc-symbol.h
write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \
output-file.h dwarf2dbg.h
gasp.o: gasp.c $(INCDIR)/safe-ctype.h sb.h macro.h
gasp.o: gasp.c $(INCDIR)/getopt.h $(INCDIR)/safe-ctype.h \
sb.h macro.h
itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h
e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \
emul-target.h

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -818,13 +818,15 @@ DEPTC_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
dwarf2dbg.h
DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-ia64.h $(INCDIR)/coff/internal.h \
$(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h
DEPTC_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \
$(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h
DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
@ -1216,16 +1218,25 @@ DEPTC_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h
DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \
dwarf2dbg.h
$(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/v850.h dwarf2dbg.h
DEPTC_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/v850.h dwarf2dbg.h
$(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \
dwarf2dbg.h
DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
$(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \
$(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h
DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \
@ -1677,23 +1688,6 @@ DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(srcdir)/../opcodes/sh64-opc.h $(srcdir)/config/tc-sh.c \
subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \
struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
dwarf2dbg.h $(INCDIR)/symcat.h
DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h $(INCDIR)/elf/sh.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h
DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
$(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
@ -1803,6 +1797,19 @@ DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@ -2211,6 +2218,16 @@ DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h
DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h
@ -2282,7 +2299,7 @@ configure configure.in gdbinit.in itbl-lex.c itbl-parse.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
@ -2443,7 +2460,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@ -3076,7 +3093,8 @@ dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
-e "s!@INCDIR@!$${srcdir}/../include!" \
-e "s!@BFDDIR@!$${srcdir}/../bfd!" \
-e "s!@SRCDIR@!$${srcdir}!"
-e "s!@SRCDIR@!$${srcdir}!" \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gas,,`'!'
dep: DEP
sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \
@ -3124,8 +3142,8 @@ input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \
$(INCDIR)/safe-ctype.h
input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \
sb.h
listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \
input-file.h subsegs.h
listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \
$(INCDIR)/safe-ctype.h input-file.h subsegs.h
literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h
macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h
messages.o: messages.c $(INCDIR)/symcat.h
@ -3140,7 +3158,8 @@ symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/obstack.h subsegs.h struc-symbol.h
write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \
output-file.h dwarf2dbg.h
gasp.o: gasp.c $(INCDIR)/safe-ctype.h sb.h macro.h
gasp.o: gasp.c $(INCDIR)/getopt.h $(INCDIR)/safe-ctype.h \
sb.h macro.h
itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h
e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \
emul-target.h

View File

@ -1,6 +1,6 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -92,7 +92,7 @@ AC_SUBST(INTLLIBS)
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
@ -120,7 +120,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
@ -161,7 +161,7 @@ AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
AC_DEFUN([AM_MISSING_PROG],
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
@ -177,7 +177,7 @@ AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
AC_DEFUN([AM_CONFIG_HEADER],
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
@ -201,9 +201,9 @@ changequote([,]))])
dnl AM_PROG_LEX
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
AC_DEFUN(AM_PROG_LEX,
AC_DEFUN([AM_PROG_LEX],
[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
AC_CHECK_PROGS(LEX, flex lex, $missing_dir/missing flex)
AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
AC_PROG_LEX
AC_DECL_YYTEXT])
@ -212,7 +212,7 @@ AC_DECL_YYTEXT])
# serial 1
AC_DEFUN(AM_MAINTAINER_MODE,
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
@ -229,7 +229,7 @@ AC_DEFUN(AM_MAINTAINER_MODE,
# Define a conditional.
AC_DEFUN(AM_CONDITIONAL,
AC_DEFUN([AM_CONDITIONAL],
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then

View File

@ -524,7 +524,11 @@ parse_args (pargc, pargv)
case OPTION_VERSION:
/* This output is intended to follow the GNU standards document. */
#ifdef BFD_ASSEMBLER
printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
#else
printf (_("GNU assembler %s\n"), VERSION);
#endif
printf (_("Copyright 2002 Free Software Foundation, Inc.\n"));
printf (_("\
This program is free software; you may redistribute it under the terms of\n\

View File

@ -130,6 +130,9 @@
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

View File

@ -1,5 +1,5 @@
/* atof_vax.c - turn a Flonum into a VAX floating point number
Copyright (C) 1987, 1992, 93, 95, 97, 98, 1999
Copyright 1987, 1992, 1993, 1995, 1997, 1999, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -27,20 +27,20 @@ static void make_invalid_floating_point_number PARAMS ((LITTLENUM_TYPE *));
static int what_kind_of_float PARAMS ((int, int *, long *));
static char *atof_vax PARAMS ((char *, int, LITTLENUM_TYPE *));
/* Precision in LittleNums. */
/* Precision in LittleNums. */
#define MAX_PRECISION (8)
#define H_PRECISION (8)
#define G_PRECISION (4)
#define D_PRECISION (4)
#define F_PRECISION (2)
/* Length in LittleNums of guard bits. */
/* Length in LittleNums of guard bits. */
#define GUARD (2)
int flonum_gen2vax PARAMS ((int format_letter, FLONUM_TYPE * f,
LITTLENUM_TYPE * words));
/* Number of chars in flonum type 'letter'. */
/* Number of chars in flonum type 'letter'. */
static int
atof_vax_sizeof (letter)
int letter;
@ -154,13 +154,13 @@ make_invalid_floating_point_number (words)
*words = 0x8000; /* Floating Reserved Operand Code */
}
static int /* 0 means letter is OK. */
static int /* 0 means letter is OK. */
what_kind_of_float (letter, precisionP, exponent_bitsP)
int letter; /* In: lowercase please. What kind of float? */
int *precisionP; /* Number of 16-bit words in the float. */
long *exponent_bitsP; /* Number of exponent bits. */
int *precisionP; /* Number of 16-bit words in the float. */
long *exponent_bitsP; /* Number of exponent bits. */
{
int retval; /* 0: OK. */
int retval; /* 0: OK. */
retval = 0;
switch (letter)
@ -201,19 +201,19 @@ what_kind_of_float (letter, precisionP, exponent_bitsP)
* *
\***********************************************************************/
static char * /* Return pointer past text consumed. */
static char * /* Return pointer past text consumed. */
atof_vax (str, what_kind, words)
char *str; /* Text to convert to binary. */
char *str; /* Text to convert to binary. */
int what_kind; /* 'd', 'f', 'g', 'h' */
LITTLENUM_TYPE *words; /* Build the binary here. */
LITTLENUM_TYPE *words; /* Build the binary here. */
{
FLONUM_TYPE f;
LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD];
/* Extra bits for zeroed low-order bits. */
/* Extra bits for zeroed low-order bits. */
/* The 1st MAX_PRECISION are zeroed, */
/* the last contain flonum bits. */
/* the last contain flonum bits. */
char *return_value;
int precision; /* Number of 16-bit words in the format. */
int precision; /* Number of 16-bit words in the format. */
long exponent_bits;
return_value = str;
@ -225,7 +225,7 @@ atof_vax (str, what_kind, words)
if (what_kind_of_float (what_kind, &precision, &exponent_bits))
{
return_value = NULL; /* We lost. */
return_value = NULL; /* We lost. */
make_invalid_floating_point_number (words);
}
@ -235,7 +235,7 @@ atof_vax (str, what_kind, words)
/* Use more LittleNums than seems */
/* necessary: the highest flonum may have */
/* 15 leading 0 bits, so could be useless. */
/* 15 leading 0 bits, so could be useless. */
f.high = f.low + precision - 1 + GUARD;
if (atof_generic (&return_value, ".", "eE", &f))
@ -259,16 +259,16 @@ atof_vax (str, what_kind, words)
* Out: a vax floating-point bit pattern.
*/
int /* 0: OK. */
int /* 0: OK. */
flonum_gen2vax (format_letter, f, words)
int format_letter; /* One of 'd' 'f' 'g' 'h'. */
int format_letter; /* One of 'd' 'f' 'g' 'h'. */
FLONUM_TYPE *f;
LITTLENUM_TYPE *words; /* Deliver answer here. */
LITTLENUM_TYPE *words; /* Deliver answer here. */
{
LITTLENUM_TYPE *lp;
int precision;
long exponent_bits;
int return_value; /* 0 == OK. */
int return_value; /* 0 == OK. */
return_value = what_kind_of_float (format_letter, &precision, &exponent_bits);
@ -280,7 +280,7 @@ flonum_gen2vax (format_letter, f, words)
{
if (f->low > f->leader)
{
/* 0.0e0 seen. */
/* 0.0e0 seen. */
memset (words, '\0', sizeof (LITTLENUM_TYPE) * precision);
}
else
@ -340,13 +340,13 @@ flonum_gen2vax (format_letter, f, words)
exponent_skippage++);;
exponent_1 = f->exponent + f->leader + 1 - f->low;
/* Radix LITTLENUM_RADIX, point just higher than f->leader. */
/* Radix LITTLENUM_RADIX, point just higher than f->leader. */
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
/* Radix 2. */
/* Radix 2. */
exponent_3 = exponent_2 - exponent_skippage;
/* Forget leading zeros, forget 1st bit. */
/* Forget leading zeros, forget 1st bit. */
exponent_4 = exponent_3 + (1 << (exponent_bits - 1));
/* Offset exponent. */
/* Offset exponent. */
if (exponent_4 & ~mask[exponent_bits])
{
@ -366,14 +366,14 @@ flonum_gen2vax (format_letter, f, words)
{
lp = words;
/* Word 1. Sign, exponent and perhaps high bits. */
/* Assume 2's complement integers. */
/* Word 1. Sign, exponent and perhaps high bits. */
/* Assume 2's complement integers. */
word1 = (((exponent_4 & mask[exponent_bits]) << (15 - exponent_bits))
| ((f->sign == '+') ? 0 : 0x8000)
| next_bits (15 - exponent_bits));
*lp++ = word1;
/* The rest of the words are just mantissa bits. */
/* The rest of the words are just mantissa bits. */
for (; lp < words + precision; lp++)
{
*lp = next_bits (LITTLENUM_NUMBER_OF_BITS);
@ -426,7 +426,6 @@ flonum_gen2vax (format_letter, f, words)
return (return_value);
} /* flonum_gen2vax() */
/* JF this used to be in vax.c but this looks like a better place for it */
/*
@ -446,7 +445,7 @@ flonum_gen2vax (format_letter, f, words)
* Number of chars we used for the literal.
*/
#define MAXIMUM_NUMBER_OF_LITTLENUMS (8) /* For .hfloats. */
#define MAXIMUM_NUMBER_OF_LITTLENUMS (8) /* For .hfloats. */
char *
md_atof (what_statement_type, literalP, sizeP)

View File

@ -595,6 +595,27 @@ static struct special_section const special_sections[] =
{ ".rodata", SHT_PROGBITS, SHF_ALLOC },
{ ".rodata1", SHT_PROGBITS, SHF_ALLOC },
{ ".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
#if 0
/* FIXME: The current gcc, as of 2002-03-03, will emit
.section .init_array,"aw",@progbits
for __attribute__ ((section (".init_array"))). "@progbits" marks
the incorrect section type. For now, we make them with
SHT_PROGBITS. BFD will fix the section type. Gcc should be changed
to emit
.section .init_array
*/
{ ".init_array",SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE },
{ ".fini_array",SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE },
{ ".preinit_array",SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
#else
{ ".init_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".fini_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".preinit_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
#endif
#ifdef ELF_TC_SPECIAL_SECTIONS
ELF_TC_SPECIAL_SECTIONS
@ -1408,7 +1429,9 @@ elf_copy_symbol_attributes (dest, src)
destelf->size = NULL;
}
S_SET_SIZE (dest, S_GET_SIZE (src));
S_SET_OTHER (dest, S_GET_OTHER (src));
/* Don't copy visibility. */
S_SET_OTHER (dest, (ELF_ST_VISIBILITY (S_GET_OTHER (dest))
| (S_GET_OTHER (src) & ~ELF_ST_VISIBILITY (-1))));
}
void
@ -1839,6 +1862,8 @@ elf_frob_symbol (symp, puntp)
/* This will copy over the size information. */
copy_symbol_attributes (symp2, symp);
S_SET_OTHER (symp2, S_GET_OTHER (symp));
if (S_IS_WEAK (symp))
S_SET_WEAK (symp2);

View File

@ -6425,7 +6425,7 @@ vfp_sp_reg_required_here (str, pos)
static int
vfp_dp_reg_required_here (str, pos)
char **str;
enum vfp_sp_reg_pos pos;
enum vfp_dp_reg_pos pos;
{
int reg;
char *start = *str;

File diff suppressed because it is too large Load Diff

View File

@ -467,15 +467,17 @@ typedef struct
modrm_byte;
/* x86-64 extension prefix. */
typedef struct
{
unsigned int mode64;
unsigned int extX; /* Used to extend modrm reg field. */
unsigned int extY; /* Used to extend SIB index field. */
unsigned int extZ; /* Used to extend modrm reg/mem, SIB base, modrm base fields. */
unsigned int empty; /* Used to old-style byte registers to new style. */
}
rex_byte;
typedef int rex_byte;
#define REX_OPCODE 0x40
/* Indicates 64 bit operand size. */
#define REX_MODE64 8
/* High extension to reg field of modrm byte. */
#define REX_EXTX 4
/* High extension to SIB index field. */
#define REX_EXTY 2
/* High extension to base field of modrm or SIB, or reg field of opcode. */
#define REX_EXTZ 1
/* 386 opcode byte to code indirect addressing. */
typedef struct

View File

@ -2709,7 +2709,11 @@ fixup_unw_records (list)
size = (slot_index (last_addr, last_frag, first_addr, first_frag)
+ dir_len);
rlen = ptr->r.record.r.rlen = size;
region = ptr;
if (ptr->r.type == body)
/* End of region. */
region = 0;
else
region = ptr;
break;
}
case epilogue:
@ -3250,7 +3254,7 @@ generate_unwind_image (text_name)
size = output_unw_records (unwind.list, (void **) &unw_rec);
if (size % md.pointer_size != 0)
as_bad ("Unwind record is not a multiple of %d bytes.", md.pointer_size);
/* If there are unwind records, switch sections, and output the info. */
if (size != 0)
{
@ -9982,11 +9986,26 @@ ia64_cons_fix_new (f, where, nbytes, exp)
break;
case 8:
if (target_big_endian)
code = BFD_RELOC_IA64_DIR64MSB;
else
code = BFD_RELOC_IA64_DIR64LSB;
break;
/* In 32-bit mode, data8 could mean function descriptors too. */
if (exp->X_op == O_pseudo_fixup
&& exp->X_op_symbol
&& S_GET_VALUE (exp->X_op_symbol) == FUNC_IPLT_RELOC
&& !(md.flags & EF_IA_64_ABI64))
{
if (target_big_endian)
code = BFD_RELOC_IA64_IPLTMSB;
else
code = BFD_RELOC_IA64_IPLTLSB;
exp->X_op = O_symbol;
break;
}
else {
if (target_big_endian)
code = BFD_RELOC_IA64_DIR64MSB;
else
code = BFD_RELOC_IA64_DIR64LSB;
break;
}
case 16:
if (exp->X_op == O_pseudo_fixup

View File

@ -124,8 +124,6 @@ extern void ia64_after_parse_args PARAMS ((void));
#define WORKING_DOT_WORD /* don't do broken word processing for now */
#define ELF_TC_SPECIAL_SECTIONS \
{ ".init_array",SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, \
{ ".fini_array",SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, \
{ ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, \
{ ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },

View File

@ -1,5 +1,5 @@
/* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of GAS, the GNU Assembler.
@ -25,6 +25,7 @@
Please help us make it better. */
#include "as.h"
#include "safe-ctype.h"
#include "opcode/tic30.h"
/* Put here all non-digit non-letter charcters that may occur in an
@ -188,25 +189,25 @@ md_begin ()
for (c = 0; c < 256; c++)
{
if (islower (c) || isdigit (c))
if (ISLOWER (c) || ISDIGIT (c))
{
opcode_chars[c] = c;
register_chars[c] = c;
}
else if (isupper (c))
else if (ISUPPER (c))
{
opcode_chars[c] = tolower (c);
opcode_chars[c] = TOLOWER (c);
register_chars[c] = opcode_chars[c];
}
else if (c == ')' || c == '(')
{
register_chars[c] = c;
}
if (isupper (c) || islower (c) || isdigit (c))
if (ISUPPER (c) || ISLOWER (c) || ISDIGIT (c))
operand_chars[c] = c;
if (isdigit (c) || c == '-')
if (ISDIGIT (c) || c == '-')
digit_chars[c] = c;
if (isalpha (c) || c == '_' || c == '.' || isdigit (c))
if (ISALPHA (c) || c == '_' || c == '.' || ISDIGIT (c))
identifier_chars[c] = c;
if (c == ' ' || c == '\t')
space_chars[c] = c;
@ -1267,7 +1268,7 @@ tic30_operand (token)
ind_buffer[0] = *token;
for (count = 1; count < strlen (token); count++)
{ /* Strip operand */
ind_buffer[buffer_posn] = tolower (*(token + count));
ind_buffer[buffer_posn] = TOLOWER (*(token + count));
if ((*(token + count - 1) == 'a' || *(token + count - 1) == 'A') &&
(*(token + count) == 'r' || *(token + count) == 'R'))
{
@ -1486,12 +1487,12 @@ tic30_find_parallel_insn (current_line, next_line)
{
if (is_opcode_char (c) && search_status == NONE)
{
opcode[char_ptr++] = tolower (c);
opcode[char_ptr++] = TOLOWER (c);
search_status = START_OPCODE;
}
else if (is_opcode_char (c) && search_status == START_OPCODE)
{
opcode[char_ptr++] = tolower (c);
opcode[char_ptr++] = TOLOWER (c);
}
else if (!is_opcode_char (c) && search_status == START_OPCODE)
{
@ -1558,10 +1559,11 @@ md_convert_frag (abfd, sec, fragP)
debug ("In md_convert_frag()\n");
}
int
md_apply_fix (fixP, valP)
void
md_apply_fix3 (fixP, valP, seg)
fixS *fixP;
valueT *valP;
segT seg ATTRIBUTE_UNUSED;
{
valueT value = *valP;
@ -1573,15 +1575,18 @@ md_apply_fix (fixP, valP)
debug ("fx_offset = %d\n", (int) fixP->fx_offset);
{
char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
value /= INSN_SIZE;
if (fixP->fx_size == 1)
{ /* Special fix for LDP instruction. */
value = (value & 0x00FF0000) >> 16;
}
/* Special fix for LDP instruction. */
value = (value & 0x00FF0000) >> 16;
debug ("new value = %ld\n", (long) value);
md_number_to_chars (buf, value, fixP->fx_size);
}
return 1;
if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
fixP->fx_done = 1;
}
int
@ -1868,7 +1873,7 @@ char *
output_invalid (c)
char c;
{
if (isprint (c))
if (ISPRINT (c))
sprintf (output_invalid_buf, "'%c'", c);
else
sprintf (output_invalid_buf, "(0x%x)", (unsigned) c);

View File

@ -1,5 +1,5 @@
/* tc-v850.c -- Assembler code for the NEC V850
Copyright 1996, 1997, 1998, 1999, 2000, 2001
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -20,16 +20,12 @@
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <ctype.h>
#include "as.h"
#include "safe-ctype.h"
#include "subsegs.h"
#include "opcode/v850.h"
#include "dwarf2dbg.h"
#define AREA_ZDA 0
#define AREA_SDA 1
#define AREA_TDA 2
/* Sign-extend a 16-bit number. */
#define SEXT16(x) ((((x) & 0xffff) ^ (~0x7fff)) + 0x8000)
@ -82,20 +78,6 @@ const relax_typeS md_relax_table[] = {
{0x1fffff, -0x200000, 4, 0},
};
static segT sdata_section = NULL;
static segT tdata_section = NULL;
static segT zdata_section = NULL;
static segT sbss_section = NULL;
static segT tbss_section = NULL;
static segT zbss_section = NULL;
static segT rosdata_section = NULL;
static segT rozdata_section = NULL;
static segT scommon_section = NULL;
static segT tcommon_section = NULL;
static segT zcommon_section = NULL;
static segT call_table_data_section = NULL;
static segT call_table_text_section = NULL;
/* Fixups. */
#define MAX_INSN_FIXUPS (5)
struct v850_fixup {
@ -106,121 +88,108 @@ struct v850_fixup {
struct v850_fixup fixups[MAX_INSN_FIXUPS];
static int fc;
void
v850_sdata (int ignore ATTRIBUTE_UNUSED)
struct v850_seg_entry
{
segT s;
const char *name;
flagword flags;
};
struct v850_seg_entry v850_seg_table[] =
{
{ NULL, ".sdata",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
| SEC_SMALL_DATA },
{ NULL, ".tdata",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS },
{ NULL, ".zdata",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS },
{ NULL, ".sbss",
SEC_ALLOC | SEC_SMALL_DATA },
{ NULL, ".tbss",
SEC_ALLOC },
{ NULL, ".zbss",
SEC_ALLOC},
{ NULL, ".rosdata",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_DATA
| SEC_HAS_CONTENTS | SEC_SMALL_DATA },
{ NULL, ".rozdata",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_DATA
| SEC_HAS_CONTENTS },
{ NULL, ".scommon",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
| SEC_SMALL_DATA | SEC_IS_COMMON },
{ NULL, ".tcommon",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
| SEC_IS_COMMON },
{ NULL, ".zcommon",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS
| SEC_IS_COMMON },
{ NULL, ".call_table_data",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS },
{ NULL, ".call_table_text",
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | SEC_CODE
| SEC_HAS_CONTENTS},
{ NULL, ".bss",
SEC_ALLOC }
};
#define SDATA_SECTION 0
#define TDATA_SECTION 1
#define ZDATA_SECTION 2
#define SBSS_SECTION 3
#define TBSS_SECTION 4
#define ZBSS_SECTION 5
#define ROSDATA_SECTION 6
#define ROZDATA_SECTION 7
#define SCOMMON_SECTION 8
#define TCOMMON_SECTION 9
#define ZCOMMON_SECTION 10
#define CALL_TABLE_DATA_SECTION 11
#define CALL_TABLE_TEXT_SECTION 12
#define BSS_SECTION 13
static void do_v850_seg PARAMS ((int, subsegT));
static void
do_v850_seg (i, sub)
int i;
subsegT sub;
{
struct v850_seg_entry *seg = v850_seg_table + i;
obj_elf_section_change_hook ();
if (seg->s != NULL)
{
subseg_set (seg->s, sub);
}
else
{
seg->s = subseg_new (seg->name, sub);
bfd_set_section_flags (stdoutput, seg->s, seg->flags);
if ((seg->flags & SEC_LOAD) == 0)
seg_info (seg->s)->bss = 1;
}
}
subseg_set (sdata_section, (subsegT) get_absolute_expression ());
static void v850_seg PARAMS ((int i));
static void
v850_seg (i)
int i;
{
subsegT sub = get_absolute_expression ();
do_v850_seg (i, sub);
demand_empty_rest_of_line ();
}
void
v850_tdata (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
static void v850_offset PARAMS ((int));
subseg_set (tdata_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_zdata (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (zdata_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_sbss (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (sbss_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_tbss (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (tbss_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_zbss (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (zbss_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_rosdata (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (rosdata_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_rozdata (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (rozdata_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_call_table_data (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (call_table_data_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_call_table_text (int ignore ATTRIBUTE_UNUSED)
{
obj_elf_section_change_hook ();
subseg_set (call_table_text_section, (subsegT) get_absolute_expression ());
demand_empty_rest_of_line ();
}
void
v850_bss (int ignore ATTRIBUTE_UNUSED)
{
register int temp = get_absolute_expression ();
obj_elf_section_change_hook ();
subseg_set (bss_section, (subsegT) temp);
demand_empty_rest_of_line ();
}
void
v850_offset (int ignore ATTRIBUTE_UNUSED)
static void
v850_offset (ignore)
int ignore ATTRIBUTE_UNUSED;
{
int temp = get_absolute_expression ();
@ -234,6 +203,8 @@ v850_offset (int ignore ATTRIBUTE_UNUSED)
/* Copied from obj_elf_common() in gas/config/obj-elf.c. */
static void v850_comm PARAMS ((int));
static void
v850_comm (area)
int area;
@ -338,37 +309,16 @@ v850_comm (area)
switch (area)
{
case AREA_SDA:
if (sbss_section == NULL)
{
sbss_section = subseg_new (".sbss", 0);
bfd_set_section_flags (stdoutput, sbss_section, applicable);
seg_info (sbss_section)->bss = 1;
}
case SCOMMON_SECTION:
do_v850_seg (SBSS_SECTION, 0);
break;
case AREA_ZDA:
if (zbss_section == NULL)
{
zbss_section = subseg_new (".zbss", 0);
bfd_set_section_flags (stdoutput, sbss_section, applicable);
seg_info (zbss_section)->bss = 1;
}
case ZCOMMON_SECTION:
do_v850_seg (ZBSS_SECTION, 0);
break;
case AREA_TDA:
if (tbss_section == NULL)
{
tbss_section = subseg_new (".tbss", 0);
bfd_set_section_flags (stdoutput, tbss_section, applicable);
seg_info (tbss_section)->bss = 1;
}
case TCOMMON_SECTION:
do_v850_seg (TBSS_SECTION, 0);
break;
}
@ -388,47 +338,25 @@ v850_comm (area)
else
align = 0;
switch (area)
{
case AREA_SDA:
record_alignment (sbss_section, align);
obj_elf_section_change_hook ();
subseg_set (sbss_section, 0);
break;
case AREA_ZDA:
record_alignment (zbss_section, align);
obj_elf_section_change_hook ();
subseg_set (zbss_section, 0);
break;
case AREA_TDA:
record_alignment (tbss_section, align);
obj_elf_section_change_hook ();
subseg_set (tbss_section, 0);
break;
default:
abort ();
}
record_alignment (now_seg, align);
if (align)
frag_align (align, 0, 0);
switch (area)
{
case AREA_SDA:
if (S_GET_SEGMENT (symbolP) == sbss_section)
case SCOMMON_SECTION:
if (S_GET_SEGMENT (symbolP) == v850_seg_table[SBSS_SECTION].s)
symbol_get_frag (symbolP)->fr_symbol = 0;
break;
case AREA_ZDA:
if (S_GET_SEGMENT (symbolP) == zbss_section)
case ZCOMMON_SECTION:
if (S_GET_SEGMENT (symbolP) == v850_seg_table[ZBSS_SECTION].s)
symbol_get_frag (symbolP)->fr_symbol = 0;
break;
case AREA_TDA:
if (S_GET_SEGMENT (symbolP) == tbss_section)
case TCOMMON_SECTION:
if (S_GET_SEGMENT (symbolP) == v850_seg_table[TBSS_SECTION].s)
symbol_get_frag (symbolP)->fr_symbol = 0;
break;
@ -444,16 +372,16 @@ v850_comm (area)
switch (area)
{
case AREA_SDA:
S_SET_SEGMENT (symbolP, sbss_section);
case SCOMMON_SECTION:
S_SET_SEGMENT (symbolP, v850_seg_table[SBSS_SECTION].s);
break;
case AREA_ZDA:
S_SET_SEGMENT (symbolP, zbss_section);
case ZCOMMON_SECTION:
S_SET_SEGMENT (symbolP, v850_seg_table[ZBSS_SECTION].s);
break;
case AREA_TDA:
S_SET_SEGMENT (symbolP, tbss_section);
case TCOMMON_SECTION:
S_SET_SEGMENT (symbolP, v850_seg_table[TBSS_SECTION].s);
break;
default:
@ -473,54 +401,11 @@ v850_comm (area)
switch (area)
{
case AREA_SDA:
if (scommon_section == NULL)
{
flagword applicable =
bfd_applicable_section_flags (stdoutput);
scommon_section = subseg_new (".scommon", 0);
bfd_set_section_flags (stdoutput, scommon_section,
(applicable
& (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA
| SEC_HAS_CONTENTS)) | SEC_IS_COMMON);
}
S_SET_SEGMENT (symbolP, scommon_section);
break;
case AREA_ZDA:
if (zcommon_section == NULL)
{
flagword applicable =
bfd_applicable_section_flags (stdoutput);
zcommon_section = subseg_new (".zcommon", 0);
bfd_set_section_flags (stdoutput, zcommon_section,
(applicable
& (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA
| SEC_HAS_CONTENTS)) | SEC_IS_COMMON);
}
S_SET_SEGMENT (symbolP, zcommon_section);
break;
case AREA_TDA:
if (tcommon_section == NULL)
{
flagword applicable =
bfd_applicable_section_flags (stdoutput);
tcommon_section = subseg_new (".tcommon", 0);
bfd_set_section_flags (stdoutput, tcommon_section,
((applicable
& (SEC_ALLOC | SEC_LOAD
| SEC_RELOC | SEC_DATA
| SEC_HAS_CONTENTS))
| SEC_IS_COMMON));
}
S_SET_SEGMENT (symbolP, tcommon_section);
case SCOMMON_SECTION:
case ZCOMMON_SECTION:
case TCOMMON_SECTION:
do_v850_seg (area, 0);
S_SET_SEGMENT (symbolP, v850_seg_table[area].s);
break;
default:
@ -570,8 +455,11 @@ v850_comm (area)
}
}
void
set_machine (int number)
static void set_machine PARAMS ((int));
static void
set_machine (number)
int number;
{
machine = number;
bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
@ -586,28 +474,28 @@ set_machine (int number)
/* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] = {
{"sdata", v850_sdata, 0},
{"tdata", v850_tdata, 0},
{"zdata", v850_zdata, 0},
{"sbss", v850_sbss, 0},
{"tbss", v850_tbss, 0},
{"zbss", v850_zbss, 0},
{"rosdata", v850_rosdata, 0},
{"rozdata", v850_rozdata, 0},
{"bss", v850_bss, 0},
{"offset", v850_offset, 0},
{"word", cons, 4},
{"zcomm", v850_comm, AREA_ZDA},
{"scomm", v850_comm, AREA_SDA},
{"tcomm", v850_comm, AREA_TDA},
{"v850", set_machine, 0},
{"call_table_data", v850_call_table_data, 0},
{"call_table_text", v850_call_table_text, 0},
{"v850e", set_machine, bfd_mach_v850e},
{"v850ea", set_machine, bfd_mach_v850ea},
{"file", dwarf2_directive_file, 0},
{"loc", dwarf2_directive_loc, 0},
{ NULL, NULL, 0}
{ "sdata", v850_seg, SDATA_SECTION },
{ "tdata", v850_seg, TDATA_SECTION },
{ "zdata", v850_seg, ZDATA_SECTION },
{ "sbss", v850_seg, SBSS_SECTION },
{ "tbss", v850_seg, TBSS_SECTION },
{ "zbss", v850_seg, ZBSS_SECTION },
{ "rosdata", v850_seg, ROSDATA_SECTION },
{ "rozdata", v850_seg, ROZDATA_SECTION },
{ "bss", v850_seg, BSS_SECTION },
{ "offset", v850_offset, 0 },
{ "word", cons, 4 },
{ "zcomm", v850_comm, ZCOMMON_SECTION },
{ "scomm", v850_comm, SCOMMON_SECTION },
{ "tcomm", v850_comm, TCOMMON_SECTION },
{ "v850", set_machine, 0 },
{ "call_table_data", v850_seg, CALL_TABLE_DATA_SECTION },
{ "call_table_text", v850_seg, CALL_TABLE_TEXT_SECTION },
{ "v850e", set_machine, bfd_mach_v850e },
{ "v850ea", set_machine, bfd_mach_v850ea },
{ "file", dwarf2_directive_file, 0 },
{ "loc", dwarf2_directive_loc, 0 },
{ NULL, NULL, 0 }
};
/* Opcode hash table. */
@ -716,6 +604,9 @@ static const struct reg_name cc_names[] = {
valid regiter name. Return the register number from the array on
success, or -1 on failure. */
static int reg_name_search
PARAMS ((const struct reg_name *, int, const char *, boolean));
static int
reg_name_search (regs, regcount, name, accept_numbers)
const struct reg_name *regs;
@ -770,12 +661,14 @@ reg_name_search (regs, regcount, name, accept_numbers)
*
* in: Input_line_pointer points to 1st char of operand.
*
* out: A expressionS.
* out: An expressionS.
* The operand may have been a register: in this case, X_op == O_register,
* X_add_number is set to the register number, and truth is returned.
* Input_line_pointer->(next non-blank) char after operand, or is in
* its original state. */
static boolean register_name PARAMS ((expressionS *));
static boolean
register_name (expressionP)
expressionS *expressionP;
@ -825,12 +718,14 @@ register_name (expressionP)
* ACCEPT_LIST_NAMES is true iff the special names PS and SR may be
* accepted.
*
* out: A expressionS structure in expressionP.
* out: An expressionS structure in expressionP.
* The operand may have been a register: in this case, X_op == O_register,
* X_add_number is set to the register number, and truth is returned.
* Input_line_pointer->(next non-blank) char after operand, or is in
* its original state. */
static boolean system_register_name PARAMS ((expressionS *, boolean, boolean));
static boolean
system_register_name (expressionP, accept_numbers, accept_list_names)
expressionS *expressionP;
@ -858,7 +753,7 @@ system_register_name (expressionP, accept_numbers, accept_list_names)
/* Reset input_line pointer. */
input_line_pointer = start;
if (isdigit (*input_line_pointer))
if (ISDIGIT (*input_line_pointer))
{
reg_number = strtol (input_line_pointer, &input_line_pointer, 10);
@ -906,12 +801,14 @@ system_register_name (expressionP, accept_numbers, accept_list_names)
*
* in: INPUT_LINE_POINTER points to 1st char of operand.
*
* out: A expressionS.
* out: An expressionS.
* The operand may have been a register: in this case, X_op == O_register,
* X_add_number is set to the register number, and truth is returned.
* Input_line_pointer->(next non-blank) char after operand, or is in
* its original state. */
static boolean cc_name PARAMS ((expressionS *));
static boolean
cc_name (expressionP)
expressionS *expressionP;
@ -951,8 +848,10 @@ cc_name (expressionP)
}
}
static void skip_white_space PARAMS ((void));
static void
skip_white_space (void)
skip_white_space ()
{
while (*input_line_pointer == ' '
|| *input_line_pointer == '\t')
@ -984,6 +883,9 @@ skip_white_space (void)
* and so on upwards. System registers are considered to be very
* high numbers. */
static char *parse_register_list
PARAMS ((unsigned long *, const struct v850_operand *));
static char *
parse_register_list (insn, operand)
unsigned long *insn;
@ -1374,7 +1276,6 @@ md_begin ()
{
char *prev_name = "";
register const struct v850_opcode *op;
flagword applicable;
if (strncmp (TARGET_CPU, "v850ea", 6) == 0)
{
@ -1423,26 +1324,16 @@ md_begin ()
op++;
}
v850_seg_table[BSS_SECTION].s = bss_section;
bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
applicable = bfd_applicable_section_flags (stdoutput);
call_table_data_section = subseg_new (".call_table_data", 0);
bfd_set_section_flags (stdoutput, call_table_data_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
| SEC_DATA | SEC_HAS_CONTENTS));
call_table_text_section = subseg_new (".call_table_text", 0);
bfd_set_section_flags (stdoutput, call_table_text_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_READONLY
| SEC_CODE));
/* Restore text section as the current default. */
subseg_set (text_section, 0);
}
static bfd_reloc_code_real_type handle_ctoff
PARAMS ((const struct v850_operand *));
static bfd_reloc_code_real_type
handle_ctoff (const struct v850_operand *operand)
handle_ctoff (operand)
const struct v850_operand *operand;
{
if (operand == NULL)
return BFD_RELOC_V850_CALLT_16_16_OFFSET;
@ -1457,8 +1348,12 @@ handle_ctoff (const struct v850_operand *operand)
return BFD_RELOC_V850_CALLT_6_7_OFFSET;
}
static bfd_reloc_code_real_type handle_sdaoff
PARAMS ((const struct v850_operand *));
static bfd_reloc_code_real_type
handle_sdaoff (const struct v850_operand *operand)
handle_sdaoff (operand)
const struct v850_operand *operand;
{
if (operand == NULL)
return BFD_RELOC_V850_SDA_16_16_OFFSET;
@ -1479,8 +1374,12 @@ handle_sdaoff (const struct v850_operand *operand)
return BFD_RELOC_V850_SDA_16_16_OFFSET;
}
static bfd_reloc_code_real_type handle_zdaoff
PARAMS ((const struct v850_operand *));
static bfd_reloc_code_real_type
handle_zdaoff (const struct v850_operand *operand)
handle_zdaoff (operand)
const struct v850_operand *operand;
{
if (operand == NULL)
return BFD_RELOC_V850_ZDA_16_16_OFFSET;
@ -1502,8 +1401,12 @@ handle_zdaoff (const struct v850_operand *operand)
return BFD_RELOC_V850_ZDA_16_16_OFFSET;
}
static bfd_reloc_code_real_type handle_tdaoff
PARAMS ((const struct v850_operand *));
static bfd_reloc_code_real_type
handle_tdaoff (const struct v850_operand *operand)
handle_tdaoff (operand)
const struct v850_operand *operand;
{
if (operand == NULL)
/* Data item, not an instruction. */
@ -1541,8 +1444,12 @@ handle_tdaoff (const struct v850_operand *operand)
in the v850_operands[] array (defined in opcodes/v850-opc.c)
matching the hard coded values contained herein. */
static bfd_reloc_code_real_type v850_reloc_prefix
PARAMS ((const struct v850_operand *));
static bfd_reloc_code_real_type
v850_reloc_prefix (const struct v850_operand *operand)
v850_reloc_prefix (operand)
const struct v850_operand *operand;
{
boolean paren_skipped = false;
@ -1578,6 +1485,10 @@ v850_reloc_prefix (const struct v850_operand *operand)
/* Insert an operand value into an instruction. */
static unsigned long v850_insert_operand
PARAMS ((unsigned long, const struct v850_operand *, offsetT, char *,
unsigned int, char *));
static unsigned long
v850_insert_operand (insn, operand, val, file, line, str)
unsigned long insn;
@ -1711,7 +1622,7 @@ md_assemble (str)
strncpy (copy_of_instruction, str, sizeof (copy_of_instruction) - 1);
/* Get the opcode. */
for (s = str; *s != '\0' && ! isspace (*s); s++)
for (s = str; *s != '\0' && ! ISSPACE (*s); s++)
continue;
if (*s != '\0')
@ -1728,7 +1639,7 @@ md_assemble (str)
}
str = s;
while (isspace (*str))
while (ISSPACE (*str))
++str;
start_of_operands = str;
@ -2141,7 +2052,7 @@ md_assemble (str)
break;
}
while (isspace (*str))
while (ISSPACE (*str))
++str;
if (*str != '\0')
@ -2210,7 +2121,7 @@ md_assemble (str)
BFD_RELOC_UNUSED plus the operand index. This lets us easily
handle fixups for any operand type, although that is admittedly
not a very exciting feature. We pick a BFD reloc type in
md_apply_fix. */
md_apply_fix3. */
for (i = 0; i < fc; i++)
{
const struct v850_operand *operand;
@ -2340,52 +2251,51 @@ v850_pcrel_from_section (fixp, section)
return fixp->fx_frag->fr_address + fixp->fx_where;
}
int
md_apply_fix3 (fixp, valuep, seg)
fixS *fixp;
valueT *valuep;
void
md_apply_fix3 (fixP, valueP, seg)
fixS *fixP;
valueT *valueP;
segT seg ATTRIBUTE_UNUSED;
{
valueT value;
valueT value = * valueP;
char *where;
if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
{
fixp->fx_done = 0;
return 1;
fixP->fx_done = 0;
return;
}
if (fixp->fx_addsy == (symbolS *) NULL)
{
value = *valuep;
fixp->fx_done = 1;
}
else if (fixp->fx_pcrel)
value = *valuep;
if (fixP->fx_addsy == (symbolS *) NULL)
fixP->fx_done = 1;
else if (fixP->fx_pcrel)
;
else
{
value = fixp->fx_offset;
if (fixp->fx_subsy != (symbolS *) NULL)
value = fixP->fx_offset;
if (fixP->fx_subsy != (symbolS *) NULL)
{
if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section)
value -= S_GET_VALUE (fixp->fx_subsy);
if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
value -= S_GET_VALUE (fixP->fx_subsy);
else
{
/* We don't actually support subtracting a symbol. */
as_bad_where (fixp->fx_file, fixp->fx_line,
as_bad_where (fixP->fx_file, fixP->fx_line,
_("expression too complex"));
}
}
}
if ((int) fixp->fx_r_type >= (int) BFD_RELOC_UNUSED)
if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
{
int opindex;
const struct v850_operand *operand;
unsigned long insn;
opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED;
opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
operand = &v850_operands[opindex];
/* Fetch the instruction, insert the fully resolved operand
@ -2393,53 +2303,50 @@ md_apply_fix3 (fixp, valuep, seg)
Note the instruction has been stored in little endian
format! */
where = fixp->fx_frag->fr_literal + fixp->fx_where;
where = fixP->fx_frag->fr_literal + fixP->fx_where;
insn = bfd_getl32 ((unsigned char *) where);
insn = v850_insert_operand (insn, operand, (offsetT) value,
fixp->fx_file, fixp->fx_line, NULL);
fixP->fx_file, fixP->fx_line, NULL);
bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
if (fixp->fx_done)
{
/* Nothing else to do here. */
return 1;
}
if (fixP->fx_done)
/* Nothing else to do here. */
return;
/* Determine a BFD reloc value based on the operand information.
We are only prepared to turn a few of the operands into relocs. */
if (operand->bits == 22)
fixp->fx_r_type = BFD_RELOC_V850_22_PCREL;
fixP->fx_r_type = BFD_RELOC_V850_22_PCREL;
else if (operand->bits == 9)
fixp->fx_r_type = BFD_RELOC_V850_9_PCREL;
fixP->fx_r_type = BFD_RELOC_V850_9_PCREL;
else
{
#if 0
fprintf (stderr, "bits: %d, insn: %x\n", operand->bits, insn);
#endif
as_bad_where (fixp->fx_file, fixp->fx_line,
as_bad_where (fixP->fx_file, fixP->fx_line,
_("unresolved expression that must be resolved"));
fixp->fx_done = 1;
return 1;
fixP->fx_done = 1;
return;
}
}
else if (fixp->fx_done)
else if (fixP->fx_done)
{
/* We still have to insert the value into memory! */
where = fixp->fx_frag->fr_literal + fixp->fx_where;
where = fixP->fx_frag->fr_literal + fixP->fx_where;
if (fixp->fx_size == 1)
if (fixP->fx_size == 1)
*where = value & 0xff;
else if (fixp->fx_size == 2)
else if (fixP->fx_size == 2)
bfd_putl16 (value & 0xffff, (unsigned char *) where);
else if (fixp->fx_size == 4)
else if (fixP->fx_size == 4)
bfd_putl32 (value, (unsigned char *) where);
}
fixp->fx_addnumber = value;
return 1;
fixP->fx_addnumber = value;
}
/* Parse a cons expression. We have to handle hi(), lo(), etc

View File

@ -1,5 +1,5 @@
/* tc-v850.h -- Header file for tc-v850.c.
Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -34,11 +34,13 @@
/* The target BFD format. */
#define TARGET_FORMAT "elf32-v850"
#define MD_APPLY_FIX3
#define md_operand(x)
#define obj_fix_adjustable(fixP) v850_fix_adjustable(fixP)
extern boolean v850_fix_adjustable PARAMS ((struct fix *));
#define TC_FORCE_RELOCATION(fixp) v850_force_relocation(fixp)
extern int v850_force_relocation PARAMS ((struct fix *));
#ifdef OBJ_ELF
/* This arranges for gas/write.c to not apply a relocation if
@ -46,12 +48,10 @@
#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
#endif
extern int v850_force_relocation PARAMS ((struct fix *));
/* Permit temporary numeric labels. */
#define LOCAL_LABELS_FB 1
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs. */
/* We don't need to handle .word strangely. */
#define WORKING_DOT_WORD
@ -61,9 +61,13 @@ extern int v850_force_relocation PARAMS ((struct fix *));
/* We need to handle lo(), hi(), etc etc in .hword, .word, etc
directives, so we have to parse "cons" expressions ourselves. */
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) parse_cons_expression_v850 (EXP)
extern void parse_cons_expression_v850 PARAMS ((expressionS *));
#define TC_CONS_FIX_NEW cons_fix_new_v850
extern const struct relax_type md_relax_table[];
extern void cons_fix_new_v850 PARAMS ((fragS *, int, int, expressionS *));
#define TC_GENERIC_RELAX_TABLE md_relax_table
extern const struct relax_type md_relax_table[];
/* This section must be in the small data area (pointed to by GP). */
#define SHF_V850_GPREL 0x10000000
@ -88,6 +92,6 @@ extern const struct relax_type md_relax_table[];
{ ".call_table_text", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR },
#define MD_PCREL_FROM_SECTION(fixP,section) v850_pcrel_from_section (fixP, section)
extern long v850_pcrel_from_section ();
extern long v850_pcrel_from_section PARAMS ((struct fix *, asection *));
#define DWARF2_LINE_MIN_INSN_LENGTH 2

View File

@ -1,5 +1,5 @@
/* tc-z8k.c -- Assemble code for the Zilog Z800n
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -24,11 +24,10 @@
#define DEFINE_TABLE
#include <stdio.h>
#include "opcodes/z8k-opc.h"
#include "as.h"
#include "bfd.h"
#include <ctype.h>
#include "safe-ctype.h"
#include "opcodes/z8k-opc.h"
const char comment_chars[] = "!";
const char line_comment_chars[] = "#";
@ -70,9 +69,9 @@ int
tohex (c)
int c;
{
if (isdigit (c))
if (ISDIGIT (c))
return c - '0';
if (islower (c))
if (ISLOWER (c))
return c - 'a' + 10;
return c - 'A' + 10;
}
@ -221,7 +220,7 @@ whatreg (reg, src)
int *reg;
char *src;
{
if (isdigit (src[1]))
if (ISDIGIT (src[1]))
{
*reg = (src[0] - '0') * 10 + src[1] - '0';
return src + 2;
@ -259,7 +258,7 @@ parse_reg (src, mode, reg)
char *res = 0;
char regno;
if (src[0] == 's' && src[1] == 'p')
if (src[0] == 's' && src[1] == 'p' && (src[2] == 0 || src[2] == ','))
{
if (segmented_mode)
{
@ -277,6 +276,8 @@ parse_reg (src, mode, reg)
{
if (src[1] == 'r')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rr'. */
*mode = CLASS_REG_LONG;
res = whatreg (reg, src + 2);
regno = *reg;
@ -285,6 +286,8 @@ parse_reg (src, mode, reg)
}
else if (src[1] == 'h')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rh'. */
*mode = CLASS_REG_BYTE;
res = whatreg (reg, src + 2);
regno = *reg;
@ -293,6 +296,8 @@ parse_reg (src, mode, reg)
}
else if (src[1] == 'l')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rl'. */
*mode = CLASS_REG_BYTE;
res = whatreg (reg, src + 2);
regno = *reg;
@ -302,6 +307,8 @@ parse_reg (src, mode, reg)
}
else if (src[1] == 'q')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rq'. */
*mode = CLASS_REG_QUAD;
res = whatreg (reg, src + 2);
regno = *reg;
@ -310,6 +317,8 @@ parse_reg (src, mode, reg)
}
else
{
if (src[1] < '0' || src[1] > '9')
return res; /* Assume no register name but a label starting with 'r'. */
*mode = CLASS_REG_WORD;
res = whatreg (reg, src + 1);
regno = *reg;
@ -1396,10 +1405,12 @@ md_section_align (seg, size)
}
void
md_apply_fix (fixP, val)
md_apply_fix3 (fixP, valP, segment)
fixS *fixP;
long val;
valueT * valP;
segT segment ATTRIBUTE_UNUSED;
{
long val = * (long *) valP;
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
switch (fixP->fx_r_type)
@ -1455,6 +1466,9 @@ md_apply_fix (fixP, val)
default:
abort ();
}
if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
fixP->fx_done = 1;
}
int

View File

@ -4,9 +4,12 @@
s! \.\./! !g
s!@INCDIR@!$(INCDIR)!g
s!@TOPDIR@/include!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
s!@TOPDIR@/bfd!$(BFDDIR)!g
s!@SRCDIR@/config!$(srcdir)/config!g
s!@SRCDIR@/\.\./opcodes!$(srcdir)/../opcodes!g
s!@TOPDIR@/opcodes!$(srcdir)/../opcodes!g
s!@SRCDIR@/!!g
s! \$(INCDIR)/ansidecl\.h!!g
s! \$(INCDIR)/fopen-same\.h!!g

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -281,7 +281,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)

View File

@ -1,4 +1,5 @@
@c Copyright (C) 1991, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2001
@c Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@page
@ -17,11 +18,35 @@
@node SH Options
@section Options
@cindex SH options (none)
@cindex options, SH (none)
@code{@value{AS}} has no additional command-line options for the Hitachi
@cindex SH options
@cindex options, SH
@code{@value{AS}} has following command-line options for the Hitachi
SH family.
@table @code
@kindex -little
@kindex -big
@kindex -relax
@kindex -small
@kindex -dsp
@item -little
Generate little endian code.
@item -big
Generate big endian code.
@item -relax
Alter jump instructions for long displacements.
@item -small
Align sections to 4 byte boundaries, not 16.
@item -dsp
Enable sh-dsp insns, and disable sh3e / sh4 insns.
@end table
@node SH Syntax
@section Syntax

View File

@ -2923,7 +2923,7 @@ number_to_chars_bigendian (buf, val, n)
valueT val;
int n;
{
if ((size_t) n > sizeof (val) || n <= 0)
if (n <= 0)
abort ();
while (n--)
{
@ -2938,7 +2938,7 @@ number_to_chars_littleendian (buf, val, n)
valueT val;
int n;
{
if ((size_t) n > sizeof (val) || n <= 0)
if (n <= 0)
abort ();
while (n--)
{

View File

@ -1,5 +1,6 @@
/* mips.h. Mips opcode list for GDB, the GNU debugger.
Copyright 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Ralph Campbell and OSF
Commented and modified by Ian Lance Taylor, Cygnus Support
@ -30,9 +31,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
i = (i &~ (OP_MASK_X << OP_SH_X)) | (j << OP_SH_X)
Make sure you use fields that are appropriate for the instruction,
of course.
of course.
The 'i' format uses OP, RS, RT and IMMEDIATE.
The 'i' format uses OP, RS, RT and IMMEDIATE.
The 'j' format uses OP and TARGET.
@ -48,9 +49,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
breakpoint instruction are not defined; Kane says the breakpoint
code field in BREAK is 20 bits; yet MIPS assemblers and debuggers
only use ten bits). An optional two-operand form of break/sdbbp
allows the lower ten bits to be set too.
allows the lower ten bits to be set too, and MIPS32 and later
architectures allow 20 bits to be set with a signal operand
(using CODE20).
The syscall instruction uses SYSCALL.
The syscall instruction uses CODE20.
The general coprocessor instructions use COPZ. */
@ -82,8 +85,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
#define OP_SH_PREFX 11
#define OP_MASK_CCC 0x7
#define OP_SH_CCC 8
#define OP_MASK_SYSCALL 0xfffff
#define OP_SH_SYSCALL 6
#define OP_MASK_CODE20 0xfffff /* 20 bit syscall/breakpoint code. */
#define OP_SH_CODE20 6
#define OP_MASK_SHAMT 0x1f
#define OP_SH_SHAMT 6
#define OP_MASK_FD 0x1f
@ -100,17 +103,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
#define OP_SH_FUNCT 0
#define OP_MASK_SPEC 0x3f
#define OP_SH_SPEC 0
#define OP_SH_LOCC 8 /* FP condition code */
#define OP_SH_HICC 18 /* FP condition code */
#define OP_SH_LOCC 8 /* FP condition code. */
#define OP_SH_HICC 18 /* FP condition code. */
#define OP_MASK_CC 0x7
#define OP_SH_COP1NORM 25 /* Normal COP1 encoding */
#define OP_MASK_COP1NORM 0x1 /* a single bit */
#define OP_SH_COP1SPEC 21 /* COP1 encodings */
#define OP_SH_COP1NORM 25 /* Normal COP1 encoding. */
#define OP_MASK_COP1NORM 0x1 /* a single bit. */
#define OP_SH_COP1SPEC 21 /* COP1 encodings. */
#define OP_MASK_COP1SPEC 0xf
#define OP_MASK_COP1SCLR 0x4
#define OP_MASK_COP1CMP 0x3
#define OP_SH_COP1CMP 4
#define OP_SH_FORMAT 21 /* FP short format field */
#define OP_SH_FORMAT 21 /* FP short format field. */
#define OP_MASK_FORMAT 0x7
#define OP_SH_TRUE 16
#define OP_MASK_TRUE 0x1
@ -120,12 +123,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
#define OP_MASK_UNSIGNED 0x1
#define OP_SH_HINT 16
#define OP_MASK_HINT 0x1f
#define OP_SH_MMI 0 /* Multimedia (parallel) op */
#define OP_MASK_MMI 0x3f
#define OP_SH_MMI 0 /* Multimedia (parallel) op. */
#define OP_MASK_MMI 0x3f
#define OP_SH_MMISUB 6
#define OP_MASK_MMISUB 0x1f
#define OP_MASK_PERFREG 0x1f /* Performance monitoring */
#define OP_MASK_PERFREG 0x1f /* Performance monitoring. */
#define OP_SH_PERFREG 1
#define OP_SH_SEL 0 /* Coprocessor select field. */
#define OP_MASK_SEL 0x7 /* The sel field of mfcZ and mtcZ. */
#define OP_SH_CODE19 6 /* 19 bit wait code. */
#define OP_MASK_CODE19 0x7ffff
/* This structure holds information for a particular instruction. */
@ -181,8 +188,11 @@ struct mips_opcode
"u" 16 bit upper 16 bits of address (OP_*_IMMEDIATE)
"v" 5 bit same register used as both source and destination (OP_*_RS)
"w" 5 bit same register used as both target and destination (OP_*_RT)
"U" 5 bit same destination register in both OP_*_RD and OP_*_RT
(used by clo and clz)
"C" 25 bit coprocessor function code (OP_*_COPZ)
"B" 20 bit syscall function code (OP_*_SYSCALL)
"B" 20 bit syscall/breakpoint function code (OP_*_CODE20)
"J" 19 bit wait function code (OP_*_CODE19)
"x" accept and ignore register name
"z" must be zero register
@ -199,6 +209,7 @@ struct mips_opcode
Coprocessor instructions:
"E" 5 bit target register (OP_*_RT)
"G" 5 bit destination register (OP_*_RD)
"H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL)
"P" 5 bit performance-monitor register (OP_*_PERFREG)
Macro instructions:
@ -215,7 +226,7 @@ struct mips_opcode
Characters used so far, for quick reference when adding more:
"<>(),"
"ABCDEFGILMNSTRVW"
"ABCDEFGHIJLMNPRSTUVW"
"abcdfhijklopqrstuvwxz"
*/
@ -291,281 +302,310 @@ struct mips_opcode
disassembler, and requires special treatment by the assembler. */
#define INSN_MACRO 0xffffffff
/* Masks used to mark instructions to indicate which MIPS ISA level
they were introduced in. ISAs, as defined below, are logical
ORs of these bits, indicatingthat they support the instructions
defined at the given level. */
/* MIPS ISA field--CPU level at which insn is supported. */
#define INSN_ISA 0x0000000F
/* An instruction which is not part of any basic MIPS ISA.
(ie it is a chip specific instruction) */
#define INSN_NO_ISA 0x00000000
/* MIPS ISA 1 instruction. */
#define INSN_ISA1 0x00000001
/* MIPS ISA 2 instruction (R6000 or R4000). */
#define INSN_ISA2 0x00000002
/* MIPS ISA 3 instruction (R4000). */
#define INSN_ISA3 0x00000003
/* MIPS ISA 4 instruction (R8000). */
#define INSN_ISA4 0x00000004
#define INSN_ISA5 0x00000005
#define INSN_ISA_MASK 0x00000fff
#define INSN_ISA1 0x00000010
#define INSN_ISA2 0x00000020
#define INSN_ISA3 0x00000040
#define INSN_ISA4 0x00000080
#define INSN_ISA5 0x00000100
#define INSN_ISA32 0x00000200
#define INSN_ISA64 0x00000400
/* Chip specific instructions. These are bitmasks. */
/* MIPS R4650 instruction. */
#define INSN_4650 0x00000010
/* LSI R4010 instruction. */
#define INSN_4010 0x00000020
/* NEC VR4100 instruction. */
#define INSN_4100 0x00000040
/* Toshiba R3900 instruction. */
#define INSN_3900 0x00000080
/* 32-bit code running on a ISA3+ CPU. */
#define INSN_GP32 0x00001000
/* MIPS R4650 instruction. */
#define INSN_4650 0x00010000
/* LSI R4010 instruction. */
#define INSN_4010 0x00020000
/* NEC VR4100 instruction. */
#define INSN_4100 0x00040000
/* Toshiba R3900 instruction. */
#define INSN_3900 0x00080000
/* MIPS R10000 instruction. */
#define INSN_10000 0x00100000
/* Broadcom SB-1 instruction. */
#define INSN_SB1 0x00200000
/* MIPS ISA defines, use instead of hardcoding ISA level. */
#define ISA_UNKNOWN 0 /* Gas internal use. */
#define ISA_MIPS1 (INSN_ISA1)
#define ISA_MIPS2 (ISA_MIPS1 | INSN_ISA2)
#define ISA_MIPS3 (ISA_MIPS2 | INSN_ISA3)
#define ISA_MIPS4 (ISA_MIPS3 | INSN_ISA4)
#define ISA_MIPS5 (ISA_MIPS4 | INSN_ISA5)
#define ISA_MIPS32 (ISA_MIPS2 | INSN_ISA32)
#define ISA_MIPS64 (ISA_MIPS5 | INSN_ISA32 | INSN_ISA64)
/* CPU defines, use instead of hardcoding processor number. Keep this
in sync with bfd/archures.c in order for machine selection to work. */
#define CPU_UNKNOWN 0 /* Gas internal use. */
#define CPU_R2000 2000
#define CPU_R3000 3000
#define CPU_R3900 3900
#define CPU_R4000 4000
#define CPU_R4010 4010
#define CPU_VR4100 4100
#define CPU_R4111 4111
#define CPU_R4300 4300
#define CPU_R4400 4400
#define CPU_R4600 4600
#define CPU_R4650 4650
#define CPU_R5000 5000
#define CPU_R6000 6000
#define CPU_R8000 8000
#define CPU_R10000 10000
#define CPU_R12000 12000
#define CPU_MIPS16 16
#define CPU_MIPS32 32
#define CPU_MIPS5 5
#define CPU_MIPS64 64
#define CPU_SB1 12310201 /* octal 'SB', 01. */
/* Test for membership in an ISA including chip specific ISAs.
INSN is pointer to an element of the opcode table; ISA is the
specified ISA to test against; and CPU is the CPU specific ISA
to test, or zero if no CPU specific ISA test is desired.
The gp32 arg is set when you need to force 32-bit register usage on
a machine with 64-bit registers; see the documentation under -mgp32
in the MIPS gas docs. */
to test, or zero if no CPU specific ISA test is desired. */
#define OPCODE_IS_MEMBER(insn,isa,cpu,gp32) \
((((insn)->membership & INSN_ISA) != 0 \
&& ((insn)->membership & INSN_ISA) <= isa \
&& ((insn)->membership & INSN_GP32 ? gp32 : 1)) \
|| (cpu == 4650 \
&& ((insn)->membership & INSN_4650) != 0) \
|| (cpu == 4010 \
&& ((insn)->membership & INSN_4010) != 0) \
|| ((cpu == 4100 \
|| cpu == 4111 \
) \
&& ((insn)->membership & INSN_4100) != 0) \
|| (cpu == 3900 \
&& ((insn)->membership & INSN_3900) != 0))
#define OPCODE_IS_MEMBER(insn, isa, cpu) \
(((insn)->membership & isa) != 0 \
|| (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0) \
|| (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0) \
|| ((cpu == CPU_VR4100 || cpu == CPU_R4111) \
&& ((insn)->membership & INSN_4100) != 0) \
|| (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0) \
|| ((cpu == CPU_R10000 || cpu == CPU_R12000) \
&& ((insn)->membership & INSN_10000) != 0) \
|| (cpu == CPU_SB1 && ((insn)->membership & INSN_SB1) != 0) \
|| 0) /* Please keep this term for easier source merging. */
/* This is a list of macro expanded instructions.
*
* _I appended means immediate
* _A appended means address
* _AB appended means address with base register
* _D appended means 64 bit floating point constant
* _S appended means 32 bit floating point constant
*/
enum {
M_ABS,
M_ADD_I,
M_ADDU_I,
M_AND_I,
M_BEQ,
M_BEQ_I,
M_BEQL_I,
M_BGE,
M_BGEL,
M_BGE_I,
M_BGEL_I,
M_BGEU,
M_BGEUL,
M_BGEU_I,
M_BGEUL_I,
M_BGT,
M_BGTL,
M_BGT_I,
M_BGTL_I,
M_BGTU,
M_BGTUL,
M_BGTU_I,
M_BGTUL_I,
M_BLE,
M_BLEL,
M_BLE_I,
M_BLEL_I,
M_BLEU,
M_BLEUL,
M_BLEU_I,
M_BLEUL_I,
M_BLT,
M_BLTL,
M_BLT_I,
M_BLTL_I,
M_BLTU,
M_BLTUL,
M_BLTU_I,
M_BLTUL_I,
M_BNE,
M_BNE_I,
M_BNEL_I,
M_DABS,
M_DADD_I,
M_DADDU_I,
M_DDIV_3,
M_DDIV_3I,
M_DDIVU_3,
M_DDIVU_3I,
M_DIV_3,
M_DIV_3I,
M_DIVU_3,
M_DIVU_3I,
M_DLA_AB,
M_DLI,
M_DMUL,
M_DMUL_I,
M_DMULO,
M_DMULO_I,
M_DMULOU,
M_DMULOU_I,
M_DREM_3,
M_DREM_3I,
M_DREMU_3,
M_DREMU_3I,
M_DSUB_I,
M_DSUBU_I,
M_DSUBU_I_2,
M_J_A,
M_JAL_1,
M_JAL_2,
M_JAL_A,
M_L_DOB,
M_L_DAB,
M_LA_AB,
M_LB_A,
M_LB_AB,
M_LBU_A,
M_LBU_AB,
M_LD_A,
M_LD_OB,
M_LD_AB,
M_LDC1_AB,
M_LDC2_AB,
M_LDC3_AB,
M_LDL_AB,
M_LDR_AB,
M_LH_A,
M_LH_AB,
M_LHU_A,
M_LHU_AB,
M_LI,
M_LI_D,
M_LI_DD,
M_LI_S,
M_LI_SS,
M_LL_AB,
M_LLD_AB,
M_LS_A,
M_LW_A,
M_LW_AB,
M_LWC0_A,
M_LWC0_AB,
M_LWC1_A,
M_LWC1_AB,
M_LWC2_A,
M_LWC2_AB,
M_LWC3_A,
M_LWC3_AB,
M_LWL_A,
M_LWL_AB,
M_LWR_A,
M_LWR_AB,
M_LWU_AB,
M_MUL,
M_MUL_I,
M_MULO,
M_MULO_I,
M_MULOU,
M_MULOU_I,
M_NOR_I,
M_OR_I,
M_REM_3,
M_REM_3I,
M_REMU_3,
M_REMU_3I,
M_ROL,
M_ROL_I,
M_ROR,
M_ROR_I,
M_S_DA,
M_S_DOB,
M_S_DAB,
M_S_S,
M_SC_AB,
M_SCD_AB,
M_SD_A,
M_SD_OB,
M_SD_AB,
M_SDC1_AB,
M_SDC2_AB,
M_SDC3_AB,
M_SDL_AB,
M_SDR_AB,
M_SEQ,
M_SEQ_I,
M_SGE,
M_SGE_I,
M_SGEU,
M_SGEU_I,
M_SGT,
M_SGT_I,
M_SGTU,
M_SGTU_I,
M_SLE,
M_SLE_I,
M_SLEU,
M_SLEU_I,
M_SLT_I,
M_SLTU_I,
M_SNE,
M_SNE_I,
M_SB_A,
M_SB_AB,
M_SH_A,
M_SH_AB,
M_SW_A,
M_SW_AB,
M_SWC0_A,
M_SWC0_AB,
M_SWC1_A,
M_SWC1_AB,
M_SWC2_A,
M_SWC2_AB,
M_SWC3_A,
M_SWC3_AB,
M_SWL_A,
M_SWL_AB,
M_SWR_A,
M_SWR_AB,
M_SUB_I,
M_SUBU_I,
M_SUBU_I_2,
M_TEQ_I,
M_TGE_I,
M_TGEU_I,
M_TLT_I,
M_TLTU_I,
M_TNE_I,
M_TRUNCWD,
M_TRUNCWS,
M_ULD,
M_ULD_A,
M_ULH,
M_ULH_A,
M_ULHU,
M_ULHU_A,
M_ULW,
M_ULW_A,
M_USH,
M_USH_A,
M_USW,
M_USW_A,
M_USD,
M_USD_A,
M_XOR_I,
M_COP0,
M_COP1,
M_COP2,
M_COP3,
M_NUM_MACROS
_I appended means immediate
_A appended means address
_AB appended means address with base register
_D appended means 64 bit floating point constant
_S appended means 32 bit floating point constant. */
enum
{
M_ABS,
M_ADD_I,
M_ADDU_I,
M_AND_I,
M_BEQ,
M_BEQ_I,
M_BEQL_I,
M_BGE,
M_BGEL,
M_BGE_I,
M_BGEL_I,
M_BGEU,
M_BGEUL,
M_BGEU_I,
M_BGEUL_I,
M_BGT,
M_BGTL,
M_BGT_I,
M_BGTL_I,
M_BGTU,
M_BGTUL,
M_BGTU_I,
M_BGTUL_I,
M_BLE,
M_BLEL,
M_BLE_I,
M_BLEL_I,
M_BLEU,
M_BLEUL,
M_BLEU_I,
M_BLEUL_I,
M_BLT,
M_BLTL,
M_BLT_I,
M_BLTL_I,
M_BLTU,
M_BLTUL,
M_BLTU_I,
M_BLTUL_I,
M_BNE,
M_BNE_I,
M_BNEL_I,
M_DABS,
M_DADD_I,
M_DADDU_I,
M_DDIV_3,
M_DDIV_3I,
M_DDIVU_3,
M_DDIVU_3I,
M_DIV_3,
M_DIV_3I,
M_DIVU_3,
M_DIVU_3I,
M_DLA_AB,
M_DLI,
M_DMUL,
M_DMUL_I,
M_DMULO,
M_DMULO_I,
M_DMULOU,
M_DMULOU_I,
M_DREM_3,
M_DREM_3I,
M_DREMU_3,
M_DREMU_3I,
M_DSUB_I,
M_DSUBU_I,
M_DSUBU_I_2,
M_J_A,
M_JAL_1,
M_JAL_2,
M_JAL_A,
M_L_DOB,
M_L_DAB,
M_LA_AB,
M_LB_A,
M_LB_AB,
M_LBU_A,
M_LBU_AB,
M_LD_A,
M_LD_OB,
M_LD_AB,
M_LDC1_AB,
M_LDC2_AB,
M_LDC3_AB,
M_LDL_AB,
M_LDR_AB,
M_LH_A,
M_LH_AB,
M_LHU_A,
M_LHU_AB,
M_LI,
M_LI_D,
M_LI_DD,
M_LI_S,
M_LI_SS,
M_LL_AB,
M_LLD_AB,
M_LS_A,
M_LW_A,
M_LW_AB,
M_LWC0_A,
M_LWC0_AB,
M_LWC1_A,
M_LWC1_AB,
M_LWC2_A,
M_LWC2_AB,
M_LWC3_A,
M_LWC3_AB,
M_LWL_A,
M_LWL_AB,
M_LWR_A,
M_LWR_AB,
M_LWU_AB,
M_MOVE,
M_MUL,
M_MUL_I,
M_MULO,
M_MULO_I,
M_MULOU,
M_MULOU_I,
M_NOR_I,
M_OR_I,
M_REM_3,
M_REM_3I,
M_REMU_3,
M_REMU_3I,
M_ROL,
M_ROL_I,
M_ROR,
M_ROR_I,
M_S_DA,
M_S_DOB,
M_S_DAB,
M_S_S,
M_SC_AB,
M_SCD_AB,
M_SD_A,
M_SD_OB,
M_SD_AB,
M_SDC1_AB,
M_SDC2_AB,
M_SDC3_AB,
M_SDL_AB,
M_SDR_AB,
M_SEQ,
M_SEQ_I,
M_SGE,
M_SGE_I,
M_SGEU,
M_SGEU_I,
M_SGT,
M_SGT_I,
M_SGTU,
M_SGTU_I,
M_SLE,
M_SLE_I,
M_SLEU,
M_SLEU_I,
M_SLT_I,
M_SLTU_I,
M_SNE,
M_SNE_I,
M_SB_A,
M_SB_AB,
M_SH_A,
M_SH_AB,
M_SW_A,
M_SW_AB,
M_SWC0_A,
M_SWC0_AB,
M_SWC1_A,
M_SWC1_AB,
M_SWC2_A,
M_SWC2_AB,
M_SWC3_A,
M_SWC3_AB,
M_SWL_A,
M_SWL_AB,
M_SWR_A,
M_SWR_AB,
M_SUB_I,
M_SUBU_I,
M_SUBU_I_2,
M_TEQ_I,
M_TGE_I,
M_TGEU_I,
M_TLT_I,
M_TLTU_I,
M_TNE_I,
M_TRUNCWD,
M_TRUNCWS,
M_ULD,
M_ULD_A,
M_ULH,
M_ULH_A,
M_ULHU,
M_ULHU_A,
M_ULW,
M_ULW_A,
M_USH,
M_USH_A,
M_USW,
M_USW_A,
M_USD,
M_USD_A,
M_XOR_I,
M_COP0,
M_COP1,
M_COP2,
M_COP3,
M_NUM_MACROS
};

View File

@ -1,5 +1,5 @@
/* v850.h -- Header file for NEC V850 opcode table
Copyright 1996, 1997 Free Software Foundation, Inc.
Copyright 1996, 1997, 2001 Free Software Foundation, Inc.
Written by J.T. Conklin, Cygnus Support
This file is part of GDB, GAS, and the GNU binutils.
@ -153,7 +153,6 @@ extern const struct v850_operand v850_operands[];
/* The register specified must not be r0 */
#define V850_NOT_R0 0x80
/* CYGNUS LOCAL v850e */
/* push/pop type instruction, V850E specific. */
#define V850E_PUSH_POP 0x100

View File

@ -1,3 +1,51 @@
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* dep-in.sed: Cope with absolute paths.
* Makefile.am (dep.sed): Subst TOPDIR and BFDDIR.
Run "make dep-am".
* Makefile.in: Regenerate.
Merge from mainline.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
* configure.host: Set up for generic hosts first, then tweak as
necessary in more specific targets.
(HOSTING_LIBS): Include libgcc_eh.a if found.
2002-03-28 Alan Modra <amodra@bigpond.net.au>
Merge from mainline.
2002-03-21 Albert Chin-A-Young <china@thewrittenword.com>
* genscripts.sh (LIB_SEARCH_DIRS): Quote path.
2002-03-20 Alan Modra <amodra@bigpond.net.au>
* ldlang.c (ldlang_add_undef): If the output bfd has been opened,
add the symbol to the linker hash table immediately.
(lang_place_undefineds): Split symbol creation out..
(insert_undefined): ..to here.
2002-03-18 Alan Modra <amodra@bigpond.net.au>
* ldmain.c (main): Move .text readonly flag fudges from here..
* ldlang.c (lang_process): ..to here.
2002-03-14 Alan Modra <amodra@bigpond.net.au>
* ldlang.c (lang_check): Remove the word size check added in last
change. Treat emitrelocations case as for relocatable links.
2002-03-13 Alan Modra <amodra@bigpond.net.au>
* ldlang.c (lang_check): Do relocatable link checks first, so that
warn_mismatch can't override. Check compatible and word size too.
2002-03-04 H.J. Lu <hjl@gnu.org>
* scripttempl/elf.sc: Put .preinit_array, .init_array and
.fini_array in the data segment.
2002-03-04 Alan Modra <amodra@bigpond.net.au>
* scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit.
2002-03-01 David Mosberger <davidm@hpl.hp.com>
* scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
.init_array, and .fini_array.
2002-03-18 David O'Brien <obrien@FreeBSD.org>
* emultempl/elf32.em: Use lbasename vs. basename to fix problem where
@ -8,10 +56,7 @@ Mon Mar 18 18:07:20 CET 2002 Jan Hubicka <jh@suse.cz>
Andreas Jaeger <aj@suse.de>
Andreas Schwab <schwab@suse.de>
* cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
* configure.tgt (x86_64-*-linux-gnu*): Configure i386 as native.
* elf_x86_64.sh (ARCH): Set to i386:x86-64
set libraries to default to lib64 paths.

View File

@ -1175,7 +1175,9 @@ DEP1: $(CFILES) $(GENERATED_CFILES)
dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!'
-e 's!@BFDDIR@!$(BFDDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!' \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/ld$$,,`'!'
dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@ -1258,16 +1260,17 @@ pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \
ldmisc.h ldgram.h ldmain.h ldfile.h ldemul.h $(INCDIR)/coff/internal.h \
../bfd/libcoff.h deffile.h pe-dll.h
$(BFDDIR)/libcoff.h deffile.h pe-dll.h
ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \
mri.h ldctor.h ldlex.h
ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/symcat.h sysdep.h \
config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \
ld.h $(INCDIR)/bin-bugs.h ldgram.h ldmisc.h ldexp.h \
ldlang.h ldfile.h ldlex.h ldmain.h $(INCDIR)/libiberty.h
ldlex.o: ldlex.c $(INCDIR)/ansidecl.h ../bfd/bfd.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h ldgram.h \
ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h \
$(INCDIR)/libiberty.h
deffilep.o: deffilep.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h ../bfd/bfd.h $(INCDIR)/symcat.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -507,7 +507,7 @@ deffilep.c ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
@ -695,7 +695,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
@ -808,7 +808,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@ -1870,7 +1870,9 @@ DEP1: $(CFILES) $(GENERATED_CFILES)
dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!'
-e 's!@BFDDIR@!$(BFDDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!' \
-e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/ld$$,,`'!'
dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@ -1953,16 +1955,17 @@ pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \
ldmisc.h ldgram.h ldmain.h ldfile.h ldemul.h $(INCDIR)/coff/internal.h \
../bfd/libcoff.h deffile.h pe-dll.h
$(BFDDIR)/libcoff.h deffile.h pe-dll.h
ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \
mri.h ldctor.h ldlex.h
ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/symcat.h sysdep.h \
config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \
ld.h $(INCDIR)/bin-bugs.h ldgram.h ldmisc.h ldexp.h \
ldlang.h ldfile.h ldlex.h ldmain.h $(INCDIR)/libiberty.h
ldlex.o: ldlex.c $(INCDIR)/ansidecl.h ../bfd/bfd.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h ldgram.h \
ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h \
$(INCDIR)/libiberty.h
deffilep.o: deffilep.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h ../bfd/bfd.h $(INCDIR)/symcat.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \

View File

@ -11,11 +11,51 @@
HDEFINES=
HOSTING_CRT0=/lib/crt0.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo $libgcc -lc $libgcc`'
NATIVE_LIB_DIRS=
#
# Generic configurations:
#
case "${host}" in
*-*-freebsd*)
NATIVE_LIB_DIRS=/usr/lib
# Older versions of gcc do not use a specs file. In those cases,
# gcc -print-file-name=specs will simply print specs. We create a
# dummy specs files to handle this.
echo "-dynamic-linker `${CC} --print-file-name=ld-elf.so.1`" > specs
HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
*-*-linux*aout* | *-*-linux*oldld)
HOSTING_CRT0=/usr/lib/crt0.o
;;
*-*-linux*libc1*)
HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
;;
*-*-linux*)
HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
esac
#
# Now more specific configurations
#
case "${host}" in
*-*-linux*aout* | *-*-linux*oldld | *-*-linux*libc1*)
# No further tweaking needed
;;
alpha*-*-netbsd*)
# The new BSD `make' has a bug: it doesn't pass empty arguments in
# shell commands. So we need to make this value non-empty in order
@ -26,8 +66,7 @@ alpha*-*-netbsd*)
;;
arm*-*-linux-gnu*)
HOSTING_CRT0='-p -dynamic-linker `fgrep ld-linux.so \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"`
;;
i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*)
@ -41,23 +80,23 @@ i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34
i[3456]86-*-sysv4*)
HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
NATIVE_LIB_DIRS=/usr/ccs/lib
;;
i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*)
HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
;;
i[3456]86-*-sysv*)
HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
;;
i[3456]86-*-solaris*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
NATIVE_LIB_DIRS=/usr/ccs/lib
;;
@ -73,46 +112,31 @@ i[3456]86-*-sco* | i[3456]86-*-isc*)
${CC} -c crtend.c -o crtend.o
rm -f crtend.c
HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o'
;;
i[3456]86-*-linux*aout* | i[3456]86-*-linux*oldld)
HOSTING_CRT0=/usr/lib/crt0.o
;;
i[3456]86-*-linux*libc1*)
HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
;;
i[3456]86-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker `fgrep ld-linux.so \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o'
;;
i[3456]86-*-lynxos*)
HOSTING_CRT0=/lib/init1.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
;;
i[3456]86-pc-interix*)
HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o'
NATIVE_LIB_DIRS='$$INTERIX_ROOT/usr/lib/'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L $$X/local_bin -L $$INTERIX_ROOT/usr/lib -lc -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
;;
i[3456]86-*-cygwin*)
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
;;
ia64-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker `egrep "ld-linux-ia64.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux-ia64.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"`
;;
ia64-*-aix*)
HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
NATIVE_LIB_DIRS=/usr/lib/ia64l64
;;
@ -120,48 +144,32 @@ mips*-dec-bsd*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
mips*-sgi-irix4*)
mips*-sgi-irix4* | mips*-sgi-irix5*)
HOSTING_CRT0=/usr/lib/crt1.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
;;
mips*-sgi-irix5*)
HOSTING_CRT0=/usr/lib/crt1.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o'
;;
mips*-sgi-irix6*)
HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L/usr/lib32 -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
;;
mips*-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
;;
m68*-*-linux*aout*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
m68*-*-linux*libc1*)
HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
;;
m68*-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
;;
m68*-*-lynxos*)
HOSTING_CRT0=/lib/init1.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
;;
m68*-motorola-sysv)
HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`${CC} -print-file-name=\`crt0.o ]; then echo \`${CC} -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc881 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
HOSTING_LIBS=`echo "$HOSTING_LIBS" | sed -e "s,-lc,-lc881,"`
;;
m68*-sun-*)
@ -176,62 +184,43 @@ m88*-*-dgux*)
m88*-motorola-sysv3)
HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
;;
powerpc*-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
;;
s390x-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib/ld64.so.1 `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L `dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld64.so.1,"`
;;
s390-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
;;
sparc*-*-solaris2*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
NATIVE_LIB_DIRS=/usr/ccs/lib
;;
sparc-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.2 `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld-linux.so.2,"`
;;
sparc64-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib64/ld-linux.so.2 `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux.so.2,"`
;;
x86_64-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker /lib64/ld-linux-x86-64.so.2 `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
;;
#
# Generic configurations:
#
*-*-freebsd*)
NATIVE_LIB_DIRS=/usr/lib
# Older versions of gcc do not use a specs file. In those cases,
# gcc -print-file-name=specs will simply print specs. We create a
# dummy specs files to handle this.
echo "-dynamic-linker `${CC} --print-file-name=ld-elf.so.1`" > specs
HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
HOSTING_LIBS='`${CC} -print-libgcc-file-name` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `${CC} -print-libgcc-file-name` `${CC} --print-file-name=crtend.o` `${CC} --print-file-name=crtn.o`'
;;
*-*-linux*)
HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
alpha*-*-*)

View File

@ -3,6 +3,9 @@
/\\$/b loop
s!@INCDIR@!$(INCDIR)!g
s!@TOPDIR@/include!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
s!@TOPDIR@/bfd!$(BFDDIR)!g
s!@SRCDIR@/!!g
s! \.\./bfd/hosts/[^ ]*\.h! !g

View File

@ -1,22 +1,27 @@
# If you change this file, please also look at files which source this one:
# elf32b4300.sh elf32bsmip.sh elf32btsmip.sh elf32ebmip.sh elf32lmip.sh
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
test -n "${EMBEDDED}" || DATA_ADDR=0x10000000
MAXPAGESIZE=0x40000
NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000
TEXT_DYNAMIC=
INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
test -n "${EMBEDDED}" || TEXT_DYNAMIC=
INITIAL_READONLY_SECTIONS="
.reginfo ${RELOCATING-0} : { *(.reginfo) }
"
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
OTHER_SDATA_SECTIONS="
.lit8 ${RELOCATING-0} : { *(.lit8) }
.lit4 ${RELOCATING-0} : { *(.lit4) }
"
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
@ -27,4 +32,5 @@ OTHER_SECTIONS='
ARCH=mips
MACHINE=
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=mipself
GENERATE_SHLIB_SCRIPT=yes

View File

@ -1,3 +1,6 @@
# If you change this file, please also look at files which source this one:
# elf64bmip.sh elf64btsmip.sh
# This is an ELF platform.
SCRIPT_NAME=elf
@ -17,11 +20,11 @@ ENTRY=__start
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
.srdata : { *(.srdata) }
'
OTHER_SDATA_SECTIONS="
.lit8 ${RELOCATING-0} : { *(.lit8) }
.lit4 ${RELOCATING-0} : { *(.lit4) }
.srdata ${RELOCATING-0} : { *(.srdata) }
"
# Magic symbols.
TEXT_START_SYMBOLS='_ftext = . ;'
@ -41,35 +44,28 @@ EXECUTABLE_SYMBOLS="
# segment.
WRITABLE_RODATA=
OTHER_RELOCATING_SECTIONS='
.MIPS.events.text :
OTHER_SECTIONS="
.MIPS.events.text ${RELOCATING-0} :
{
*(.MIPS.events.text)
*(.MIPS.events.gnu.linkonce.t*)
*(.MIPS.events.text${RELOCATING+ .MIPS.events.gnu.linkonce.t*})
}
.MIPS.content.text :
.MIPS.content.text ${RELOCATING-0} :
{
*(.MIPS.content.text)
*(.MIPS.content.gnu.linkonce.t*)
*(.MIPS.content.text${RELOCATING+ .MIPS.content.gnu.linkonce.t*})
}
.MIPS.events.data :
.MIPS.events.data ${RELOCATING-0} :
{
*(.MIPS.events.data)
*(.MIPS.events.gnu.linkonce.d*)
*(.MIPS.events.data${RELOCATING+ .MIPS.events.gnu.linkonce.d*})
}
.MIPS.content.data :
.MIPS.content.data ${RELOCATING-0} :
{
*(.MIPS.content.data)
*(.MIPS.content.gnu.linkonce.d*)
*(.MIPS.content.data${RELOCATING+ .MIPS.content.gnu.linkonce.d*})
}
.MIPS.events.rodata :
.MIPS.events.rodata ${RELOCATING-0} :
{
*(.MIPS.events.rodata)
*(.MIPS.events.gnu.linkonce.r*)
*(.MIPS.events.rodata${RELOCATING+ .MIPS.events.gnu.linkonce.r*})
}
.MIPS.content.rodata :
.MIPS.content.rodata ${RELOCATING-0} :
{
*(.MIPS.content.rodata)
*(.MIPS.content.gnu.linkonce.r*)
}
'
*(.MIPS.content.rodata${RELOCATING+ .MIPS.content.gnu.linkonce.r*})
}"

View File

@ -1,31 +1,2 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
MAXPAGESIZE=0x40000
NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000
TEXT_DYNAMIC=
INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
ARCH=mips
MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
. ${srcdir}/emulparams/elf32bmip.sh
ENTRY=__start

Some files were not shown because too many files have changed in this diff Show More