arm: Create proper .rdata sections for COFF

As .rodata isn't one of the default created sections for COFF, it was
created as a read-write data section. By using the default .rdata
section name for COFF, it automatically becomes a read-only data section.
The existing ".section .rodata" works as intended for ELF though.

This is based on an original patch and diagnose by Tom Tan
<Tom.Tan@microsoft.com>.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2019-01-11 15:23:16 +02:00
parent ca44fa5d7f
commit 41cf3e3b1c
2 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,8 @@ ELF .size \name, . - \name
.else
.section .rodata
.endif
#elif defined(_WIN32)
.section .rdata
#elif !defined(__MACH__)
.section .rodata
#else

View File

@ -125,6 +125,8 @@ ELF .size \name, . - \name
.else
.section .rodata
.endif
#elif defined(_WIN32)
.section .rdata
#elif !defined(__MACH__)
.section .rodata
#else