| Index: source/libvpx/build/make/ads2gas.pl
|
| ===================================================================
|
| --- source/libvpx/build/make/ads2gas.pl (revision 96967)
|
| +++ source/libvpx/build/make/ads2gas.pl (working copy)
|
| @@ -21,8 +21,14 @@
|
| 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
|
| + s/@/,:/g;
|
| +
|
| # Comment character
|
| s/;/@/g;
|
|
|
| @@ -79,7 +85,10 @@
|
| s/CODE([0-9][0-9])/.code $1/;
|
|
|
| # No AREA required
|
| - s/^\s*AREA.*$/.text/;
|
| + # But ALIGNs in AREA must be obeyed
|
| + s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/;
|
| + # If no ALIGN, strip the AREA and align to 4 bytes
|
| + s/^\s*AREA.*$/.text\n.p2align 2/;
|
|
|
| # DCD to .word
|
| # This one is for incoming symbols
|
| @@ -114,8 +123,8 @@
|
| # put the colon at the end of the line in the macro
|
| s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
|
|
|
| - # Strip ALIGN
|
| - s/\sALIGN/@ ALIGN/g;
|
| + # ALIGN directive
|
| + s/ALIGN/.balign/g;
|
|
|
| # Strip ARM
|
| s/\sARM/@ ARM/g;
|
| @@ -127,9 +136,23 @@
|
| # 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/;
|
| @@ -148,3 +171,6 @@
|
| next if /^\s*END\s*$/;
|
| print;
|
| }
|
| +
|
| +# Mark that this object doesn't need an executable stack.
|
| +printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n");
|
|
|