When building with link.exe "multiple '.rodata' sections found with different attributes" |
|||||||||||||
Issue descriptionBuilding Chrome on Windows (x86 or x64) with link.exe (use_lld=false) the following warning is hit: libvpx_yasm.lib(vpx_subpixel_8t_ssse3.o) : warning LNK4078: multiple '.rodata' sections found with different attributes (40500040) LINK : error LNK1218: warning treated as error; no output file generated This suggests two issues: 1) We are creating .rodata sections with different attributes in vpx_subpixel_8t_ssse3.o 2) lld-link.exe is not noticing this discrepancy Because this is only a warning I can move past it by adding /ignore:4078 to common_linker_setup but I don't want to commit to such a "fix" because I don't understand how we are ending up with different attributes and what they mean. I will file an lld-link bug and link it to this one.
,
Jan 4
The bug seems that vpx_subpixel_8t_ssse3.o has read only ".rodata" section, but embedded.S/embedded.o generated in V8 has read/write ".rodata" section. MSVC link.exe complains this mismatch when merging ".rodata" section, but it seems lld-link.exe doesn't do this validation.
,
Jan 4
Thanks for finding that Tom. How did you identify which .o file was conflicting? Having a .rodata file tagged as read/write seems bad. Quite bad. Adding a v8 owner who has worked on embedded.o for comment.
,
Jan 4
I set break point in link.exe when creating a new ".rodata" section, and found the r/w one comes from embedded.S.
To repro it, you can assemble below assembly like "clang-cl -c a.S" then run "link /dump /headers a.obj" to check the property of ".rodata" section.
.section .rodata
.long 1
which shows below output:
SECTION HEADER #4
.rodata name
0 physical address
0 virtual address
4 size of raw data
B4 file pointer to raw data (000000B4 to 000000B7)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0100040 flags
Initialized Data
1 byte align
Read Write
,
Jan 4
Below is the proposed patch: https://chromium-review.googlesource.com/c/v8/v8/+/1396361
,
Jan 7
,
Jan 7
Thanks for investigating, interesting indeed. I'll take this onto my queue but Tom's fix from #5 lgtm.
,
Jan 9
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/934af8dde90daed8b211df0c724a3053c701e9e4 commit 934af8dde90daed8b211df0c724a3053c701e9e4 Author: Tom Tan <Tom.Tan@microsoft.com> Date: Wed Jan 09 07:58:51 2019 .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: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#58653} [modify] https://crrev.com/934af8dde90daed8b211df0c724a3053c701e9e4/src/snapshot/embedded-file-writer.cc [modify] https://crrev.com/934af8dde90daed8b211df0c724a3053c701e9e4/tools/snapshot/asm_to_inline_asm.py
,
Jan 9
,
Jan 10
The bug is marked as P3 or Feature. It should not be merged as M72 is in beta. Please contact the approriate milestone owner if you have questions. Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 10
Updated labels, reapplying merge request. The CL in #8 fixes an issue that causes a section of the binary to be read-write that is intended to be read-only.
,
Jan 10
This bug requires manual review: M72 has already been promoted to the beta branch, so this requires manual review Please contact the milestone owner if you have questions. Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 11
brucedawson@ are you comfortable with fix in #8 for M72 branch?
,
Jan 11
The fix in #8 seems very safe, no concerns here.
,
Jan 14
There's currently a CL in flight with a better, simpler fix: https://crrev.com/c/1407240.
,
Jan 14
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/485136287e377f1b6bd8205d215f872b1db20629 commit 485136287e377f1b6bd8205d215f872b1db20629 Author: Tom Tan <Tom.Tan@microsoft.com> Date: Mon Jan 14 08:15:11 2019 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 <jgruber@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#58764} [modify] https://crrev.com/485136287e377f1b6bd8205d215f872b1db20629/src/snapshot/embedded-file-writer.cc [modify] https://crrev.com/485136287e377f1b6bd8205d215f872b1db20629/tools/snapshot/asm_to_inline_asm.py
,
Jan 15
great thanks! brucedawson@ - are you comfortable with #16?
,
Jan 15
Yep, seems good. The new fix works well.
,
Jan 15
Approving #16 for M72, branch:3626
,
Jan 16
(6 days ago)
Backmerge in flight on top of refs/branch-heads/7.2: https://crrev.com/c/1411887
,
Jan 17
(5 days ago)
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/5047389f9ab470322a6acf30da4daad505e1da1a commit 5047389f9ab470322a6acf30da4daad505e1da1a Author: Jakob Gruber <jgruber@chromium.org> Date: Thu Jan 17 07:28:34 2019 Merged: 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. No-Try: true No-Presubmit: true No-Treechecks: true Tbr: hablich@chromium.org Bug: chromium:919180 Change-Id: I7325cbcfdb142b3ee15de93b7881f755c365d6e6 Reviewed-on: https://chromium-review.googlesource.com/c/1407240 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#58764} Reviewed-on: https://chromium-review.googlesource.com/c/1411887 Cr-Commit-Position: refs/branch-heads/7.2@{#41} Cr-Branched-From: 6acd03c9b8a8232aee95f25fbf6ae822aaedae75-refs/heads/7.2.502@{#1} Cr-Branched-From: b03041de094610ef24e0e4fb6bf4c700fa1553ed-refs/heads/master@{#57910} [modify] https://crrev.com/5047389f9ab470322a6acf30da4daad505e1da1a/src/snapshot/embedded-file-writer.cc
,
Jan 17
(5 days ago)
,
Jan 17
(5 days ago)
Bruce, assigning back to you in case you want to leave this open - feel free to close otherwise, backmerges are done.
,
Jan 17
(5 days ago)
Closing as fixed. The llvm bug will track getting lld-link to notice this situation. |
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by brucedaw...@chromium.org
, Jan 4