From 485136287e377f1b6bd8205d215f872b1db20629 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 11 Jan 2019 17:42:47 -0800 Subject: [PATCH] Use .rdata as section name for asm targeting COFF .rdata is the default section which hosts read-only data for COFF. Use this default section name avoids creating a new .rodata section with explicit read-only property. Bug: chromium:919180 Change-Id: I7325cbcfdb142b3ee15de93b7881f755c365d6e6 Reviewed-on: https://chromium-review.googlesource.com/c/1407240 Commit-Queue: Jakob Gruber Reviewed-by: Jakob Gruber Cr-Commit-Position: refs/heads/master@{#58764} --- src/snapshot/embedded-file-writer.cc | 3 +-- tools/snapshot/asm_to_inline_asm.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/snapshot/embedded-file-writer.cc b/src/snapshot/embedded-file-writer.cc index 121c60e7ab..fbf1fb7793 100644 --- a/src/snapshot/embedded-file-writer.cc +++ b/src/snapshot/embedded-file-writer.cc @@ -347,8 +347,7 @@ void PlatformDependentEmbeddedFileWriter::SectionData() { void PlatformDependentEmbeddedFileWriter::SectionRoData() { #if defined(V8_OS_WIN) - // .rodata defaults to r/w in COFF, but read only in ELF. - fprintf(fp_, ".section .rodata,\"r\"\n"); + fprintf(fp_, ".section .rdata\n"); #else fprintf(fp_, ".section .rodata\n"); #endif diff --git a/tools/snapshot/asm_to_inline_asm.py b/tools/snapshot/asm_to_inline_asm.py index 623801c501..70ab09f8f5 100644 --- a/tools/snapshot/asm_to_inline_asm.py +++ b/tools/snapshot/asm_to_inline_asm.py @@ -17,8 +17,6 @@ def asm_to_inl_asm(in_filename, out_filename): with open(in_filename, 'r') as infile, open(out_filename, 'wb') as outfile: outfile.write('__asm__(\n') for line in infile: - # Escape " in .S file before output it to inline asm file. - line = line.replace('"', '\\"') outfile.write(' "%s\\n"\n' % line.rstrip()) outfile.write(');\n') return 0