[PATCH] D46427: [PDB] Quote linker arguments containing spaces (mimic MSVC)

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 11:17:56 PDT 2018


pcc added a comment.

It looks like MSVC does not bother to quote quotation marks correctly.

  /mnt/c/src/tmp$ cat quote.yaml
  --- !COFF
  header:
    Machine:         IMAGE_FILE_MACHINE_I386
    Characteristics: [  ]  
  sections:
    - Name:            '.text'
      Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_EXECUTE ]
      Alignment:       1   
      SectionData:     00  
  symbols:
    - Name:            '"'
      Value:           0
      SectionNumber:   1
      SimpleType:      IMAGE_SYM_TYPE_NULL
      ComplexType:     IMAGE_SYM_DTYPE_NULL
      StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  ...
  /mnt/c/src/tmp$ ../l/ra/bin/yaml2obj.exe quote.yaml  > quote.obj
  
  C:\src\tmp>link /debug "/entry:""" /subsystem:console quote.obj
  Microsoft (R) Incremental Linker Version 14.12.25835.0
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  /mnt/c/src/tmp$ hd quote.pdb | grep -2 entry
  000060d0  65 78 65 00 70 64 62 00  43 3a 5c 73 72 63 5c 74  |exe.pdb.C:\src\t|
  000060e0  6d 70 5c 71 75 6f 74 65  2e 70 64 62 00 63 6d 64  |mp\quote.pdb.cmd|
  000060f0  00 20 2f 64 65 62 75 67  20 2f 65 6e 74 72 79 3a  |. /debug /entry:|
  00006100  22 20 2f 73 75 62 73 79  73 74 65 6d 3a 63 6f 6e  |" /subsystem:con|
  00006110  73 6f 6c 65 00 00 00 00  1a 00 36 11 01 00 0c 00  |sole......6.....|


https://reviews.llvm.org/D46427





More information about the llvm-commits mailing list