summaryrefslogtreecommitdiff
path: root/build/make/ads2gas.pl
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2011-07-21 12:56:59 -0700
committerCode Review <code-review@webmproject.org>2011-07-21 12:56:59 -0700
commit52d13777daa3317d23733a03c3a6402ec3baf8d0 (patch)
treed172ff0eff39050b50073944aef8297c3b0f65ad /build/make/ads2gas.pl
parentddcdbfd71e1562bd6dfb8694ec9e3dd397dc88dc (diff)
parent1647f00c2941b47b624fcb330aa63a933b3324ed (diff)
downloadlibvpx-52d13777daa3317d23733a03c3a6402ec3baf8d0.tar.gz
Merge "Add .size directive to ARM asm functions."
Diffstat (limited to 'build/make/ads2gas.pl')
-rwxr-xr-xbuild/make/ads2gas.pl23
1 files changed, 20 insertions, 3 deletions
diff --git a/build/make/ads2gas.pl b/build/make/ads2gas.pl
index 362fcf4e8..388133aa2 100755
--- a/build/make/ads2gas.pl
+++ b/build/make/ads2gas.pl
@@ -21,6 +21,9 @@ print "@ This file was created from a .asm file\n";
print "@ using the ads2gas.pl script.\n";
print "\t.equ DO1STROUNDING, 0\n";
+# Stack of procedure names.
+@proc_stack = ();
+
while (<STDIN>)
{
# Load and store alignment
@@ -133,9 +136,23 @@ while (<STDIN>)
# Strip PRESERVE8
s/\sPRESERVE8/@ PRESERVE8/g;
- # Strip PROC and ENDPROC
- s/\sPROC/@/g;
- s/\sENDP/@/g;
+ # Use PROC and ENDP to give the symbols a .size directive.
+ # This makes them show up properly in debugging tools like gdb and valgrind.
+ if (/\bPROC\b/)
+ {
+ my $proc;
+ /^_([\.0-9A-Z_a-z]\w+)\b/;
+ $proc = $1;
+ push(@proc_stack, $proc) if ($proc);
+ s/\bPROC\b/@ $&/;
+ }
+ if (/\bENDP\b/)
+ {
+ my $proc;
+ s/\bENDP\b/@ $&/;
+ $proc = pop(@proc_stack);
+ $_ = "\t.size $proc, .-$proc".$_ if ($proc);
+ }
# EQU directive
s/(.*)EQU(.*)/.equ $1, $2/;