2006-08-02  Richard Sandiford  <richard@codesourcery.com>
	    Kazu Hirata  <kazu@codesourcery.com>
	    Phil Edwards  <phil@codesourcery.com>
	    Nathan Sidwell  <nathan@codesourcery.com>

	* config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
	bfd_elf32_shlvxworks_vec.
	* configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
	(bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
	(bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
	(bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
	(bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
	(bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
	(bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
	(bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
	* configure: Regenerate.
	* Makefile.am: Regenerate dependencies.
	* Makefile.in: Regenerate.
	* elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
	(elf_vxworks_add_symbol_hook): Use it.
	(elf_vxworks_link_output_symbol_hook): Likewise.  Use the hash
	table entry to check for weak undefined symbols and to obtain
	the original bfd.
	(elf_vxworks_emit_relocs): Use target_index instead of this_idx.
	* elf32-sh-relocs.h: New file, split from elf32-sh.c.
	(R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
	SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
	special_function field.
	(R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
	(R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
	(R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
	(R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
	(R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
	(R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
	(SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
	* elf32-sh.c: Include elf32-vxworks.h.
	(MINUS_ONE): Define.
	(sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
	set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
	to sh_elf_reloc.
	(sh_vxworks_howto_table): New variable.  Include elf32-sh-relocs.h
	with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
	SH_ELF_RELOC set to bfd_elf_generic_reloc.
	(vxworks_object_p, get_howto_table): New functions.
	(sh_elf_reloc_type_lookup): Fix typo.  Use get_howto_table.
	(sh_elf_info_to_howto): Use get_howto_table.
	(sh_elf_relax_section): Honor the partial_inplace field of the
	R_SH_DIR32 howto.
	(sh_elf_relax_delete_bytes): Likewise.
	(elf_sh_plt_info): New structure.
	(PLT_ENTRY_SIZE): Replace both definitions with...
	(ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
	INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
	(elf_sh_plt0_entry_le): Likewise.
	(elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
	(elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
	(elf_sh_plts): New structure, with separate definitions for
	INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(elf_sh_plt0_entry): Delete both definitions.
	(elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
	(elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
	(elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
	(elf_sh_plt_reloc_offset): Likewise.
	(movi_shori_putval): Delete in favor of...
	(install_plt_field): ...this new function, with separate definitions
	for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(get_plt_info): New function, with separate definitions
	for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
	(VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
	(vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
	(vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
	(vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
	(get_plt_index, get_plt_offset): New functions.
	(elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
	(sh_elf_link_hash_table_create): Initialize them.
	(sh_elf_create_dynamic_sections): Call
	elf_vxworks_create_dynamic_sections for VxWorks.
	(allocate_dynrelocs): Use htab->plt_info to get the size of PLT
	entries.  Allocate relocation entries in .rela.plt.unloaded if
	generating a VxWorks executable.
	(sh_elf_always_size_sections): New function.
	(sh_elf_size_dynamic_sections): Extend .rela.plt handling to
	.rela.plt.unloaded.
	(sh_elf_relocate_section): Use get_howto_table.  Honor
	partial_inplace when calculating the addend for dynamic
	relocations.  Use get_plt_index.
	(sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
	and htab->plt_info.  Fill in the bra .plt offset for VxWorks
	executables.  Populate .rela.plt.unloaded.  Do not make
	_GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
	(sh_elf_finish_dynamic_sections): Use install_plt_field and
	htab->plt_info.  Handle cases where there is no special PLT header.
	Populate the first relocation in .rela.plt.unloaded and fix up
	the remaining entries.
	(sh_elf_plt_sym_val): Use get_plt_info.
	(elf_backend_always_size_sections): Define.
	(TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
	(TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
	(elf32_bed, elf_backend_want_plt_sym): Likewise.
	(elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
	(elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
	(elf_backend_add_symbol_hook): Likewise.
	(elf_backend_link_output_symbol_hook): Likewise.
	(elf_backend_emit_relocs): Likewise.
	(elf_backend_final_write_processing): Likewise.
	(ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
	* targets.c (bfd_elf32_shlvxworks_vec): Declare.
	(bfd_elf32_shvxworks_vec): Likewise.
	(_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
	bfd_elf32_shvxworks_vec.

gas/
	* config/tc-sh.c (apply_full_field_fix): New function.
	(md_apply_fix): Use it instead of md_number_to_chars.  Do not fill
	in fx_addnumber for BFD_RELOC_32_PLT_PCREL.
	(tc_gen_reloc): Use fx_addnumber rather than 0 as the default case.
	* config/tc-sh.h (TARGET_FORMAT): Override for TE_VXWORKS.

ld/
2006-08-02  Richard Sandiford  <richard@codesourcery.com>
	    Kazu Hirata  <kazu@codesourcery.com>
	    Phil Edwards  <phil@codesourcery.com>

	* Makefile.am (ALL_EMULATIONS): Add eshelf_vxworks.o and
	eshlelf_vxworks.o.
	(eshelf_vxworks.c, eshlelf_vxworks.c): New rules.
	* Makefile.in: Regenerate.
	* configure.tgt (sh-*-vxworks): Use shelf_vxworks and
	shlelf_vxworks.
	* emulparams/shelf_vxworks.sh: New file.
	* emulparams/shlelf_vxworks.sh: Likewise.
	* emulparams/vxworks.sh (FINI): Prefix _etext with ${SYMPREFIX}.
	(OTHER_END_SYMBOLS): Likewise _ehdr.
	(DATA_END_SYMBOLS): Likewise _edata.
	* emultempl/vxworks.em (vxworks_after_open): Check whether output_bfd
	is indeed an ELF file before dealing with --force-dynamic.

ld/testsuite/
	* ld-sh/rd-sh.exp: Treat vxworks1-static.d specially.
	* ld-sh/sh-vxworks.exp: New file.
	* ld-sh/sh.exp: Extend sh-linux SIZEOF_HEADERS handling to
	sh-*-vxworks.
	* ld-sh/vxworks1-le.dd, ld-sh/vxworks1-lib-le.dd,
	* ld-sh/vxworks1-lib.dd, ld-sh/vxworks1-lib.nd,
	* ld-sh/vxworks1-lib.rd, ld-sh/vxworks1-lib.s,
	* ld-sh/vxworks1-static.d, ld-sh/vxworks1.dd,
	* ld-sh/vxworks1.ld, ld-sh/vxworks1.rd, ld-sh/vxworks1.s,
	* ld-sh/vxworks2-static.sd, ld-sh/vxworks2.s,
	* ld-sh/vxworks2.sd, ld-sh/vxworks3-le.dd,
	* ld-sh/vxworks3-lib-le.dd, ld-sh/vxworks3-lib.dd,
	* ld-sh/vxworks3-lib.s, ld-sh/vxworks3.dd, ld-sh/vxworks3.s,
	* ld-sh/vxworks4.d, ld-sh/vxworks4a.s, ld-sh/vxworks4b.s,
	* ld-sh/reloc1.s, ld-sh/reloc1.d: New tests.
This commit is contained in:
Richard Sandiford 2006-08-04 13:13:56 +00:00
parent 9b86ba52c4
commit 55e6e39790
50 changed files with 3336 additions and 1968 deletions

View File

@ -1,3 +1,116 @@
2006-08-04 Richard Sandiford <richard@codesourcery.com>
Kazu Hirata <kazu@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
* config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
bfd_elf32_shlvxworks_vec.
* configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
(bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
(bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
(bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
(bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
(bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
(bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
(bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
* configure: Regenerate.
* Makefile.am: Regenerate dependencies.
* Makefile.in: Regenerate.
* elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
(elf_vxworks_add_symbol_hook): Use it.
(elf_vxworks_link_output_symbol_hook): Likewise. Use the hash
table entry to check for weak undefined symbols and to obtain
the original bfd.
(elf_vxworks_emit_relocs): Use target_index instead of this_idx.
* elf32-sh-relocs.h: New file, split from elf32-sh.c.
(R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
special_function field.
(R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
(R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
(R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
(R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
(R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
(R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
(SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
* elf32-sh.c: Include elf32-vxworks.h.
(MINUS_ONE): Define.
(sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
to sh_elf_reloc.
(sh_vxworks_howto_table): New variable. Include elf32-sh-relocs.h
with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
SH_ELF_RELOC set to bfd_elf_generic_reloc.
(vxworks_object_p, get_howto_table): New functions.
(sh_elf_reloc_type_lookup): Fix typo. Use get_howto_table.
(sh_elf_info_to_howto): Use get_howto_table.
(sh_elf_relax_section): Honor the partial_inplace field of the
R_SH_DIR32 howto.
(sh_elf_relax_delete_bytes): Likewise.
(elf_sh_plt_info): New structure.
(PLT_ENTRY_SIZE): Replace both definitions with...
(ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
(elf_sh_plt0_entry_le): Likewise.
(elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
(elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
(elf_sh_plts): New structure, with separate definitions for
INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(elf_sh_plt0_entry): Delete both definitions.
(elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
(elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
(elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
(elf_sh_plt_reloc_offset): Likewise.
(movi_shori_putval): Delete in favor of...
(install_plt_field): ...this new function, with separate definitions
for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(get_plt_info): New function, with separate definitions
for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
(VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
(vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
(vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
(vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
(get_plt_index, get_plt_offset): New functions.
(elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
(sh_elf_link_hash_table_create): Initialize them.
(sh_elf_create_dynamic_sections): Call
elf_vxworks_create_dynamic_sections for VxWorks.
(allocate_dynrelocs): Use htab->plt_info to get the size of PLT
entries. Allocate relocation entries in .rela.plt.unloaded if
generating a VxWorks executable.
(sh_elf_always_size_sections): New function.
(sh_elf_size_dynamic_sections): Extend .rela.plt handling to
.rela.plt.unloaded.
(sh_elf_relocate_section): Use get_howto_table. Honor
partial_inplace when calculating the addend for dynamic
relocations. Use get_plt_index.
(sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
and htab->plt_info. Fill in the bra .plt offset for VxWorks
executables. Populate .rela.plt.unloaded. Do not make
_GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
(sh_elf_finish_dynamic_sections): Use install_plt_field and
htab->plt_info. Handle cases where there is no special PLT header.
Populate the first relocation in .rela.plt.unloaded and fix up
the remaining entries.
(sh_elf_plt_sym_val): Use get_plt_info.
(elf_backend_always_size_sections): Define.
(TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
(TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
(elf32_bed, elf_backend_want_plt_sym): Likewise.
(elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
(elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
(elf_backend_add_symbol_hook): Likewise.
(elf_backend_link_output_symbol_hook): Likewise.
(elf_backend_emit_relocs): Likewise.
(elf_backend_final_write_processing): Likewise.
(ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
* targets.c (bfd_elf32_shlvxworks_vec): Declare.
(bfd_elf32_shvxworks_vec): Likewise.
(_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
bfd_elf32_shvxworks_vec.
2006-08-02 Mark Kettenis <kettenis@gnu.org>
* configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo.

View File

@ -1127,7 +1127,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \
coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \
@ -1423,9 +1424,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
@ -1437,15 +1438,15 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.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 $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \
$(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.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 \
$(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
elf32-target.h
$(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
@ -1825,12 +1826,12 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf32-target.h
$(INCDIR)/hashtab.h elf32-target.h
elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf64-target.h
$(INCDIR)/hashtab.h elf64-target.h
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h

View File

@ -1688,7 +1688,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \
coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \
@ -1984,9 +1985,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
@ -1998,15 +1999,15 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.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 $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \
$(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.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 \
$(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
elf32-target.h
$(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
@ -2386,12 +2387,12 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf32-target.h
$(INCDIR)/hashtab.h elf32-target.h
elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf64-target.h
$(INCDIR)/hashtab.h elf64-target.h
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h

View File

@ -1252,8 +1252,8 @@ case "${targ}" in
targ_underscore=yes
;;
sh-*-vxworks)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec"
targ_defvec=bfd_elf32_shvxworks_vec
targ_selvecs="bfd_elf32_shlvxworks_vec"
# FIXME None of the following are actually used on this target, but
# they're necessary for coff-sh.c (which is unconditionally used) to be
# compiled correctly.

28
bfd/configure vendored
View File

@ -10872,19 +10872,21 @@ do
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo$elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;

View File

@ -662,19 +662,21 @@ do
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo$elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;

View File

@ -26,9 +26,28 @@
#include "elf-bfd.h"
#include "elf-vxworks.h"
/* Return true if symbol NAME, as defined by ABFD, is one of the special
__GOTT_BASE__ or __GOTT_INDEX__ symbols. */
static bfd_boolean
elf_vxworks_gott_symbol_p (bfd *abfd, const char *name)
{
char leading;
leading = bfd_get_symbol_leading_char (abfd);
if (leading)
{
if (*name != leading)
return FALSE;
name++;
}
return (strcmp (name, "__GOTT_BASE__") == 0
|| strcmp (name, "__GOTT_INDEX__") == 0);
}
/* Tweak magic VxWorks symbols as they are loaded. */
bfd_boolean
elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
elf_vxworks_add_symbol_hook (bfd *abfd,
struct bfd_link_info *info,
Elf_Internal_Sym *sym,
const char **namep,
@ -45,8 +64,7 @@ elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
This transformation will be undone in
elf_i386_vxworks_link_output_symbol_hook. */
if ((info->shared || abfd->flags & DYNAMIC)
&& (strcmp (*namep, "__GOTT_INDEX__") == 0
|| strcmp (*namep, "__GOTT_BASE__") == 0))
&& elf_vxworks_gott_symbol_p (abfd, *namep))
{
sym->st_info = ELF_ST_INFO (STB_WEAK, ELF_ST_TYPE (sym->st_info));
*flagsp |= BSF_WEAK;
@ -114,16 +132,12 @@ elf_vxworks_link_output_symbol_hook (struct bfd_link_info *info
const char *name,
Elf_Internal_Sym *sym,
asection *input_sec ATTRIBUTE_UNUSED,
struct elf_link_hash_entry *h
ATTRIBUTE_UNUSED)
struct elf_link_hash_entry *h)
{
/* Ignore the first dummy symbol. */
if (!name)
return TRUE;
/* Reverse the effects of the hack in elf_vxworks_add_symbol_hook. */
if (strcmp (name, "__GOTT_INDEX__") == 0
|| strcmp (name, "__GOTT_BASE__") == 0)
if (h
&& h->root.type == bfd_link_hash_undefweak
&& elf_vxworks_gott_symbol_p (h->root.u.undef.abfd, name))
sym->st_info = ELF_ST_INFO (STB_GLOBAL, ELF_ST_TYPE (sym->st_info));
return TRUE;
@ -171,8 +185,7 @@ elf_vxworks_emit_relocs (bfd *output_bfd,
for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
{
asection *sec = (*rel_hash)->root.u.def.section;
int this_idx =
elf_section_data (sec->output_section)->this_idx;
int this_idx = sec->output_section->target_index;
irela[j].r_info = ELF32_R_INFO (this_idx,
ELF32_R_TYPE (irela[j].r_info));

1716
bfd/elf32-sh-relocs.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -632,7 +632,9 @@ extern const bfd_target bfd_elf32_shl_vec;
extern const bfd_target bfd_elf32_shl_symbian_vec;
extern const bfd_target bfd_elf32_shlin_vec;
extern const bfd_target bfd_elf32_shlnbsd_vec;
extern const bfd_target bfd_elf32_shlvxworks_vec;
extern const bfd_target bfd_elf32_shnbsd_vec;
extern const bfd_target bfd_elf32_shvxworks_vec;
extern const bfd_target bfd_elf32_sparc_vec;
extern const bfd_target bfd_elf32_sparc_vxworks_vec;
extern const bfd_target bfd_elf32_tradbigmips_vec;
@ -940,7 +942,9 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_shl_symbian_vec,
&bfd_elf32_shlin_vec,
&bfd_elf32_shlnbsd_vec,
&bfd_elf32_shlvxworks_vec,
&bfd_elf32_shnbsd_vec,
&bfd_elf32_shvxworks_vec,
#ifdef BFD64
&bfd_elf32_sh64_vec,
&bfd_elf32_sh64l_vec,

View File

@ -1,3 +1,11 @@
2006-08-04 Richard Sandiford <richard@codesourcery.com>
* config/tc-sh.c (apply_full_field_fix): New function.
(md_apply_fix): Use it instead of md_number_to_chars. Do not fill
in fx_addnumber for BFD_RELOC_32_PLT_PCREL.
(tc_gen_reloc): Use fx_addnumber rather than 0 as the default case.
* config/tc-sh.h (TARGET_FORMAT): Override for TE_VXWORKS.
2006-08-03 Nick Clifton <nickc@redhat.com>
PR gas/2991

View File

@ -3782,6 +3782,28 @@ sh_elf_final_processing (void)
}
#endif
/* Apply fixup FIXP to SIZE-byte field BUF given that VAL is its
assembly-time value. If we're generating a reloc for FIXP,
see whether the addend should be stored in-place or whether
it should be in an ELF r_addend field. */
static void
apply_full_field_fix (fixS *fixP, char *buf, bfd_vma val, int size)
{
reloc_howto_type *howto;
if (fixP->fx_addsy != NULL || fixP->fx_pcrel)
{
howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
if (howto && !howto->partial_inplace)
{
fixP->fx_addnumber = val;
return;
}
}
md_number_to_chars (buf, val, size);
}
/* Apply a fixup to the object file. */
void
@ -3982,11 +4004,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_32:
case BFD_RELOC_32_PCREL:
md_number_to_chars (buf, val, 4);
apply_full_field_fix (fixP, buf, val, 4);
break;
case BFD_RELOC_16:
md_number_to_chars (buf, val, 2);
apply_full_field_fix (fixP, buf, val, 2);
break;
case BFD_RELOC_SH_USES:
@ -4018,8 +4040,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
val = fixP->fx_offset;
if (fixP->fx_subsy)
val -= S_GET_VALUE (fixP->fx_subsy);
fixP->fx_addnumber = val;
md_number_to_chars (buf, val, 4);
apply_full_field_fix (fixP, buf, val, 4);
break;
case BFD_RELOC_SH_GOTPC:
@ -4040,7 +4061,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
was used to store the correction, but since the expression is
not pcrel, I felt it would be confusing to do it this way. */
* valP -= 1;
md_number_to_chars (buf, val, 4);
apply_full_field_fix (fixP, buf, val, 4);
break;
case BFD_RELOC_SH_TLS_GD_32:
@ -4051,7 +4072,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_32_GOT_PCREL:
case BFD_RELOC_SH_GOTPLT32:
* valP = 0; /* Fully resolved at runtime. No addend. */
md_number_to_chars (buf, 0, 4);
apply_full_field_fix (fixP, buf, 0, 4);
break;
case BFD_RELOC_SH_TLS_LDO_32:
@ -4059,7 +4080,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
S_SET_THREAD_LOCAL (fixP->fx_addsy);
/* Fallthrough */
case BFD_RELOC_32_GOTOFF:
md_number_to_chars (buf, val, 4);
apply_full_field_fix (fixP, buf, val, 4);
break;
#endif
@ -4262,12 +4283,8 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
else if (shmedia_init_reloc (rel, fixp))
;
#endif
else if (fixp->fx_pcrel)
rel->addend = fixp->fx_addnumber;
else if (r_type == BFD_RELOC_32 || r_type == BFD_RELOC_32_GOTOFF)
rel->addend = fixp->fx_addnumber;
else
rel->addend = 0;
rel->addend = fixp->fx_addnumber;
rel->howto = bfd_reloc_type_lookup (stdoutput, r_type);

View File

@ -149,6 +149,8 @@ extern int target_big_endian;
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-nbsd" : "elf32-sh-nbsd")
#elif defined TARGET_SYMBIAN
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-symbian" : "elf32-sh-symbian")
#elif defined (TE_VXWORKS)
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-vxworks" : "elf32-sh-vxworks")
#else
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl" : "elf32-sh")
#endif

View File

@ -1,3 +1,21 @@
2006-08-04 Richard Sandiford <richard@codesourcery.com>
Kazu Hirata <kazu@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* Makefile.am (ALL_EMULATIONS): Add eshelf_vxworks.o and
eshlelf_vxworks.o.
(eshelf_vxworks.c, eshlelf_vxworks.c): New rules.
* Makefile.in: Regenerate.
* configure.tgt (sh-*-vxworks): Use shelf_vxworks and
shlelf_vxworks.
* emulparams/shelf_vxworks.sh: New file.
* emulparams/shlelf_vxworks.sh: Likewise.
* emulparams/vxworks.sh (FINI): Prefix _etext with ${SYMPREFIX}.
(OTHER_END_SYMBOLS): Likewise _ehdr.
(DATA_END_SYMBOLS): Likewise _edata.
* emultempl/vxworks.em (vxworks_after_open): Check whether output_bfd
is indeed an ELF file before dealing with --force-dynamic.
2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz>
PR binutils/2983

View File

@ -353,6 +353,8 @@ ALL_EMULATIONS = \
eshlelf_nbsd.o \
eshelf_nto.o \
eshlelf_nto.o \
eshelf_vxworks.o \
eshlelf_vxworks.o \
eshl.o \
eshlelf.o \
eshlsymbian.o \
@ -1504,6 +1506,10 @@ eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
eshelf_vxworks.c: $(srcdir)/emulparams/shelf_vxworks.sh \
$(srcdir)/emulparams/vxworks.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc \
$(srcdir)/emultempl/vxworks.em ${GEN_DEPENDS}
${GENSCRIPTS} shelf_vxworks "$(tdir_shelf_vxworks)"
eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
$(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
@ -1512,6 +1518,11 @@ eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
eshlelf_vxworks.c: $(srcdir)/emulparams/shlelf_vxworks.sh \
$(srcdir)/emulparams/shelf_vxworks.sh $(srcdir)/emulparams/vxworks.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/vxworks.em \
${GEN_DEPENDS}
${GENSCRIPTS} shlelf_vxworks "$(tdir_shlelf_vxworks)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}

View File

@ -577,6 +577,8 @@ ALL_EMULATIONS = \
eshlelf_nbsd.o \
eshelf_nto.o \
eshlelf_nto.o \
eshelf_vxworks.o \
eshlelf_vxworks.o \
eshl.o \
eshlelf.o \
eshlsymbian.o \
@ -2315,6 +2317,10 @@ eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
eshelf_vxworks.c: $(srcdir)/emulparams/shelf_vxworks.sh \
$(srcdir)/emulparams/vxworks.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc \
$(srcdir)/emultempl/vxworks.em ${GEN_DEPENDS}
${GENSCRIPTS} shelf_vxworks "$(tdir_shelf_vxworks)"
eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
$(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
@ -2323,6 +2329,11 @@ eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
eshlelf_vxworks.c: $(srcdir)/emulparams/shlelf_vxworks.sh \
$(srcdir)/emulparams/shelf_vxworks.sh $(srcdir)/emulparams/vxworks.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/vxworks.em \
${GEN_DEPENDS}
${GENSCRIPTS} shlelf_vxworks "$(tdir_shlelf_vxworks)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}

View File

@ -472,9 +472,11 @@ shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
targ_emul=shlelf
targ_extra_emuls="shelf shl sh" ;;
sh-*-rtemscoff*) targ_emul=sh; targ_extra_emuls=shl ;;
sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos* | sh-*-vxworks)
sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos*)
targ_emul=shelf
targ_extra_emuls="shlelf sh shl" ;;
sh-*-vxworks) targ_emul=shelf_vxworks
targ_extra_emuls=shlelf_vxworks ;;
sh-*-nto*) targ_emul=shelf_nto
targ_extra_emuls=shlelf_nto ;;
sh-*-pe) targ_emul=shpe ;

View File

@ -0,0 +1,19 @@
# If you change this file, please also look at files which source this one:
# shlelf_vxworks.sh
SCRIPT_NAME=elf
BIG_OUTPUT_FORMAT="elf32-sh-vxworks"
LITTLE_OUTPUT_FORMAT="elf32-shl-vxworks"
OUTPUT_FORMAT="$BIG_OUTPUT_FORMAT"
TEXT_START_ADDR=0x1000
MAXPAGESIZE='CONSTANT (MAXPAGESIZE)'
ARCH=sh
MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
ENTRY=__start
SYMPREFIX=_
GOT=".got ${RELOCATING-0} : {
PROVIDE(__GLOBAL_OFFSET_TABLE_ = .);
*(.got.plt) *(.got) }"
. ${srcdir}/emulparams/vxworks.sh

View File

@ -0,0 +1,2 @@
. ${srcdir}/emulparams/shelf_vxworks.sh
OUTPUT_FORMAT="$LITTLE_OUTPUT_FORMAT"

View File

@ -17,12 +17,12 @@ FINI_START='_fini = .;
KEEP (*(.fini$0[1-9]));
KEEP (*(.fini$[1-8][0-9]));
KEEP (*(.fini$9[0-8]));'
FINI_END='KEEP (*(.fini$99));
PROVIDE (_etext = .);'
FINI_END="KEEP (*(.fini\$99));
PROVIDE (${SYMPREFIX}_etext = .);"
ETEXT_NAME=etext_unrelocated
OTHER_SYMBOLS="PROVIDE (_ehdr = ${TEXT_START_ADDR});"
DATA_END_SYMBOLS=".edata : { PROVIDE (_edata = .); }"
OTHER_END_SYMBOLS="PROVIDE (${SYMPREFIX}_ehdr = ${TEXT_START_ADDR});"
DATA_END_SYMBOLS=".edata : { PROVIDE (${SYMPREFIX}_edata = .); }"
VXWORKS_BASE_EM_FILE=$EXTRA_EM_FILE
EXTRA_EM_FILE=vxworks
unset EMBEDDED

View File

@ -13,12 +13,14 @@ vxworks_after_open (void)
if (force_dynamic
&& link_info.input_bfds
&& output_bfd->xvec->flavour == bfd_target_elf_flavour
&& !_bfd_elf_link_create_dynamic_sections (link_info.input_bfds,
&link_info))
einfo ("%X%P: Cannot create dynamic sections %E\n");
if (!force_dynamic
&& !link_info.shared
&& output_bfd->xvec->flavour == bfd_target_elf_flavour
&& elf_hash_table (&link_info)->dynamic_sections_created)
einfo ("%X%P: Dynamic sections created in non-dynamic link\n");
}

View File

@ -1,3 +1,21 @@
2006-08-04 Richard Sandiford <richard@codesourcery.com>
* ld-sh/rd-sh.exp: Treat vxworks1-static.d specially.
* ld-sh/sh-vxworks.exp: New file.
* ld-sh/sh.exp: Extend sh-linux SIZEOF_HEADERS handling to
sh-*-vxworks.
* ld-sh/vxworks1-le.dd, ld-sh/vxworks1-lib-le.dd,
* ld-sh/vxworks1-lib.dd, ld-sh/vxworks1-lib.nd,
* ld-sh/vxworks1-lib.rd, ld-sh/vxworks1-lib.s,
* ld-sh/vxworks1-static.d, ld-sh/vxworks1.dd,
* ld-sh/vxworks1.ld, ld-sh/vxworks1.rd, ld-sh/vxworks1.s,
* ld-sh/vxworks2-static.sd, ld-sh/vxworks2.s,
* ld-sh/vxworks2.sd, ld-sh/vxworks3-le.dd,
* ld-sh/vxworks3-lib-le.dd, ld-sh/vxworks3-lib.dd,
* ld-sh/vxworks3-lib.s, ld-sh/vxworks3.dd, ld-sh/vxworks3.s,
* ld-sh/vxworks4.d, ld-sh/vxworks4a.s, ld-sh/vxworks4b.s,
* ld-sh/reloc1.s, ld-sh/reloc1.d: New tests.
2006-08-01 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/noload-1.d: New.

View File

@ -48,7 +48,11 @@ set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
foreach shtest $rd_test_list {
# We need to strip the ".d", but can leave the dirname.
verbose [file rootname $shtest]
run_dump_test [file rootname $shtest]
# vxworks-static.d relies on files created by sh-vxworks.exp.
# We run it there instead of here.
if { [file tail $shtest] != "vxworks1-static.d" } {
run_dump_test [file rootname $shtest]
}
if [string match $srcdir/$subdir/*-dso.d $shtest] {
# Copy the output of the DSO-createing test to .so file.
# Notice that a DSO-creating test must preceed the tests

View File

@ -0,0 +1,10 @@
#source: reloc1.s
#as: -big
#ld: -shared -EB --defsym foo=0x9000
#objdump: -sj.data
#target: sh*-*-elf sh-*-vxworks
.*: file format elf32-sh.*
Contents of section \.data:
.* 9123 .*

View File

@ -0,0 +1,2 @@
.data
.word foo + 0x123

View File

@ -0,0 +1,42 @@
if { ![istarget "sh-*-vxworks"] } {
return
}
set endians { "--big" "-EB" "" "--little" "-EL" "-le" }
foreach { gas_option ld_option suffix } $endians {
set vxworkstests {
{"VxWorks shared library test 1" "-shared -Tvxworks1.ld $ld_option"
"$gas_option" {vxworks1-lib.s}
{{readelf --relocs vxworks1-lib.rd}
{objdump -dr vxworks1-lib$suffix.dd}
{readelf --symbols vxworks1-lib.nd}}
"libvxworks1.so"}
{"VxWorks executable test 1 (dynamic)" \
"tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic $ld_option"
"$gas_option" {vxworks1.s}
{{readelf --relocs vxworks1.rd} {objdump -dr vxworks1$suffix.dd}}
"vxworks1"}
{"VxWorks executable test 2 (dynamic)" \
"-Tvxworks1.ld -q --force-dynamic $ld_option"
"$gas_option" {vxworks2.s}
{{readelf --segments vxworks2.sd}}
"vxworks2"}
{"VxWorks executable test 2 (static)"
"-Tvxworks1.ld $ld_option"
"$gas_option" {vxworks2.s}
{{readelf --segments vxworks2-static.sd}}
"vxworks2"}
{"VxWorks shared library test 3" "-shared -Tvxworks1.ld $ld_option"
"$gas_option" {vxworks3-lib.s}
{{objdump -dr vxworks3-lib$suffix.dd}}
"libvxworks3.so"}
{"VxWorks executable test 3 (dynamic)" \
"tmpdir/libvxworks3.so -Tvxworks1.ld -q --force-dynamic $ld_option"
"$gas_option" {vxworks3.s}
{{objdump -d vxworks3$suffix.dd}}
"vxworks3"}
}
run_ld_link_tests [subst $vxworkstests]
}
run_dump_test "vxworks1-static"

View File

@ -62,8 +62,10 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
set testsrec "SH relaxing to S-records"
if [istarget sh*-linux-*] {
# This target needs the explicit entry address.
if { [istarget sh*-linux-*] || [istarget sh-*-vxworks] } {
# On these "non-embedded" targets, the default ELF and srec start
# addresses will be SIZEOF_HEADERS bytes apart. Ensure consistency
# by feeding the ELF start address to the srec link line.
catch "exec $objdump -x tmpdir/sh1 | grep start\\ address | sed s/start\\ address//" entry_addr
set srec_relax_arg "-Ttext $entry_addr -relax --oformat srec tmpdir/sh1.o"
} else {

View File

@ -0,0 +1,73 @@
.*: file format .*
Disassembly of section \.plt:
00080800 <_PROCEDURE_LINKAGE_TABLE_>:
80800: 01 d1 mov\.l 80808 <_PROCEDURE_LINKAGE_TABLE_\+0x8>,r1 ! 0x81408
80802: 12 61 mov\.l @r1,r1
80804: 2b 41 jmp @r1
80806: 09 00 nop
80808: 08 14 .*
80808: R_SH_DIR32 _GLOBAL_OFFSET_TABLE_\+0x8
8080a: 08 00 .*
0008080c <_sglobal@plt>:
8080c: 01 d0 mov\.l 80814 <_sglobal@plt\+0x8>,r0 ! 0x8140c
8080e: 02 60 mov\.l @r0,r0
80810: 2b 40 jmp @r0
80812: 09 00 nop
80814: 0c 14 .*
80814: R_SH_DIR32 _GLOBAL_OFFSET_TABLE_\+0xc
80816: 08 00 .*
80818: 01 d0 mov\.l 80820 <_sglobal@plt\+0x14>,r0 ! 0x0
8081a: f1 af bra 80800 <_PROCEDURE_LINKAGE_TABLE_>
8081c: 09 00 nop
8081e: 09 00 nop
80820: 00 00 .*
\.\.\.
00080824 <_foo@plt>:
80824: 01 d0 mov\.l 8082c <_foo@plt\+0x8>,r0 ! 0x81410
80826: 02 60 mov\.l @r0,r0
80828: 2b 40 jmp @r0
8082a: 09 00 nop
8082c: 10 14 .*
8082c: R_SH_DIR32 _GLOBAL_OFFSET_TABLE_\+0x10
8082e: 08 00 .*
80830: 01 d0 mov\.l 80838 <_foo@plt\+0x14>,r0 ! 0xc
80832: e5 af bra 80800 <_PROCEDURE_LINKAGE_TABLE_>
80834: 09 00 nop
80836: 09 00 nop
80838: 0c 00 .*
\.\.\.
Disassembly of section \.text:
00080c00 <__start>:
80c00: 22 4f sts\.l pr,@-r15
80c02: 06 d0 mov\.l 80c1c <__start\+0x1c>,r0 ! 0x80824 <_foo@plt>
80c04: 0b 40 jsr @r0
80c06: 09 00 nop
80c08: 05 d0 mov\.l 80c20 <__start\+0x20>,r0 ! 0x8080c <_sglobal@plt>
80c0a: 0b 40 jsr @r0
80c0c: 09 00 nop
80c0e: 05 d0 mov\.l 80c24 <__start\+0x24>,r0 ! 0x80c28 <_sexternal>
80c10: 0b 40 jsr @r0
80c12: 09 00 nop
80c14: 26 4f lds\.l @r15\+,pr
80c16: 0b 00 rts
80c18: 09 00 nop
80c1a: 09 00 nop
80c1c: 24 08 .*
80c1c: R_SH_DIR32 \.plt\+0x24
80c1e: 08 00 .*
80c20: 0c 08 .*
80c20: R_SH_DIR32 \.plt\+0xc
80c22: 08 00 .*
80c24: 28 0c .*
80c24: R_SH_DIR32 _sexternal
80c26: 08 00 .*
00080c28 <_sexternal>:
80c28: 0b 00 rts
80c2a: 09 00 nop

View File

@ -0,0 +1,76 @@
.*: file format .*
Disassembly of section \.plt:
00080800 <_PROCEDURE_LINKAGE_TABLE_>:
80800: 01 d0 mov\.l 80808 <_PROCEDURE_LINKAGE_TABLE_\+0x8>,r0 ! 0xc
80802: ce 00 mov\.l @\(r0,r12\),r0
80804: 2b 40 jmp @r0
80806: 09 00 nop
80808: 0c 00 .*
8080a: 00 00 .*
8080c: 01 d0 mov\.l 80814 <_sglobal@plt\+0x14>,r0 | 0x0
8080e: c2 51 mov\.l @\(8,r12\),r1
80810: 2b 41 jmp @r1
80812: 09 00 nop
80814: 00 00 .*
\.\.\.
00080818 <_sexternal@plt>:
80818: 01 d0 mov\.l 80820 <_sexternal@plt\+0x8>,r0 ! 0x10
8081a: ce 00 mov\.l @\(r0,r12\),r0
8081c: 2b 40 jmp @r0
8081e: 09 00 nop
80820: 10 00 .*
80822: 00 00 .*
80824: 01 d0 mov\.l 8082c <_sexternal@plt\+0x14>,r0 ! 0xc
80826: c2 51 mov\.l @\(8,r12\),r1
80828: 2b 41 jmp @r1
8082a: 09 00 nop
8082c: 0c 00 .*
\.\.\.
Disassembly of section \.text:
00080c00 <_foo>:
80c00: c6 2f mov\.l r12,@-r15
80c02: 22 4f sts\.l pr,@-r15
80c04: 0a dc mov\.l 80c30 <_foo\+0x30>,r12 ! 0x0
80c06: c2 6c mov\.l @r12,r12
80c08: 0a d0 mov\.l 80c34 <_foo\+0x34>,r0 ! 0x0
80c0a: ce 0c mov\.l @\(r0,r12\),r12
80c0c: 0a d0 mov\.l 80c38 <_foo\+0x38>,r0 ! 0x14
80c0e: ce 01 mov\.l @\(r0,r12\),r1
80c10: 12 62 mov\.l @r1,r2
80c12: 01 72 add #1,r2
80c14: 22 21 mov\.l r2,@r1
80c16: 09 d0 mov\.l 80c3c <_foo\+0x3c>,r0 ! 0x2c
80c18: 03 00 bsrf r0
80c1a: 09 00 nop
80c1c: 08 d0 mov\.l 80c40 <_foo\+0x40>,r0 ! 0xfffffbde
80c1e: 03 00 bsrf r0
80c20: 09 00 nop
80c22: 08 d0 mov\.l 80c44 <_foo\+0x44>,r0 ! 0xfffffbf0
80c24: 03 00 bsrf r0
80c26: 09 00 nop
80c28: 26 4f lds\.l @r15\+,pr
80c2a: 0b 00 rts
80c2c: f6 6c mov\.l @r15\+,r12
80c2e: 09 00 nop
...
80c38: 14 00 .*
80c3a: 00 00 .*
80c3c: 2c 00 .*
80c3e: 00 00 .*
80c40: de fb .*
80c42: ff ff .*
80c44: f0 fb .*
80c46: ff ff .*
00080c48 <_slocal>:
80c48: 0b 00 rts
80c4a: 09 00 nop
00080c4c <_sglobal>:
80c4c: 0b 00 rts
80c4e: 09 00 nop

View File

@ -0,0 +1,76 @@
.*: file format .*
Disassembly of section \.plt:
00080800 <_PROCEDURE_LINKAGE_TABLE_>:
80800: d0 01 mov\.l 80808 <_PROCEDURE_LINKAGE_TABLE_\+0x8>,r0 ! 0xc
80802: 00 ce mov\.l @\(r0,r12\),r0
80804: 40 2b jmp @r0
80806: 00 09 nop
80808: 00 00 .*
8080a: 00 0c .*
8080c: d0 01 mov\.l 80814 <_sglobal@plt\+0x14>,r0 | 0x0
8080e: 51 c2 mov\.l @\(8,r12\),r1
80810: 41 2b jmp @r1
80812: 00 09 nop
80814: 00 00 .*
\.\.\.
00080818 <_sexternal@plt>:
80818: d0 01 mov\.l 80820 <_sexternal@plt\+0x8>,r0 ! 0x10
8081a: 00 ce mov\.l @\(r0,r12\),r0
8081c: 40 2b jmp @r0
8081e: 00 09 nop
80820: 00 00 .*
80822: 00 10 .*
80824: d0 01 mov\.l 8082c <_sexternal@plt\+0x14>,r0 ! 0xc
80826: 51 c2 mov\.l @\(8,r12\),r1
80828: 41 2b jmp @r1
8082a: 00 09 nop
8082c: 00 00 .*
8082e: 00 0c .*
Disassembly of section \.text:
00080c00 <_foo>:
80c00: 2f c6 mov\.l r12,@-r15
80c02: 4f 22 sts\.l pr,@-r15
80c04: dc 0a mov\.l 80c30 <_foo\+0x30>,r12 ! 0x0
80c06: 6c c2 mov\.l @r12,r12
80c08: d0 0a mov\.l 80c34 <_foo\+0x34>,r0 ! 0x0
80c0a: 0c ce mov\.l @\(r0,r12\),r12
80c0c: d0 0a mov\.l 80c38 <_foo\+0x38>,r0 ! 0x14
80c0e: 01 ce mov\.l @\(r0,r12\),r1
80c10: 62 12 mov\.l @r1,r2
80c12: 72 01 add #1,r2
80c14: 21 22 mov\.l r2,@r1
80c16: d0 09 mov\.l 80c3c <_foo\+0x3c>,r0 ! 0x2c
80c18: 00 03 bsrf r0
80c1a: 00 09 nop
80c1c: d0 08 mov\.l 80c40 <_foo\+0x40>,r0 ! 0xfffffbde
80c1e: 00 03 bsrf r0
80c20: 00 09 nop
80c22: d0 08 mov\.l 80c44 <_foo\+0x44>,r0 ! 0xfffffbf0
80c24: 00 03 bsrf r0
80c26: 00 09 nop
80c28: 4f 26 lds\.l @r15\+,pr
80c2a: 00 0b rts
80c2c: 6c f6 mov\.l @r15\+,r12
80c2e: 00 09 nop
...
80c38: 00 00 .*
80c3a: 00 14 .*
80c3c: 00 00 .*
80c3e: 00 2c .*
80c40: ff ff .*
80c42: fb de .*
80c44: ff ff .*
80c46: fb f0 .*
00080c48 <_slocal>:
80c48: 00 0b rts
80c4a: 00 09 nop
00080c4c <_sglobal>:
80c4c: 00 0b rts
80c4e: 00 09 nop

View File

@ -0,0 +1,9 @@
#...
Symbol table '\.dynsym' .*:
#...
.*: 00081400 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
#...
Symbol table '\.symtab' .*:
#...
.*: 00081400 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
#pass

View File

@ -0,0 +1,12 @@
Relocation section '\.rela\.plt' at offset .* contains 2 entries:
Offset Info Type Sym\.Value Sym\. Name \+ Addend
0008140c .*a4 R_SH_JMP_SLOT 00080c4c _sglobal \+ 0
00081410 .*a4 R_SH_JMP_SLOT 00000000 _sexternal \+ 0
Relocation section '\.rela\.dyn' at offset .* contains 4 entries:
Offset Info Type Sym\.Value Sym\. Name \+ Addend
00081c00 000000a5 R_SH_RELATIVE * 00080c48
00080c30 .*01 R_SH_DIR32 00000000 ___GOTT_BASE__ \+ 0
00080c34 .*01 R_SH_DIR32 00000000 ___GOTT_INDEX__ \+ 0
00081414 .*a3 R_SH_GLOB_DAT 00081800 x \+ 0

View File

@ -0,0 +1,61 @@
.text
.globl _foo
.type _foo, %function
_foo:
mov.l r12,@-r15
sts.l pr,@-r15
mov.l 1f,r12
mov.l @r12,r12
mov.l 2f,r0
mov.l @(r0,r12),r12
mov.l 3f,r0
mov.l @(r0,r12),r1
mov.l @r1,r2
add #1,r2
mov.l r2,@r1
mov.l 4f,r0
bsrf r0
nop
.Lb4:
mov.l 5f,r0
bsrf r0
nop
.Lb5:
mov.l 6f,r0
bsrf r0
nop
.Lb6:
lds.l @r15+,pr
rts
mov.l @r15+,r12
.align 2
1: .long ___GOTT_BASE__
2: .long ___GOTT_INDEX__
3: .long x@GOT
4: .long _slocal - .Lb4
5: .long _sglobal@PLT - (.Lb5 - .)
6: .long _sexternal@PLT - (.Lb6 - .)
.size _foo, .-_foo
.type _slocal, %function
_slocal:
rts
nop
.size _slocal, .-_slocal
.globl _sglobal
.type _sglobal, %function
_sglobal:
rts
nop
.size _sglobal, .-_sglobal
.data
.4byte _slocal
.comm x,4,4

View File

@ -0,0 +1,4 @@
#name: VxWorks executable test 1 (static)
#source: vxworks1.s
#ld: tmpdir/libvxworks1.so -Tvxworks1.ld -EL
#error: Dynamic sections created in non-dynamic link

View File

@ -0,0 +1,73 @@
.*: file format .*
Disassembly of section \.plt:
00080800 <_PROCEDURE_LINKAGE_TABLE_>:
80800: d1 01 mov\.l 80808 <_PROCEDURE_LINKAGE_TABLE_\+0x8>,r1 ! 0x81408
80802: 61 12 mov\.l @r1,r1
80804: 41 2b jmp @r1
80806: 00 09 nop
80808: 00 08 .*
80808: R_SH_DIR32 _GLOBAL_OFFSET_TABLE_\+0x8
8080a: 14 08 .*
0008080c <_sglobal@plt>:
8080c: d0 01 mov\.l 80814 <_sglobal@plt\+0x8>,r0 ! 0x8140c
8080e: 60 02 mov\.l @r0,r0
80810: 40 2b jmp @r0
80812: 00 09 nop
80814: 00 08 .*
80814: R_SH_DIR32 _GLOBAL_OFFSET_TABLE_\+0xc
80816: 14 0c .*
80818: d0 01 mov\.l 80820 <_sglobal@plt\+0x14>,r0 ! 0x0
8081a: af f1 bra 80800 <_PROCEDURE_LINKAGE_TABLE_>
8081c: 00 09 nop
8081e: 00 09 nop
80820: 00 00 .*
\.\.\.
00080824 <_foo@plt>:
80824: d0 01 mov\.l 8082c <_foo@plt\+0x8>,r0 ! 0x81410
80826: 60 02 mov\.l @r0,r0
80828: 40 2b jmp @r0
8082a: 00 09 nop
8082c: 00 08 .*
8082c: R_SH_DIR32 _GLOBAL_OFFSET_TABLE_\+0x10
8082e: 14 10 .*
80830: d0 01 mov\.l 80838 <_foo@plt\+0x14>,r0 ! 0xc
80832: af e5 bra 80800 <_PROCEDURE_LINKAGE_TABLE_>
80834: 00 09 nop
80836: 00 09 nop
80838: 00 00 .*
8083a: 00 0c .*
Disassembly of section \.text:
00080c00 <__start>:
80c00: 4f 22 sts\.l pr,@-r15
80c02: d0 06 mov\.l 80c1c <__start\+0x1c>,r0 ! 0x80824 <_foo@plt>
80c04: 40 0b jsr @r0
80c06: 00 09 nop
80c08: d0 05 mov\.l 80c20 <__start\+0x20>,r0 ! 0x8080c <_sglobal@plt>
80c0a: 40 0b jsr @r0
80c0c: 00 09 nop
80c0e: d0 05 mov\.l 80c24 <__start\+0x24>,r0 ! 0x80c28 <_sexternal>
80c10: 40 0b jsr @r0
80c12: 00 09 nop
80c14: 4f 26 lds\.l @r15\+,pr
80c16: 00 0b rts
80c18: 00 09 nop
80c1a: 00 09 nop
80c1c: 00 08 .*
80c1c: R_SH_DIR32 \.plt\+0x24
80c1e: 08 24 .*
80c20: 00 08 .*
80c20: R_SH_DIR32 \.plt\+0xc
80c22: 08 0c .*
80c24: 00 08 .*
80c24: R_SH_DIR32 _sexternal
80c26: 0c 28 .*
00080c28 <_sexternal>:
80c28: 00 0b rts
80c2a: 00 09 nop

View File

@ -0,0 +1,30 @@
SECTIONS
{
. = 0x80000;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
. = ALIGN (0x400);
.rela.dyn : { *(.rela.dyn) }
.rela.plt : { *(.rela.plt) }
. = ALIGN (0x400);
.plt : { *(.plt) }
. = ALIGN (0x400);
.text : { *(.text) }
. = ALIGN (0x1000);
.dynamic : { *(.dynamic) }
. = ALIGN (0x400);
.got : { *(.got.plt) *(.got) }
. = ALIGN (0x400);
.bss : { *(.bss) *(.dynbss) }
. = ALIGN (0x400);
.data : { *(.data) }
}

View File

@ -0,0 +1,19 @@
Relocation section '\.rela\.plt' at offset .* contains 2 entries:
Offset Info Type Sym\.Value Sym\. Name \+ Addend
0008140c .*a4 R_SH_JMP_SLOT 0008080c _sglobal \+ 0
00081410 .*a4 R_SH_JMP_SLOT 00080824 _foo \+ 0
Relocation section '\.rela\.text' at offset .* contains 3 entries:
Offset Info Type Sym.Value Sym. Name \+ Addend
00080c1c .*01 R_SH_DIR32 00080800 \.plt \+ 24
00080c20 .*01 R_SH_DIR32 00080800 \.plt \+ c
00080c24 .*01 R_SH_DIR32 00080c28 _sexternal \+ 0
Relocation section '\.rela\.plt\.unloaded' at offset .* contains 5 entries:
Offset Info Type Sym\.Value Sym\. Name \+ Addend
00080808 .*01 R_SH_DIR32 00081400 _GLOBAL_OFFSET_TABLE_ \+ 8
00080814 .*01 R_SH_DIR32 00081400 _GLOBAL_OFFSET_TABLE_ \+ c
0008140c .*01 R_SH_DIR32 00080800 _PROCEDURE_LINKAGE_TAB.* \+ 0
0008082c .*01 R_SH_DIR32 00081400 _GLOBAL_OFFSET_TABLE_ \+ 10
00081410 .*01 R_SH_DIR32 00080800 _PROCEDURE_LINKAGE_TAB.* \+ 0

View File

@ -0,0 +1,32 @@
.text
.globl __start
.type __start, %function
__start:
sts.l pr,@-r15
mov.l 1f,r0
jsr @r0
nop
mov.l 2f,r0
jsr @r0
nop
mov.l 3f,r0
jsr @r0
nop
lds.l @r15+,pr
rts
nop
.align 2
1: .long _foo
2: .long _sglobal
3: .long _sexternal
.size __start, .-__start
.globl _sexternal
.type _sexternal, %function
_sexternal:
rts
nop
.size _sexternal, .-_sexternal

View File

@ -0,0 +1,9 @@
#...
Elf file type is EXEC \(Executable file\)
Entry point 0x80000
#...
Program Headers:
Type .*
LOAD .* 0x00080000 0x00080000 .* R E 0x1000
#...

View File

@ -0,0 +1,6 @@
.globl __start
.type __start, %function
__start:
rts
nop
.end __start

View File

@ -0,0 +1,13 @@
#...
Elf file type is EXEC \(Executable file\)
Entry point 0x80400
#...
Program Headers:
Type .*
PHDR .*
#...
LOAD .* 0x00080000 0x00080000 .* R E 0x1000
LOAD .* 0x00081000 0x00081000 .* RW 0x1000
DYNAMIC .*
#...

View File

@ -0,0 +1,34 @@
.*: file format .*
Disassembly of section \.plt:
#...
.*: 01 d0 mov\.l .*,r0 ! 0x0
.*: f1 af bra .* <_PROCEDURE_LINKAGE_TABLE_>
.*: 09 00 nop
#...
.*: 01 d0 mov\.l .*,r0 ! 0x7ec
.*: 05 a8 bra .* <_PROCEDURE_LINKAGE_TABLE_>
.*: 09 00 nop
#...
.*: 01 d0 mov\.l .*,r0 ! 0x7f8
.*: f2 af bra .*
.*: 09 00 nop
#...
.*: 01 d0 mov\.l .*,r0 ! 0xfe4
.*: 06 a8 bra .*
.*: 09 00 nop
#...
.*: 01 d0 mov\.l .*,r0 ! 0xff0
.*: f2 af bra .*
.*: 09 00 nop
#...
.*: 01 d0 mov\.l .*,r0 ! 0x17dc
.*: 06 a8 bra .*
.*: 09 00 nop
#...
.*: 01 d0 mov\.l .*,r0 ! 0x17e8
.*: f2 af bra .*
.*: 09 00 nop
#pass

View File

@ -0,0 +1,12 @@
.*: file format .*
Disassembly of section \.text:
.* <foo0>:
.*: 0b 00 rts
.*: 09 00 nop
#...
.* <foo510>:
.*: 0b 00 rts
.*: 09 00 nop

View File

@ -0,0 +1,12 @@
.*: file format .*
Disassembly of section \.text:
.* <foo0>:
.*: 00 0b rts
.*: 00 09 nop
#...
.* <foo510>:
.*: 00 0b rts
.*: 00 09 nop

View File

@ -0,0 +1,12 @@
.macro entry
.globl foo\@
.size foo\@,4
.type foo\@,@function
foo\@:
rts
nop
.endm
.rept 511
entry
.endr

View File

@ -0,0 +1,34 @@
.*: file format .*
Disassembly of section \.plt:
#...
.*: d0 01 mov\.l .*,r0 ! 0x0
.*: af f1 bra .* <_PROCEDURE_LINKAGE_TABLE_>
.*: 00 09 nop
#...
.*: d0 01 mov\.l .*,r0 ! 0x7ec
.*: a8 05 bra .* <_PROCEDURE_LINKAGE_TABLE_>
.*: 00 09 nop
#...
.*: d0 01 mov\.l .*,r0 ! 0x7f8
.*: af f2 bra .*
.*: 00 09 nop
#...
.*: d0 01 mov\.l .*,r0 ! 0xfe4
.*: a8 06 bra .*
.*: 00 09 nop
#...
.*: d0 01 mov\.l .*,r0 ! 0xff0
.*: af f2 bra .*
.*: 00 09 nop
#...
.*: d0 01 mov\.l .*,r0 ! 0x17dc
.*: a8 06 bra .*
.*: 00 09 nop
#...
.*: d0 01 mov\.l .*,r0 ! 0x17e8
.*: af f2 bra .*
.*: 00 09 nop
#pass

View File

@ -0,0 +1,7 @@
.macro entry
.long foo\@
.endm
.rept 511
entry
.endr

View File

@ -0,0 +1,11 @@
#source: vxworks4a.s
#source: vxworks4b.s
#ld: -shared -Tvxworks1.ld
#target: sh-*-vxworks
#readelf: --relocs
Relocation section '\.rela\.dyn' at offset .* contains 3 entries:
Offset Info Type Sym\.Value Sym\. Name \+ Addend
00081810 000000a5 R_SH_RELATIVE 0008181c
00081814 .*01 R_SH_DIR32 00000000 global \+ 1234
00081818 .*02 R_SH_REL32 00000000 global \+ 1234

View File

@ -0,0 +1,2 @@
.data
.fill 0x10

View File

@ -0,0 +1,4 @@
.data
.long . + 0xc
.long global + 0x1234
.long global + 0x1234 - .