[PECOFF] Trim at most one character from imported symbols.
The import name is not always the same as the symbol name. If the name/type field in the import header is NOPREFIX or UNDECORATE, we need to strip some characters from symbol to get its import name. The Microsoft PE/COFF spec is vague if symbol contains more than two consecutive characters to be stripped. We used to strip all characters, but it doesn't seem right as we couldn't link against the system library because of this name mangling. Looks like we shouldn't strip more than one character. llvm-svn: 188154
Showing
- lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp 10 additions, 2 deletionslld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
- lld/test/pecoff/Inputs/vars-main.c 2 additions, 1 deletionlld/test/pecoff/Inputs/vars-main.c
- lld/test/pecoff/Inputs/vars-main.obj.yaml 15 additions, 42 deletionslld/test/pecoff/Inputs/vars-main.obj.yaml
- lld/test/pecoff/Inputs/vars.c 7 additions, 1 deletionlld/test/pecoff/Inputs/vars.c
- lld/test/pecoff/Inputs/vars.dll.yaml 2 additions, 2 deletionslld/test/pecoff/Inputs/vars.dll.yaml
- lld/test/pecoff/Inputs/vars.lib 0 additions, 0 deletionslld/test/pecoff/Inputs/vars.lib
- lld/test/pecoff/importlib.test 13 additions, 8 deletionslld/test/pecoff/importlib.test
No preview for this file type
Please register or sign in to comment