From: Petar Jovanovic Date: Mon, 21 Jan 2013 01:01:13 +0000 (+0000) Subject: mips: fix link_tool_exe_linux issue for different mips architectures X-Git-Tag: svn/VALGRIND_3_9_0~432 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8e5546b8148ccd10cbf8fb497552d2ad4b9d22b;p=thirdparty%2Fvalgrind.git mips: fix link_tool_exe_linux issue for different mips architectures One issue has been reported on the mailing list by Ilya Smelykh, and the second issue has been found in development for MIPS64. The change modifies the way we detect target-arch by reading host_cpu from config.log rather than asking the toolchain. Also, for MIPS64, we use: --section-start=.MIPS.options=$ala while for o32 we still use: --section-start=.reginfo=$ala git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13249 --- diff --git a/coregrind/link_tool_exe_linux.in b/coregrind/link_tool_exe_linux.in index 191099f2d6..fe50d00ca6 100644 --- a/coregrind/link_tool_exe_linux.in +++ b/coregrind/link_tool_exe_linux.in @@ -66,16 +66,19 @@ shift; # Remove $ala from @ARGV die "Bogus alt-load address" if (length($ala) < 3 || index($ala, "0x") != 0); -# For mips we need to use "--section-start=.reginfo=$ala" because -# "--section-start=.reginfo=$ala" will put all the sections to the -# specificed address ($ala) -my $orig_cmd = join(" ", @ARGV); -my $x=`$orig_cmd -v 2>&1 | grep Target | sed 's/Target: //g'`; -my $arch=substr($x, 0, index($x, '-')); +# For mips32 or mips64 we need to use "--section-start=.reginfo=$ala" or +# "--section-start=.MIPS.options=$ala" respectively, because "-Ttext=$ala" will +# not put all the sections to the specificed address ($ala). +my $x = `cat ../config.log 2>&1 | grep host_cpu= | sed "s/host_cpu='//g"`; +my $arch = substr($x, 0, index($x, "'")); my $extra_args; -if (($arch eq 'mips') || ($arch eq 'mipsel')) { +if (($arch eq 'mips') || ($arch eq 'mipsel') + || ($arch eq 'mipsisa32r2el')) { $extra_args = "-static -Wl,--section-start=.reginfo=$ala"; +} elsif (($arch eq 'mips64') || ($arch eq 'mips64el') || + ($arch eq 'mipsisa64el')) { + $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala"; } else { $extra_args = "-static -Wl,-Ttext=$ala"; }