[PATCH] D96327: [CodeGen] Fix two dots between text section name and symbol name

TaoPan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 02:23:34 PST 2021


TaoPan created this revision.
TaoPan added reviewers: MaskRay, rnk, mstorsjo, danielcdh, pengfei.
Herald added a subscriber: hiraditya.
TaoPan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

There is a trailing dot in text section name if it has prefix, don't add
repeated dot when connect text section name and symbol name.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96327

Files:
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp


Index: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
===================================================================
--- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -624,6 +624,8 @@
     Name.push_back('.');
     TM.getNameWithPrefix(Name, GO, Mang, /*MayAlwaysUsePrivate*/true);
   } else if (HasPrefix)
+    // For distinguishing between .text.${text-section-prefix}. (with trailing
+    // dot) and .text.${function-name}
     Name.push_back('.');
   return Name;
 }
@@ -915,7 +917,9 @@
   } else {
     Name += MBB.getParent()->getSection()->getName();
     if (TM.getUniqueBasicBlockSectionNames()) {
-      Name += ".";
+      if (!Name.endswith(".")) {
+        Name += ".";
+      }
       Name += MBB.getSymbol()->getName();
     } else {
       UniqueID = NextUniqueID++;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96327.322320.patch
Type: text/x-patch
Size: 853 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210209/bd820076/attachment.bin>


More information about the llvm-commits mailing list