[PATCH] D48567: [COFF] Fix constant sharing regression for MinGW

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 01:40:03 PDT 2018


mstorsjo added a comment.

I've pinned down the GNU bfd incompatibility to this:

  $ cat const.s
          .section        .rdata,"dr",discard,val
  .LCPI0_0:
          .byte 0
  $ clang -target x86_64-w64-mingw32 -c const.s -o const.o -c
  $ x86_64-w64-mingw32-objdump -d const.o  
  
  const.o:     file format pe-x86-64
  
  x86_64-w64-mingw32-objdump: const.o: Unrecognized storage class 0 for .rdata symbol `val'
  x86_64-w64-mingw32-objdump: failed to read symbol table from: const.o
  x86_64-w64-mingw32-objdump: error message was: File in wrong format

If I make the symbol `val` a proper symbol, either by adding a `val:` in the file, or a `.globl val` (changing the symbol table entry value from `IMAGE_SYM_CLASS_NULL` to something else).

I think this maybe even could use the existing flag `HasCOFFAssociativeComdats` instead of inventing a new one, since it seems to be pretty closely related to the same concept.


Repository:
  rL LLVM

https://reviews.llvm.org/D48567





More information about the llvm-commits mailing list