[lld] r188090 - [PECOFF] Add a note about underscore symbol prefix.

Rui Ueyama ruiu at google.com
Fri Aug 9 11:34:58 PDT 2013


Author: ruiu
Date: Fri Aug  9 13:34:57 2013
New Revision: 188090

URL: http://llvm.org/viewvc/llvm-project?rev=188090&view=rev
Log:
[PECOFF] Add a note about underscore symbol prefix.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h

Modified: lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h?rev=188090&r1=188089&r2=188090&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h Fri Aug  9 13:34:57 2013
@@ -28,10 +28,15 @@ namespace coff {
 
 namespace {
 
-// The symbol ___ImageBase is a linker generated symbol. No standard library
+// The symbol __ImageBase is a linker generated symbol. No standard library
 // files define it, but the linker is expected to prepare it as if it was read
 // from a file. The content of the atom is a 4-byte integer equal to the image
 // base address.
+//
+// Note that because the name is prefixed by an underscore on x86 Win32, the
+// actual symbol name becomes ___ImageBase (with three underscores). On other
+// architectures names are not mangled with an underscore. We need to handle
+// name mangling correctly when porting LLD Windows code to them.
 class ImageBaseAtom : public COFFLinkerInternalAtom {
 public:
   ImageBaseAtom(const File &file, uint32_t imageBase)





More information about the llvm-commits mailing list