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