diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2011-05-13 18:15:33 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@codesourcery.com> | 2011-05-13 18:15:33 +0000 |
commit | 2a6163793f685ef88ce57aa90fd9da291e64e1b7 (patch) | |
tree | 09c03e1b7ca255472ef658909ae1ad64acf65f5a /ld | |
parent | 01124a23b32e1d40eefe063aa416438d71ba0240 (diff) | |
download | gdb-2a6163793f685ef88ce57aa90fd9da291e64e1b7.zip gdb-2a6163793f685ef88ce57aa90fd9da291e64e1b7.tar.gz gdb-2a6163793f685ef88ce57aa90fd9da291e64e1b7.tar.bz2 |
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.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 16 | ||||
-rw-r--r-- | ld/Makefile.am | 26 | ||||
-rw-r--r-- | ld/Makefile.in | 30 | ||||
-rw-r--r-- | ld/configure.tgt | 9 | ||||
-rw-r--r-- | ld/emulparams/elf32_tic6x_elf_be.sh | 2 | ||||
-rw-r--r-- | ld/emulparams/elf32_tic6x_elf_le.sh | 3 | ||||
-rw-r--r-- | ld/emulparams/elf32_tic6x_linux_be.sh | 2 | ||||
-rw-r--r-- | ld/emulparams/elf32_tic6x_linux_le.sh | 3 | ||||
-rw-r--r-- | ld/emultempl/tic6xdsbt.em | 10 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-tic6x/dsbt.ld | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-tic6x/tic6x.exp | 66 |
12 files changed, 167 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 5f5bf9a..f443ae0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,19 @@ +2011-05-13 Bernd Schmidt <bernds@codesourcery.com> + + (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. + 2011-05-13 Jan Beulich <jbeulich@novell.com> * configure.tgt: Add targets x86_64-*-pe and x86_64-*-pep. diff --git a/ld/Makefile.am b/ld/Makefile.am index a9e76f8..88ea7bc 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -189,6 +189,10 @@ ALL_EMULATION_SOURCES = \ 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 \ @@ -881,11 +885,29 @@ $(srcdir)/emultempl/spu_icache.@OBJEXT@_c: @MAINT@ $(srcdir)/emultempl/spu_icach ../binutils/bin2c <spu_icache.@OBJEXT@ >$@; \ fi eelf32_tic6x_be.c: $(srcdir)/emulparams/elf32_tic6x_be.sh \ - $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(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 ${GEN_DEPENDS} + $(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} diff --git a/ld/Makefile.in b/ld/Makefile.in index 52303f1..31d1dc8 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -495,6 +495,10 @@ ALL_EMULATION_SOURCES = \ 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 \ @@ -1083,7 +1087,11 @@ distclean-compile: @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@ @@ -2324,11 +2332,29 @@ $(srcdir)/emultempl/spu_icache.@OBJEXT@_c: @MAINT@ $(srcdir)/emultempl/spu_icach ../binutils/bin2c <spu_icache.@OBJEXT@ >$@; \ fi eelf32_tic6x_be.c: $(srcdir)/emulparams/elf32_tic6x_be.sh \ - $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(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 ${GEN_DEPENDS} + $(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} diff --git a/ld/configure.tgt b/ld/configure.tgt index 53f9395..5060c68 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -633,8 +633,13 @@ tic30-*-*aout*) targ_emul=tic30aout ;; 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" +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 ;; diff --git a/ld/emulparams/elf32_tic6x_elf_be.sh b/ld/emulparams/elf32_tic6x_elf_be.sh new file mode 100644 index 0000000..a393933 --- /dev/null +++ b/ld/emulparams/elf32_tic6x_elf_be.sh @@ -0,0 +1,2 @@ +. ${srcdir}/emulparams/elf32_tic6x_le.sh +OUTPUT_FORMAT="elf32-tic6x-elf-be" diff --git a/ld/emulparams/elf32_tic6x_elf_le.sh b/ld/emulparams/elf32_tic6x_elf_le.sh new file mode 100644 index 0000000..8c86ee4 --- /dev/null +++ b/ld/emulparams/elf32_tic6x_elf_le.sh @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf32_tic6x_le.sh +OUTPUT_FORMAT="elf32-tic6x-elf-le" +BIG_OUTPUT_FORMAT="elf32-tic6x-elf-be" diff --git a/ld/emulparams/elf32_tic6x_linux_be.sh b/ld/emulparams/elf32_tic6x_linux_be.sh new file mode 100644 index 0000000..3133951 --- /dev/null +++ b/ld/emulparams/elf32_tic6x_linux_be.sh @@ -0,0 +1,2 @@ +. ${srcdir}/emulparams/elf32_tic6x_le.sh +OUTPUT_FORMAT="elf32-tic6x-linux-be" diff --git a/ld/emulparams/elf32_tic6x_linux_le.sh b/ld/emulparams/elf32_tic6x_linux_le.sh new file mode 100644 index 0000000..06defa0 --- /dev/null +++ b/ld/emulparams/elf32_tic6x_linux_le.sh @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf32_tic6x_le.sh +OUTPUT_FORMAT="elf32-tic6x-linux-le" +BIG_OUTPUT_FORMAT="elf32-tic6x-linux-be" diff --git a/ld/emultempl/tic6xdsbt.em b/ld/emultempl/tic6xdsbt.em index d0e345d..e287005 100644 --- a/ld/emultempl/tic6xdsbt.em +++ b/ld/emultempl/tic6xdsbt.em @@ -38,9 +38,17 @@ is_tic6x_target (void) { 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_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. */ diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index ceaafb4..ba0aa43 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-13 Bernd Schmidt <bernds@codesourcery.com> + + * ld-tic6x/dsbt.ld (OUTPUT_FORMAT): Add. + * ld-tic6x/tic6x.exp: Add OSABI tests. + 2011-05-13 Alan Modra <amodra@gmail.com> * ld-elf/flags1.d: Don't xfail tic6x. diff --git a/ld/testsuite/ld-tic6x/dsbt.ld b/ld/testsuite/ld-tic6x/dsbt.ld index fd41608..ff162f3 100644 --- a/ld/testsuite/ld-tic6x/dsbt.ld +++ b/ld/testsuite/ld-tic6x/dsbt.ld @@ -1,3 +1,5 @@ +OUTPUT_FORMAT("elf32-tic6x-le", "elf32-tic6x-le", + "elf32-tic6x-le") EXTERN (__c6xabi_DSBT_BASE); SECTIONS { diff --git a/ld/testsuite/ld-tic6x/tic6x.exp b/ld/testsuite/ld-tic6x/tic6x.exp index 9bcb554..5d7b107 100644 --- a/ld/testsuite/ld-tic6x/tic6x.exp +++ b/ld/testsuite/ld-tic6x/tic6x.exp @@ -112,3 +112,69 @@ set shlibtests { } 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 |