[PATCH] D100359: [COFF] Force Symbols containing '.' to be quoted

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 12 20:07:06 PDT 2021


loladiro created this revision.
loladiro added reviewers: compnerd, vtjnash.
Herald added subscribers: dexonsmith, hiraditya.
loladiro requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In D87099 <https://reviews.llvm.org/D87099>, the mangler learned to quote export directives that contain
special characters. Only alhpanumerical characters as well as
'_', '$', '.' and '@' were exmpt from this quoting. However, at least
binutils considers an unquoted '.' to be syntax and object files
containing such symbols will cause errors during linking. Fix that
by removing '.' from the list of allowed exemptions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100359

Files:
  llvm/lib/IR/Mangler.cpp


Index: llvm/lib/IR/Mangler.cpp
===================================================================
--- llvm/lib/IR/Mangler.cpp
+++ llvm/lib/IR/Mangler.cpp
@@ -186,7 +186,7 @@
 
 // Check if the name needs quotes to be safe for the linker to interpret.
 static bool canBeUnquotedInDirective(char C) {
-  return isAlnum(C) || C == '_' || C == '$' || C == '.' || C == '@';
+  return isAlnum(C) || C == '_' || C == '$' || C == '@';
 }
 
 static bool canBeUnquotedInDirective(StringRef Name) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100359.337029.patch
Type: text/x-patch
Size: 489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210413/d8d922b1/attachment.bin>


More information about the llvm-commits mailing list