Commit 934af8dd authored by Tom Tan's avatar Tom Tan Committed by Commit Bot

.rodata from embedded.S should be read only

.rodata usually hosts read only data. MSVC link.exe complains mismatch when
merging this read/write .rodata from embedded.S with .rodata from other object
file.

Bug: chromium:919180
Change-Id: I7789e42afe116cc4bf772e2cbb312d19e4ce7fe5
Reviewed-on: https://chromium-review.googlesource.com/c/1396361
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58653}
parent c8561b1a
......@@ -346,7 +346,12 @@ 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");
#else
fprintf(fp_, ".section .rodata\n");
#endif
}
void PlatformDependentEmbeddedFileWriter::DeclareUint32(const char* name,
......
......@@ -17,6 +17,8 @@ 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment