New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 919180 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug

Blocking:
issue v8:6666



Sign in to add a comment

When building with link.exe "multiple '.rodata' sections found with different attributes"

Project Member Reported by brucedaw...@chromium.org, Jan 4

Issue description

Building 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.

 
Cc: -r...@chromium.org zturner@chromium.org
I filed https://bugs.llvm.org/show_bug.cgi?id=40229 and changed who is CCed on this bug.
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.
Cc: jgruber@chromium.org
Components: Blink>JavaScript
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.

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

Blocking: v8:6666
Cc: tom....@microsoft.com
Owner: jgruber@chromium.org
Status: Assigned (was: Available)
Thanks for investigating, interesting indeed. I'll take this onto my queue but Tom's fix from #5 lgtm.
Project Member

Comment 8 by bugdroid1@chromium.org, 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

Labels: Merge-Request-72
Project Member

Comment 10 by sheriffbot@chromium.org, Jan 10

Labels: -Merge-Request-72 Merge-Reject-72 Hotlist-Merge-Reject
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
Labels: -Pri-3 -Hotlist-Merge-Reject -Merge-Reject-72 Merge-Request-72 Pri-1
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.
Project Member

Comment 12 by sheriffbot@chromium.org, Jan 10

Labels: -Merge-Request-72 Merge-Review-72 Hotlist-Merge-Review
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
Cc: brucedaw...@chromium.org
brucedawson@ are you comfortable with fix in #8 for M72 branch?
The fix in #8 seems very safe, no concerns here.
There's currently a CL in flight with a better, simpler fix: https://crrev.com/c/1407240. 
Project Member

Comment 16 by bugdroid1@chromium.org, 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

great thanks! brucedawson@ - are you comfortable with #16?
Yep, seems good. The new fix works well.
Labels: -Merge-Review-72 Merge-Approved-72
Approving #16 for M72, branch:3626

Comment 20 by jgruber@chromium.org, Jan 16 (6 days ago)

Backmerge in flight on top of refs/branch-heads/7.2: https://crrev.com/c/1411887
Project Member

Comment 21 by bugdroid1@chromium.org, Jan 17 (5 days ago)

Labels: merge-merged-7.2
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

Comment 22 by jgruber@chromium.org, Jan 17 (5 days ago)

Labels: -Merge-Approved-72

Comment 23 by jgruber@chromium.org, Jan 17 (5 days ago)

Owner: brucedaw...@chromium.org
Bruce, assigning back to you in case you want to leave this open - feel free to close otherwise, backmerges are done.

Comment 24 by brucedaw...@chromium.org, Jan 17 (5 days ago)

Status: Fixed (was: Assigned)
Closing as fixed. The llvm bug will track getting lld-link to notice this situation.

Sign in to add a comment