[libav-devel] [GASPP PATCH] Handle .quad, .ascii and .asciz for armasm

Martin Storsjo martin at martin.st
Thu Aug 13 23:01:43 CEST 2015


When using .ascii, the strings can't contain embedded null bytes, though.
---
For .asciz, I chose just to try to match the rest of the line, and
append an ,0 at the end. For multiple consecutive null terminated strings
(like .asciz "foo", "bar") this isn't the right thing to do though, but
trying to match the quoting (while supporting escaped citation marks)
is almost overkill.
---
 gas-preprocessor.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 8eccc03..750a4d0 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -987,6 +987,9 @@ sub handle_serialized_line {
         $line =~ s/\.word/dcd/x;
         $line =~ s/\.short/dcw/x;
         $line =~ s/\.byte/dcb/x;
+        $line =~ s/\.quad/dcq/x;
+        $line =~ s/\.ascii/dcb/x;
+        $line =~ s/\.asciz(.*)$/dcb\1,0/x;
         $line =~ s/\.thumb/THUMB/x;
         $line =~ s/\.arm/ARM/x;
         # The alignment in AREA is the power of two, just as .align in gas
-- 
2.3.2 (Apple Git-55)



More information about the libav-devel mailing list