[GASPP] Name read-only data sections .rdata, convert both .rdata and .rodata in the same way

Message ID 1547213096-11230-1-git-send-email-martin@martin.st
State New
Headers show
Series
  • [GASPP] Name read-only data sections .rdata, convert both .rdata and .rodata in the same way
Related show

Commit Message

Martin Storsjo Jan. 11, 2019, 1:24 p.m.
---
 gas-preprocessor.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Jan. 13, 2019, 7:52 a.m. | #1
On 11/01/2019 14:24, Martin Storsjo wrote:
> ---
>   gas-preprocessor.pl | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index 4131c46..0137718 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*)(.*)\.ro?data/$1AREA |.rdata|, DATA, READONLY, ALIGN=5/;
>           $line =~ s/\.data/AREA |.data|, DATA, ALIGN=5/;
>       }
>       if ($as_type eq "armasm" and $arch eq "arm") {
> 

Possibly OK.

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 4131c46..0137718 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*)(.*)\.ro?data/$1AREA |.rdata|, DATA, READONLY, ALIGN=5/;
         $line =~ s/\.data/AREA |.data|, DATA, ALIGN=5/;
     }
     if ($as_type eq "armasm" and $arch eq "arm") {