ld/ (eelf32_tic6x_linux_be.c, eelf32_tic6x_linux_le.c, eelf32_tic6x_elf_be.c, eelf32_tic6x_elf_le.c): New rules. * Makefile.am (ALL_EMULATIONS): Add these files. (eelf32_tic6x_be.c, eelf32_tic6x_le.c): Depend on tic6xdsbt.em. * Makefile.in: Regenerated. * emultempl/tic6xdsbt.em (is_tic6x_target): Allow more tic6x target vectors. * emulparams/elf32_tic6x_elf_be.sh: New file. * emulparams/elf32_tic6x_elf_le.sh: New file. * emulparams/elf32_tic6x_linux_be.sh: New file. * emulparams/elf32_tic6x_linux_le.sh: New file. * configure.tgt (tic6x-*-elf, tic6x-*-uclinux): New. (tic6x-*-*): Replaced by these. ld/testsuite/ * ld-tic6x/dsbt.ld (OUTPUT_FORMAT): Add. * ld-tic6x/tic6x.exp: Add OSABI tests. bfd/ * config.bfd (tic6x-*-elf, tic6x-*-uclinux): New. (tic6x-*-*): Replaced by these. * elf32-tic6x.c (elf32_tic6x_set_osabi): New static function. (elf32_tic6x_check_relocs): Create dynamic sections if -shared. (elf_backend_relocs_compatible, elf_backend_post_process_headers): Define. (elf32_bed, TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM, TARGET_BIG_NAME, ELF_OSABI): Redefine twice, and include "elf32-target.h" two more times. * configure.in: Handle bfd_elf32_tic6x_linux_be_vec, bfd_elf32_tic6x_linux_le_vec, bfd_elf32_tic6x_elf_be_vec and bfd_elf32_tic6x_elf_le_vec. * configure: Regenerate. Index: bfd/config.bfd =================================================================== RCS file: /cvs/src/src/bfd/config.bfd,v retrieving revision 1.278 diff -c -p -r1.278 config.bfd *** bfd/config.bfd 20 Apr 2011 14:10:17 -0000 1.278 --- bfd/config.bfd 12 May 2011 21:37:09 -0000 *************** case "${targ}" in *** 1465,1473 **** ;; #endif ! tic6x-*-*) ! targ_defvec=bfd_elf32_tic6x_le_vec ! targ_selvecs=bfd_elf32_tic6x_be_vec ;; tic80*-*-*) --- 1465,1478 ---- ;; #endif ! tic6x-*-elf) ! targ_defvec=bfd_elf32_tic6x_elf_le_vec ! targ_selvecs="bfd_elf32_tic6x_elf_be_vec bfd_elf32_tic6x_le_vec bfd_elf32_tic6x_be_vec" ! ;; ! ! tic6x-*-uclinux) ! targ_defvec=bfd_elf32_tic6x_linux_le_vec ! targ_selvecs="bfd_elf32_tic6x_linux_be_vec bfd_elf32_tic6x_le_vec bfd_elf32_tic6x_be_vec" ;; tic80*-*-*) Index: bfd/configure =================================================================== RCS file: /cvs/src/src/bfd/configure,v retrieving revision 1.345 diff -c -p -r1.345 configure *** bfd/configure 12 May 2011 07:41:40 -0000 1.345 --- bfd/configure 12 May 2011 21:37:11 -0000 *************** do *** 15293,15298 **** --- 15293,15302 ---- bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; bfd_elf32_tic6x_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; bfd_elf32_tic6x_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_elf_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_elf_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec | bfd_elf32_tradbigmips_freebsd_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec | bfd_elf32_tradlittlemips_freebsd_vec) Index: bfd/configure.in =================================================================== RCS file: /cvs/src/src/bfd/configure.in,v retrieving revision 1.292 diff -c -p -r1.292 configure.in *** bfd/configure.in 12 May 2011 07:41:42 -0000 1.292 --- bfd/configure.in 12 May 2011 21:37:11 -0000 *************** do *** 792,797 **** --- 792,801 ---- bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; bfd_elf32_tic6x_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; bfd_elf32_tic6x_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_elf_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + bfd_elf32_tic6x_elf_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec | bfd_elf32_tradbigmips_freebsd_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec | bfd_elf32_tradlittlemips_freebsd_vec) Index: bfd/elf32-tic6x.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-tic6x.c,v retrieving revision 1.22 diff -c -p -r1.22 elf32-tic6x.c *** bfd/elf32-tic6x.c 9 May 2011 13:23:24 -0000 1.22 --- bfd/elf32-tic6x.c 12 May 2011 21:37:11 -0000 *************** elf32_tic6x_check_relocs (bfd *abfd, str *** 2764,2770 **** /* Create dynamic sections for relocatable executables so that we can copy relocations. */ ! if (elf32_tic6x_using_dsbt (abfd) && ! htab->elf.dynamic_sections_created) { if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) --- 2764,2770 ---- /* Create dynamic sections for relocatable executables so that we can copy relocations. */ ! if ((info->shared || elf32_tic6x_using_dsbt (abfd)) && ! htab->elf.dynamic_sections_created) { if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) *************** elf32_tic6x_write_section (bfd *output_b *** 4439,4444 **** --- 4439,4452 ---- return TRUE; } + static void + elf32_tic6x_set_osabi (bfd *abfd, struct bfd_link_info *link_info) + { + if (link_info == NULL || link_info->relocatable) + return; + _bfd_elf_set_osabi (abfd, link_info); + } + #define TARGET_LITTLE_SYM bfd_elf32_tic6x_le_vec #define TARGET_LITTLE_NAME "elf32-tic6x-le" #define TARGET_BIG_SYM bfd_elf32_tic6x_be_vec *************** elf32_tic6x_write_section (bfd *output_b *** 4488,4493 **** --- 4496,4502 ---- #define elf_backend_section_from_bfd_section \ elf32_tic6x_section_from_bfd_section #define elf_backend_relocate_section elf32_tic6x_relocate_section + #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible #define elf_backend_finish_dynamic_symbol \ elf32_tic6x_finish_dynamic_symbol #define elf_backend_always_size_sections \ *************** elf32_tic6x_write_section (bfd *output_b *** 4506,4510 **** --- 4515,4556 ---- #define elf_backend_omit_section_dynsym elf32_tic6x_link_omit_section_dynsym #define elf_backend_plt_sym_val elf32_tic6x_plt_sym_val + #include "elf32-target.h" + + #undef elf32_bed + #define elf32_bed elf32_tic6x_linux_bed + + #undef TARGET_LITTLE_SYM + #define TARGET_LITTLE_SYM bfd_elf32_tic6x_linux_le_vec + #undef TARGET_LITTLE_NAME + #define TARGET_LITTLE_NAME "elf32-tic6x-linux-le" + #undef TARGET_BIG_SYM + #define TARGET_BIG_SYM bfd_elf32_tic6x_linux_be_vec + #undef TARGET_BIG_NAME + #define TARGET_BIG_NAME "elf32-tic6x-linux-be" + #undef ELF_OSABI + #define ELF_OSABI ELFOSABI_C6000_LINUX + + #undef elf_backend_post_process_headers + #define elf_backend_post_process_headers elf32_tic6x_set_osabi + + #include "elf32-target.h" + + #undef elf32_bed + #define elf32_bed elf32_tic6x_elf_bed + + #undef TARGET_LITTLE_SYM + #define TARGET_LITTLE_SYM bfd_elf32_tic6x_elf_le_vec + #undef TARGET_LITTLE_NAME + #define TARGET_LITTLE_NAME "elf32-tic6x-elf-le" + #undef TARGET_BIG_SYM + #define TARGET_BIG_SYM bfd_elf32_tic6x_elf_be_vec + #undef TARGET_BIG_NAME + #define TARGET_BIG_NAME "elf32-tic6x-elf-be" + #undef ELF_OSABI + #define ELF_OSABI ELFOSABI_C6000_ELFABI + + #undef elf_backend_post_process_headers + #define elf_backend_post_process_headers elf32_tic6x_set_osabi #include "elf32-target.h" Index: bfd/targets.c =================================================================== RCS file: /cvs/src/src/bfd/targets.c,v retrieving revision 1.198 diff -c -p -r1.198 targets.c *** bfd/targets.c 31 Dec 2010 11:00:53 -0000 1.198 --- bfd/targets.c 12 May 2011 21:37:11 -0000 *************** extern const bfd_target bfd_elf32_sparc_ *** 683,688 **** --- 683,692 ---- extern const bfd_target bfd_elf32_spu_vec; extern const bfd_target bfd_elf32_tic6x_be_vec; extern const bfd_target bfd_elf32_tic6x_le_vec; + extern const bfd_target bfd_elf32_tic6x_elf_be_vec; + extern const bfd_target bfd_elf32_tic6x_elf_le_vec; + extern const bfd_target bfd_elf32_tic6x_linux_be_vec; + extern const bfd_target bfd_elf32_tic6x_linux_le_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; extern const bfd_target bfd_elf32_tradbigmips_freebsd_vec; Index: ld/Makefile.am =================================================================== RCS file: /cvs/src/src/ld/Makefile.am,v retrieving revision 1.300 diff -c -p -r1.300 Makefile.am *** ld/Makefile.am 22 Mar 2011 18:10:46 -0000 1.300 --- ld/Makefile.am 12 May 2011 21:37:13 -0000 *************** ALL_EMULATION_SOURCES = \ *** 189,194 **** --- 189,198 ---- eelf32_spu.c \ eelf32_tic6x_be.c \ eelf32_tic6x_le.c \ + eelf32_tic6x_linux_be.c \ + eelf32_tic6x_linux_le.c \ + eelf32_tic6x_elf_be.c \ + eelf32_tic6x_elf_le.c \ eelf32b4300.c \ eelf32bfin.c \ eelf32bfinfd.c \ *************** $(srcdir)/emultempl/spu_icache.@OBJEXT@_ *** 881,891 **** ../binutils/bin2c $@; \ fi eelf32_tic6x_be.c: $(srcdir)/emulparams/elf32_tic6x_be.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_be "$(tdir_elf32_tic6x_be)" eelf32_tic6x_le.c: $(srcdir)/emulparams/elf32_tic6x_le.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_le "$(tdir_elf32_tic6x_le)" eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \ $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \ $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} --- 885,913 ---- ../binutils/bin2c $@; \ fi eelf32_tic6x_be.c: $(srcdir)/emulparams/elf32_tic6x_be.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ ! ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_be "$(tdir_elf32_tic6x_be)" eelf32_tic6x_le.c: $(srcdir)/emulparams/elf32_tic6x_le.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ ! ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_le "$(tdir_elf32_tic6x_le)" + eelf32_tic6x_linux_be.c: $(srcdir)/emulparams/elf32_tic6x_linux_be.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_linux_be "$(tdir_elf32_tic6x_linux_be)" + eelf32_tic6x_linux_le.c: $(srcdir)/emulparams/elf32_tic6x_linux_le.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_linux_le "$(tdir_elf32_tic6x_linux_le)" + eelf32_tic6x_elf_be.c: $(srcdir)/emulparams/elf32_tic6x_elf_be.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_elf_be "$(tdir_elf32_tic6x_elf_be)" + eelf32_tic6x_elf_le.c: $(srcdir)/emulparams/elf32_tic6x_elf_le.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_elf_le "$(tdir_elf32_tic6x_elf_le)" eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \ $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \ $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} Index: ld/Makefile.in =================================================================== RCS file: /cvs/src/src/ld/Makefile.in,v retrieving revision 1.327 diff -c -p -r1.327 Makefile.in *** ld/Makefile.in 7 Apr 2011 13:39:00 -0000 1.327 --- ld/Makefile.in 12 May 2011 21:37:13 -0000 *************** ALL_EMULATION_SOURCES = \ *** 495,500 **** --- 495,504 ---- eelf32_spu.c \ eelf32_tic6x_be.c \ eelf32_tic6x_le.c \ + eelf32_tic6x_linux_be.c \ + eelf32_tic6x_linux_le.c \ + eelf32_tic6x_elf_be.c \ + eelf32_tic6x_elf_le.c \ eelf32b4300.c \ eelf32bfin.c \ eelf32bfinfd.c \ *************** distclean-compile: *** 1083,1089 **** --- 1087,1097 ---- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_sparc_vxworks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_spu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_be.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_elf_be.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_elf_le.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_le.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_linux_be.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_linux_le.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_x86_64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32b4300.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32bfin.Po@am__quote@ *************** $(srcdir)/emultempl/spu_icache.@OBJEXT@_ *** 2324,2334 **** ../binutils/bin2c $@; \ fi eelf32_tic6x_be.c: $(srcdir)/emulparams/elf32_tic6x_be.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_be "$(tdir_elf32_tic6x_be)" eelf32_tic6x_le.c: $(srcdir)/emulparams/elf32_tic6x_le.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_le "$(tdir_elf32_tic6x_le)" eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \ $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \ $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} --- 2332,2360 ---- ../binutils/bin2c $@; \ fi eelf32_tic6x_be.c: $(srcdir)/emulparams/elf32_tic6x_be.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ ! ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_be "$(tdir_elf32_tic6x_be)" eelf32_tic6x_le.c: $(srcdir)/emulparams/elf32_tic6x_le.sh \ ! $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ ! ${GEN_DEPENDS} ${GENSCRIPTS} elf32_tic6x_le "$(tdir_elf32_tic6x_le)" + eelf32_tic6x_linux_be.c: $(srcdir)/emulparams/elf32_tic6x_linux_be.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_linux_be "$(tdir_elf32_tic6x_linux_be)" + eelf32_tic6x_linux_le.c: $(srcdir)/emulparams/elf32_tic6x_linux_le.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_linux_le "$(tdir_elf32_tic6x_linux_le)" + eelf32_tic6x_elf_be.c: $(srcdir)/emulparams/elf32_tic6x_elf_be.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_elf_be "$(tdir_elf32_tic6x_elf_be)" + eelf32_tic6x_elf_le.c: $(srcdir)/emulparams/elf32_tic6x_elf_le.sh \ + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/tic6xdsbt.em \ + ${GEN_DEPENDS} + ${GENSCRIPTS} elf32_tic6x_elf_le "$(tdir_elf32_tic6x_elf_le)" eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \ $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \ $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} Index: ld/configure.tgt =================================================================== RCS file: /cvs/src/src/ld/configure.tgt,v retrieving revision 1.245 diff -c -p -r1.245 configure.tgt *** ld/configure.tgt 8 Apr 2011 16:05:12 -0000 1.245 --- ld/configure.tgt 12 May 2011 21:37:13 -0000 *************** tic30-*-*aout*) targ_emul=tic30aout ;; *** 630,637 **** tic30-*-*coff*) targ_emul=tic30coff ;; tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;; tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;; ! tic6x-*-*) targ_emul=elf32_tic6x_le ! targ_extra_emuls="elf32_tic6x_be" ;; tic80-*-*) targ_emul=tic80coff ;; --- 630,642 ---- tic30-*-*coff*) targ_emul=tic30coff ;; tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;; tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;; ! tic6x-*-elf) targ_emul=elf32_tic6x_elf_le ! targ_extra_emuls="elf32_tic6x_elf_be elf32_tic6x_le elf32_tic6x_be" ! targ_extra_libpath=$targ_extra_emuls ! ;; ! tic6x-*-uclinux) targ_emul=elf32_tic6x_linux_le ! targ_extra_emuls="elf32_tic6x_linux_be elf32_tic6x_le elf32_tic6x_be" ! targ_extra_libpath=$targ_extra_emuls ;; tic80-*-*) targ_emul=tic80coff ;; Index: ld/emulparams/elf32_tic6x_elf_be.sh =================================================================== RCS file: ld/emulparams/elf32_tic6x_elf_be.sh diff -N ld/emulparams/elf32_tic6x_elf_be.sh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- ld/emulparams/elf32_tic6x_elf_be.sh 12 May 2011 21:37:13 -0000 *************** *** 0 **** --- 1,2 ---- + . ${srcdir}/emulparams/elf32_tic6x_le.sh + OUTPUT_FORMAT="elf32-tic6x-elf-be" Index: ld/emulparams/elf32_tic6x_elf_le.sh =================================================================== RCS file: ld/emulparams/elf32_tic6x_elf_le.sh diff -N ld/emulparams/elf32_tic6x_elf_le.sh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- ld/emulparams/elf32_tic6x_elf_le.sh 12 May 2011 21:37:13 -0000 *************** *** 0 **** --- 1,3 ---- + . ${srcdir}/emulparams/elf32_tic6x_le.sh + OUTPUT_FORMAT="elf32-tic6x-elf-le" + BIG_OUTPUT_FORMAT="elf32-tic6x-elf-be" Index: ld/emulparams/elf32_tic6x_linux_be.sh =================================================================== RCS file: ld/emulparams/elf32_tic6x_linux_be.sh diff -N ld/emulparams/elf32_tic6x_linux_be.sh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- ld/emulparams/elf32_tic6x_linux_be.sh 12 May 2011 21:37:13 -0000 *************** *** 0 **** --- 1,2 ---- + . ${srcdir}/emulparams/elf32_tic6x_le.sh + OUTPUT_FORMAT="elf32-tic6x-linux-be" Index: ld/emulparams/elf32_tic6x_linux_le.sh =================================================================== RCS file: ld/emulparams/elf32_tic6x_linux_le.sh diff -N ld/emulparams/elf32_tic6x_linux_le.sh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- ld/emulparams/elf32_tic6x_linux_le.sh 12 May 2011 21:37:13 -0000 *************** *** 0 **** --- 1,3 ---- + . ${srcdir}/emulparams/elf32_tic6x_le.sh + OUTPUT_FORMAT="elf32-tic6x-linux-le" + BIG_OUTPUT_FORMAT="elf32-tic6x-linux-be" Index: ld/emultempl/tic6xdsbt.em =================================================================== RCS file: /cvs/src/src/ld/emultempl/tic6xdsbt.em,v retrieving revision 1.2 diff -c -p -r1.2 tic6xdsbt.em *** ld/emultempl/tic6xdsbt.em 9 May 2011 13:23:25 -0000 1.2 --- ld/emultempl/tic6xdsbt.em 12 May 2011 21:37:13 -0000 *************** is_tic6x_target (void) *** 38,46 **** { extern const bfd_target bfd_elf32_tic6x_le_vec; extern const bfd_target bfd_elf32_tic6x_be_vec; return (link_info.output_bfd->xvec == &bfd_elf32_tic6x_le_vec ! || link_info.output_bfd->xvec == &bfd_elf32_tic6x_be_vec); } /* Pass params to backend. */ --- 38,54 ---- { extern const bfd_target bfd_elf32_tic6x_le_vec; extern const bfd_target bfd_elf32_tic6x_be_vec; + extern const bfd_target bfd_elf32_tic6x_linux_le_vec; + extern const bfd_target bfd_elf32_tic6x_linux_be_vec; + extern const bfd_target bfd_elf32_tic6x_elf_le_vec; + extern const bfd_target bfd_elf32_tic6x_elf_be_vec; return (link_info.output_bfd->xvec == &bfd_elf32_tic6x_le_vec ! || link_info.output_bfd->xvec == &bfd_elf32_tic6x_be_vec ! || link_info.output_bfd->xvec == &bfd_elf32_tic6x_linux_le_vec ! || link_info.output_bfd->xvec == &bfd_elf32_tic6x_linux_be_vec ! || link_info.output_bfd->xvec == &bfd_elf32_tic6x_elf_le_vec ! || link_info.output_bfd->xvec == &bfd_elf32_tic6x_elf_be_vec); } /* Pass params to backend. */ Index: ld/testsuite/ld-tic6x/dsbt.ld =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-tic6x/dsbt.ld,v retrieving revision 1.1 diff -c -p -r1.1 dsbt.ld *** ld/testsuite/ld-tic6x/dsbt.ld 31 Mar 2011 08:58:28 -0000 1.1 --- ld/testsuite/ld-tic6x/dsbt.ld 12 May 2011 21:37:14 -0000 *************** *** 1,3 **** --- 1,5 ---- + OUTPUT_FORMAT("elf32-tic6x-le", "elf32-tic6x-le", + "elf32-tic6x-le") EXTERN (__c6xabi_DSBT_BASE); SECTIONS { Index: ld/testsuite/ld-tic6x/tic6x.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-tic6x/tic6x.exp,v retrieving revision 1.2 diff -c -p -r1.2 tic6x.exp *** ld/testsuite/ld-tic6x/tic6x.exp 31 Mar 2011 08:58:28 -0000 1.2 --- ld/testsuite/ld-tic6x/tic6x.exp 12 May 2011 21:37:14 -0000 *************** set shlibtests { *** 112,114 **** --- 112,180 ---- } run_ld_link_tests $shlibtests + + if { [istarget tic6x-*-elf] } { + set expected_osabi "Bare-metal C6000" + } elseif { [istarget tic6x-*-uclinux] } { + set expected_osabi "Linux C6000" + } else { + return + } + + if { ![ld_assemble_flags $as "-mpic -mpid=near" $srcdir/$subdir/shlib-1.s tmpdir/shlib-1.o] + || ![ld_assemble_flags $as "-mpic -mpid=near" $srcdir/$subdir/shlib-2.s tmpdir/shlib-2.o] + || ![ld_assemble $as $srcdir/$subdir/shlib-app-1.s tmpdir/shlib-app-1.o] + || ![ld_assemble_flags $as "-mpic -mpid=near -mbig-endian" $srcdir/$subdir/shlib-1.s tmpdir/shlib-1b.o] + || ![ld_assemble_flags $as "-mpic -mpid=near -mbig-endian" $srcdir/$subdir/shlib-2.s tmpdir/shlib-2b.o] + || ![ld_assemble_flags $as -mbig-endian $srcdir/$subdir/shlib-app-1.s tmpdir/shlib-app-1b.o] + || ![ld_simple_link $ld tmpdir/libtest.so "-shared tmpdir/shlib-1.o tmpdir/shlib-2.o"] + || ![ld_simple_link $ld tmpdir/libtestb.so "-shared -EB tmpdir/shlib-1b.o tmpdir/shlib-2b.o"] + || ![ld_simple_link $ld tmpdir/shlib.o "-r tmpdir/shlib-1.o tmpdir/shlib-2.o"] + || ![ld_simple_link $ld tmpdir/shlibb.o "-r -EB tmpdir/shlib-1b.o tmpdir/shlib-2b.o"] + || ![ld_simple_link $ld tmpdir/dynapp-1 "tmpdir/libtest.so tmpdir/shlib-app-1.o"] + || ![ld_simple_link $ld tmpdir/dynapp-1b "-EB tmpdir/libtestb.so tmpdir/shlib-app-1b.o"] } { + unresolved "TIC6X OSABI tests" + return + } + + # A procedure to check the OS/ABI field in the ELF header of a binary file. + proc check_osabi_tic6x { test_name binary_file } { + global READELF + global READELFFLAGS + global expected_osabi + + set cmd "$READELF $READELFFLAGS --file-header $binary_file" + send_log "$cmd\n" + set got [remote_exec host [concat sh -c [list "$cmd >dump.out"]] "" "/dev/null"] + + if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { + send_log "$got\n" + unresolved "$test_name" + remote_file build delete "dump.out" + return + } + remote_upload host "dump.out" + + if { ![regexp "\n\[ \]*OS/ABI:\[ \]*(.+)\n\[ \]*ABI" \ + [file_contents dump.out] nil osabi] } { + verbose "proc check_osabi_tic6x: Readelf failed to extract an ELF header from $binary_file" + unresolved "$test_name" + } elseif { $osabi == $expected_osabi } { + pass "$test_name" + } else { + verbose "Expected OSABI: $expected_osabi, Obtained osabi: $osabi" + fail "$test_name" + } + remote_file build delete "dump.out" + remote_file host delete "dump.out" + } + + check_osabi_tic6x "C6X shared library OSABI, LE" tmpdir/libtest.so + check_osabi_tic6x "C6X shared library OSABI, BE" tmpdir/libtestb.so + check_osabi_tic6x "C6X dynamic app OSABI, LE" tmpdir/dynapp-1 + check_osabi_tic6x "C6X dynamic app OSABI, BE" tmpdir/dynapp-1b + + set expected_osabi "UNIX - System V" + + check_osabi_tic6x "C6X relocatable link OSABI, LE" tmpdir/shlib.o + check_osabi_tic6x "C6X relocatable link OSABI, BE" tmpdir/shlibb.o