[GASPP] Handle the .data.rel.ro section name

Message ID 1416154457-12405-1-git-send-email-martin@martin.st
State New
Headers show

Commit Message

Martin Storsjö Nov. 16, 2014, 4:14 p.m.
Map this to normal read-only data for apple and armasm.
---
clang on OS X doesn't use any special section for such data when
-fPIC is enabled, and I'm not aware of anything equivalent to
-fPIC for MSVC at all, so I don't think there's any similar
section we'd need to map it to there either.
---
 gas-preprocessor.pl | 2 ++
 1 file changed, 2 insertions(+)

Comments

Luca Barbato Nov. 16, 2014, 7:43 p.m. | #1
On 16/11/14 17:14, Martin Storsjo wrote:
> Map this to normal read-only data for apple and armasm.
> ---
> clang on OS X doesn't use any special section for such data when
> -fPIC is enabled, and I'm not aware of anything equivalent to
> -fPIC for MSVC at all, so I don't think there's any similar
> section we'd need to map it to there either.
> ---
>  gas-preprocessor.pl | 2 ++
>  1 file changed, 2 insertions(+)
> 
Seems fine to me ^^

lu

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 3020401..09463ac 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -975,6 +975,7 @@  sub handle_serialized_line {
         $line =~ s/\.global/.globl/x;
         # also catch .section .rodata since the equivalent to .const_data is .section __DATA,__const
         $line =~ s/(.*)\.rodata/.const_data/x;
+        $line =~ s/(.*)\.data\.rel\.ro/.const_data/x;
         $line =~ s/\.int/.long/x;
         $line =~ s/\.float/.single/x;
     }
@@ -991,6 +992,7 @@  sub handle_serialized_line {
         # The alignment in AREA is the power of two, just as .align in gas
         $line =~ s/\.text/AREA |.text|, CODE, READONLY, ALIGN=2, CODEALIGN/;
         $line =~ s/(\s*)(.*)\.rodata/$1AREA |.rodata|, DATA, READONLY, ALIGN=5/;
+        $line =~ s/(\s*)(.*)\.data\.rel\.ro/$1AREA |.rodata|, DATA, READONLY, ALIGN=5/;
 
         $line =~ s/fmxr/vmsr/;
         $line =~ s/fmrx/vmrs/;