[GASPP] Handle a trailing flags field for .rodata, like '.section .rodata, "r"'

Message ID 1547156270-20892-1-git-send-email-martin@martin.st
State New
Headers show
Series
  • [GASPP] Handle a trailing flags field for .rodata, like '.section .rodata, "r"'
Related show

Commit Message

Martin Storsjö Jan. 10, 2019, 9:37 p.m.
---
 gas-preprocessor.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 4131c46..c73c72e 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -1198,7 +1198,7 @@  sub handle_serialized_line {
         $line =~ s/\.arm/ARM/x;
         # The alignment in AREA is the power of two, just as .align in gas
         $line =~ s/\.text/AREA |.text|, CODE, READONLY, ALIGN=4, CODEALIGN/;
-        $line =~ s/(\s*)(.*)\.rodata/$1AREA |.rodata|, DATA, READONLY, ALIGN=5/;
+        $line =~ s/(\s*)(.*)\.rodata(\s*,\s*"\w+")?/$1AREA |.rodata|, DATA, READONLY, ALIGN=5/;
         $line =~ s/\.data/AREA |.data|, DATA, ALIGN=5/;
     }
     if ($as_type eq "armasm" and $arch eq "arm") {