|
1 diff --git a/media/libtheora/lib/arm/arm2gnu.pl b/media/libtheora/lib/arm/arm2gnu.pl |
|
2 --- a/media/libtheora/lib/arm/arm2gnu.pl |
|
3 +++ b/media/libtheora/lib/arm/arm2gnu.pl |
|
4 @@ -1,11 +1,14 @@ |
|
5 #!/usr/bin/perl |
|
6 |
|
7 my $bigend; # little/big endian |
|
8 +my $nxstack; |
|
9 + |
|
10 +$nxstack = 0; |
|
11 |
|
12 eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' |
|
13 if $running_under_some_shell; |
|
14 |
|
15 while ($ARGV[0] =~ /^-/) { |
|
16 $_ = shift; |
|
17 last if /^--/; |
|
18 if (/^-n/) { |
|
19 @@ -77,16 +80,19 @@ while (<>) { |
|
20 if ( /\bMEND\b/ ) { |
|
21 s/\bMEND\b/.endm/; |
|
22 $n=0; |
|
23 } |
|
24 |
|
25 # ".rdata" doesn't work in 'as' version 2.13.2, as it is ".rodata" there. |
|
26 # |
|
27 if ( /\bAREA\b/ ) { |
|
28 + if ( /CODE/ ) { |
|
29 + $nxstack = 1; |
|
30 + } |
|
31 s/^(.+)CODE(.+)READONLY(.*)/ .text/; |
|
32 s/^(.+)DATA(.+)READONLY(.*)/ .section .rdata\n .align 2/; |
|
33 s/^(.+)\|\|\.data\|\|(.+)/ .data\n .align 2/; |
|
34 s/^(.+)\|\|\.bss\|\|(.+)/ .bss/; |
|
35 } |
|
36 |
|
37 s/\|\|\.constdata\$(\d+)\|\|/.L_CONST$1/; # ||.constdata$3|| |
|
38 s/\|\|\.bss\$(\d+)\|\|/.L_BSS$1/; # ||.bss$2|| |
|
39 @@ -263,9 +269,13 @@ while (<>) { |
|
40 } continue { |
|
41 printf ("%s", $_) if $printit; |
|
42 if ($addPadding != 0) |
|
43 { |
|
44 printf (" mov r0,r0\n"); |
|
45 $addPadding = 0; |
|
46 } |
|
47 } |
|
48 - |
|
49 +#If we had a code section, mark that this object doesn't need an executable |
|
50 +# stack. |
|
51 +if ($nxstack) { |
|
52 + printf (" .section\t.note.GNU-stack,\"\",\%\%progbits\n"); |
|
53 +} |