OLD | NEW |
1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
2 # Copyright (C) 2002-2013 Xiph.org Foundation | 2 # Copyright (C) 2002-2013 Xiph.org Foundation |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions | 5 # modification, are permitted provided that the following conditions |
6 # are met: | 6 # are met: |
7 # | 7 # |
8 # - Redistributions of source code must retain the above copyright | 8 # - Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # | 10 # |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 s/\bCODE16\b/.code 16/ && do {$thumb = 1}; | 157 s/\bCODE16\b/.code 16/ && do {$thumb = 1}; |
158 if (/\bPROC\b/) | 158 if (/\bPROC\b/) |
159 { | 159 { |
160 my $prefix; | 160 my $prefix; |
161 my $proc; | 161 my $proc; |
162 /^([A-Za-z_\.]\w+)\b/; | 162 /^([A-Za-z_\.]\w+)\b/; |
163 $proc = $1; | 163 $proc = $1; |
164 $prefix = ""; | 164 $prefix = ""; |
165 if ($proc) | 165 if ($proc) |
166 { | 166 { |
167 $prefix = $prefix.sprintf("\t.type\t%s, %%function; ",$proc) unless
($apple); | 167 $prefix = $prefix.sprintf("\t.type\t%s, %%function", $proc) unless (
$apple); |
168 # Make sure we $prefix isn't empty here (for the $apple case). | 168 # Make sure we $prefix isn't empty here (for the $apple case). |
169 # We handle mangling the label here, make sure it doesn't match | 169 # We handle mangling the label here, make sure it doesn't match |
170 # the label handling below (if $prefix would be empty). | 170 # the label handling below (if $prefix would be empty). |
171 $prefix = "; "; | 171 $prefix = $prefix."; "; |
172 push(@proc_stack, $proc); | 172 push(@proc_stack, $proc); |
173 s/^[A-Za-z_\.]\w+/$symprefix$&:/; | 173 s/^[A-Za-z_\.]\w+/$symprefix$&:/; |
174 } | 174 } |
175 $prefix = $prefix."\t.thumb_func; " if ($thumb); | 175 $prefix = $prefix."\t.thumb_func; " if ($thumb); |
176 s/\bPROC\b/@ $&/; | 176 s/\bPROC\b/@ $&/; |
177 $_ = $prefix.$_; | 177 $_ = $prefix.$_; |
178 } | 178 } |
179 s/^(\s*)(S|Q|SH|U|UQ|UH)ASX\b/$1$2ADDSUBX/; | 179 s/^(\s*)(S|Q|SH|U|UQ|UH)ASX\b/$1$2ADDSUBX/; |
180 s/^(\s*)(S|Q|SH|U|UQ|UH)SAX\b/$1$2SUBADDX/; | 180 s/^(\s*)(S|Q|SH|U|UQ|UH)SAX\b/$1$2SUBADDX/; |
181 if (/\bENDP\b/) | 181 if (/\bENDP\b/) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 { | 344 { |
345 printf (" mov r0,r0\n"); | 345 printf (" mov r0,r0\n"); |
346 $addPadding = 0; | 346 $addPadding = 0; |
347 } | 347 } |
348 } | 348 } |
349 #If we had a code section, mark that this object doesn't need an executable | 349 #If we had a code section, mark that this object doesn't need an executable |
350 # stack. | 350 # stack. |
351 if ($nxstack && !$apple) { | 351 if ($nxstack && !$apple) { |
352 printf (" .section\t.note.GNU-stack,\"\",\%\%progbits\n"); | 352 printf (" .section\t.note.GNU-stack,\"\",\%\%progbits\n"); |
353 } | 353 } |
OLD | NEW |