[xiph-commits] r17745 - trunk/theora/lib/arm

tterribe at svn.xiph.org tterribe at svn.xiph.org
Fri Dec 10 14:11:00 PST 2010


Author: tterribe
Date: 2010-12-10 14:11:00 -0800 (Fri, 10 Dec 2010)
New Revision: 17745

Modified:
   trunk/theora/lib/arm/arm2gnu.pl
Log:
Make PROC and ENDP functional in arm2gnu.pl.

PROC now marks the corresponding symbol as a function, and ENDP emits
 an appropriate .size directive for it.
These should help tools identify these functions, though valgrind still
 can't associate the function name with the corresponding code.


Modified: trunk/theora/lib/arm/arm2gnu.pl
===================================================================
--- trunk/theora/lib/arm/arm2gnu.pl	2010-12-09 20:21:36 UTC (rev 17744)
+++ trunk/theora/lib/arm/arm2gnu.pl	2010-12-10 22:11:00 UTC (rev 17745)
@@ -20,6 +20,7 @@
 $n=0;
 
 $thumb = 0;     # ARM mode by default, not Thumb.
+ at proc_stack = ();
 
 LINE:
 while (<>) {
@@ -99,12 +100,21 @@
     s/\bCODE16\b/.code 16/ && do {$thumb = 1};
     if (/\bPROC\b/)
     {
+        $proc = $_;
+        $proc =~ s/\s*\b(\w*)\b\s*\bPROC\b\s*/$1/;
+        printf("\t.type\t%s, %%function\n",$proc) if ($proc);
+        push(@proc_stack, $proc);
         print "    .thumb_func" if ($thumb);
         s/\bPROC\b/@ $&/;
     }
     s/^(\s*)(S|Q|SH|U|UQ|UH)ASX\b/$1$2ADDSUBX/;
     s/^(\s*)(S|Q|SH|U|UQ|UH)SAX\b/$1$2SUBADDX/;
-    s/\bENDP\b/@ $&/;
+    if (/\bENDP\b/)
+    {
+        $proc = pop(@proc_stack);
+        print ".size $proc, .-$proc" if ($proc);
+        s/\bENDP\b/@ $&/;
+    }
     s/\bSUBT\b/@ $&/;
     s/\bDATA\b/@ $&/;   # DATA directive is deprecated -- Asm guide, p.7-25
     s/\bKEEP\b/@ $&/;



More information about the commits mailing list