[llvm-bugs] [Bug 38868] New: for Microsoft compatibility, md5 hash on long mangled names

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 7 08:21:03 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38868

            Bug ID: 38868
           Summary: for Microsoft compatibility, md5 hash on long mangled
                    names
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mib.bugzilla at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

For long mangled names, VS2017 (and earlier) create an md5 hash for some
external names. Since clang doesn't do this, there is an undefined symbol at
link time. Here is a test case. 
In my experiment, clang created a External PROC named xxxfoo, but Microsoft
mangled it to 
test.asm:       call    ??@f37d033b2f7c2800ae7be4d047d48121@

File test.h
#include <string>
#include <map>

#define FUN4096 xxfoo
#define FUN4095 xfoo
#define FUN4097 xxxfoo

class yxxxxxxxxxxxxxxxxxxxxField {};

typedef std::map<std::string, yxxxxxxxxxxxxxxxxxxxxField>
yxxxxxxxxxxxxxxxScreen
;
typedef std::map<std::string, yxxxxxxxxxxxxxxxScreen> yxxxxxxxxxxxxxxxWebApp;
typedef std::map<std::string, yxxxxxxxxxxxxxxxWebApp> yxxxxxxxxxxxxxxxw2;
typedef std::map<std::string, yxxxxxxxxxxxxxxxw2> mymap;
//typedef std::map<std::string, WebApp2> WebAppTest;
//typedef std::map<std::string, WebAppTest> mymap;

extern void FUN4096(mymap);
extern void FUN4095(mymap);
extern void FUN4097(mymap);

File test.cpp
#include "test.h"
#include <stdio.h>

mymap obj;

int main() {
   FUN4096(obj);
   FUN4095(obj);
   FUN4097(obj);
   printf("PASSED\n");
   return 0;
}
File testa.cpp
#include "test.h"

void FUN4096( mymap obj)
{
   obj.clear();
}

void FUN4095( mymap obj)
{
   obj.clear();
}

void FUN4097( mymap obj)
{
   obj.clear();
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180907/b1661921/attachment.html>


More information about the llvm-bugs mailing list