bug752139-r18031.patch 1.4 KB

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