Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | Debian fix for MIPS: mmap(0x400000, 32768) failed in UME with error 22 (Invalid argument) |
| 2 | |
| 3 | https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777704 |
| 4 | |
| 5 | Upstream-Status: Pending |
| 6 | |
| 7 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> |
| 8 | |
| 9 | |
| 10 | Description: Disable the MIPS linker workarounds when using -Ttext-section |
| 11 | Origin: vendor |
| 12 | Bug-Debian: http://bugs.debian.org/777704 |
| 13 | Author: James Cowgill <james410@cowgill.org.uk> |
| 14 | Last-Update: 2015-04-25 |
| 15 | |
| 16 | --- a/coregrind/link_tool_exe_linux.in |
| 17 | +++ b/coregrind/link_tool_exe_linux.in |
| 18 | @@ -76,12 +76,13 @@ |
| 19 | my $arch = substr($x, 0, index($x, "'")); |
| 20 | |
| 21 | my $extra_args; |
| 22 | -if (($arch eq 'mips') || ($arch eq 'mipsel') |
| 23 | - || ($arch eq 'mipsisa32r2el')) { |
| 24 | - $extra_args = "-static -Wl,--section-start=.reginfo=$ala"; |
| 25 | -} elsif (($arch eq 'mips64') || ($arch eq 'mips64el') || |
| 26 | - ($arch eq 'mipsisa64el')) { |
| 27 | - $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala"; |
| 28 | +if ($arch =~ /^mips/ && "@FLAG_T_TEXT@" eq '-Ttext') { |
| 29 | + # We only need to use the special mips options when using -Ttext |
| 30 | + if ($arch =~ /^mips(64|isa64)/) { |
| 31 | + $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala"; |
| 32 | + } else { |
| 33 | + $extra_args = "-static -Wl,--section-start=.reginfo=$ala"; |
| 34 | + } |
| 35 | } else { |
| 36 | $extra_args = "-static -Wl,@FLAG_T_TEXT@=$ala"; |
| 37 | } |