michael@0: diff --git a/media/libtheora/lib/arm/arm2gnu.pl b/media/libtheora/lib/arm/arm2gnu.pl michael@0: --- a/media/libtheora/lib/arm/arm2gnu.pl michael@0: +++ b/media/libtheora/lib/arm/arm2gnu.pl michael@0: @@ -1,11 +1,14 @@ michael@0: #!/usr/bin/perl michael@0: michael@0: my $bigend; # little/big endian michael@0: +my $nxstack; michael@0: + michael@0: +$nxstack = 0; michael@0: michael@0: eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' michael@0: if $running_under_some_shell; michael@0: michael@0: while ($ARGV[0] =~ /^-/) { michael@0: $_ = shift; michael@0: last if /^--/; michael@0: if (/^-n/) { michael@0: @@ -77,16 +80,19 @@ while (<>) { michael@0: if ( /\bMEND\b/ ) { michael@0: s/\bMEND\b/.endm/; michael@0: $n=0; michael@0: } michael@0: michael@0: # ".rdata" doesn't work in 'as' version 2.13.2, as it is ".rodata" there. michael@0: # michael@0: if ( /\bAREA\b/ ) { michael@0: + if ( /CODE/ ) { michael@0: + $nxstack = 1; michael@0: + } michael@0: s/^(.+)CODE(.+)READONLY(.*)/ .text/; michael@0: s/^(.+)DATA(.+)READONLY(.*)/ .section .rdata\n .align 2/; michael@0: s/^(.+)\|\|\.data\|\|(.+)/ .data\n .align 2/; michael@0: s/^(.+)\|\|\.bss\|\|(.+)/ .bss/; michael@0: } michael@0: michael@0: s/\|\|\.constdata\$(\d+)\|\|/.L_CONST$1/; # ||.constdata$3|| michael@0: s/\|\|\.bss\$(\d+)\|\|/.L_BSS$1/; # ||.bss$2|| michael@0: @@ -263,9 +269,13 @@ while (<>) { michael@0: } continue { michael@0: printf ("%s", $_) if $printit; michael@0: if ($addPadding != 0) michael@0: { michael@0: printf (" mov r0,r0\n"); michael@0: $addPadding = 0; michael@0: } michael@0: } michael@0: - michael@0: +#If we had a code section, mark that this object doesn't need an executable michael@0: +# stack. michael@0: +if ($nxstack) { michael@0: + printf (" .section\t.note.GNU-stack,\"\",\%\%progbits\n"); michael@0: +}