[xiph-commits] r18031 - in trunk/theora/lib: . arm
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Wed Jul 13 13:28:35 PDT 2011
Author: tterribe
Date: 2011-07-13 13:28:34 -0700 (Wed, 13 Jul 2011)
New Revision: 18031
Modified:
trunk/theora/lib/Makefile.am
trunk/theora/lib/arm/arm2gnu.pl
Log:
Clean up some ARM asm issues.
1) Allow specification of the section alignment and make the
default alignment 4 bytes (like the RVCT manual says it should
be).
This ensures that linking our ARM asm into a Thumb executable
won't get the section placed on a 2-byte boundary.
2) Add a linker hint to indicate we don't need an executable stack.
Otherwise it assumes we do.
3) Stop building and linking to an (empty) armopts object file.
This is needed to make 2) work, since we include this file, so
we can't add the linker hint at the end of it, and linking in
just one object without that hint makes the whole library ask
for an executable stack.
Modified: trunk/theora/lib/Makefile.am
===================================================================
--- trunk/theora/lib/Makefile.am 2011-07-11 16:58:24 UTC (rev 18030)
+++ trunk/theora/lib/Makefile.am 2011-07-13 20:28:34 UTC (rev 18031)
@@ -83,7 +83,6 @@
armfrag-gnu.S \
armidct-gnu.S \
armloop-gnu.S \
- armopts-gnu.S \
arm/armcpu.c \
arm/armstate.c
@@ -166,8 +165,7 @@
armbits-gnu.S \
armfrag-gnu.S \
armidct-gnu.S \
- armloop-gnu.S \
- armopts-gnu.S
+ armloop-gnu.S
decoder_c64x_sources = \
c64x/c64xdec.c \
Modified: trunk/theora/lib/arm/arm2gnu.pl
===================================================================
--- trunk/theora/lib/arm/arm2gnu.pl 2011-07-11 16:58:24 UTC (rev 18030)
+++ trunk/theora/lib/arm/arm2gnu.pl 2011-07-13 20:28:34 UTC (rev 18031)
@@ -1,7 +1,10 @@
#!/usr/bin/perl
my $bigend; # little/big endian
+my $nxstack;
+$nxstack = 0;
+
eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
@@ -83,10 +86,19 @@
# ".rdata" doesn't work in 'as' version 2.13.2, as it is ".rodata" there.
#
if ( /\bAREA\b/ ) {
+ my $align;
+ $align = "2";
+ if ( /ALIGN=(\d+)/ ) {
+ $align = $1;
+ }
+ if ( /CODE/ ) {
+ $nxstack = 1;
+ }
s/^(.+)CODE(.+)READONLY(.*)/ .text/;
- s/^(.+)DATA(.+)READONLY(.*)/ .section .rdata\n .align 2/;
- s/^(.+)\|\|\.data\|\|(.+)/ .data\n .align 2/;
+ s/^(.+)DATA(.+)READONLY(.*)/ .section .rdata/;
+ s/^(.+)\|\|\.data\|\|(.+)/ .data/;
s/^(.+)\|\|\.bss\|\|(.+)/ .bss/;
+ s/$/; .p2align $align/;
}
s/\|\|\.constdata\$(\d+)\|\|/.L_CONST$1/; # ||.constdata$3||
@@ -285,4 +297,8 @@
$addPadding = 0;
}
}
-
+#If we had a code section, mark that this object doesn't need an executable
+# stack.
+if ($nxstack) {
+ printf (" .section\t.note.GNU-stack,\"\",\%\%progbits\n");
+}
More information about the commits
mailing list