Add a comment about ELF spec and the symbol table's sh_info.
authorRui Ueyama <ruiu@google.com>
Thu, 15 Mar 2018 17:10:50 +0000 (17:10 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 15 Mar 2018 17:10:50 +0000 (17:10 +0000)
llvm-svn: 327645

lld/ELF/InputFiles.cpp

index 1aa60f7..d69a40c 100644 (file)
@@ -866,6 +866,10 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
       continue;
     }
 
+    // ELF spec requires that all local symbols precede weak or global
+    // symbols in each symbol table, and the index of first non-local symbol
+    // is stored to sh_info. If a local symbol appears after some non-local
+    // symbol, that's a violation of the spec.
     if (Sym.getBinding() == STB_LOCAL) {
       warn("found local symbol '" + Name +
            "' in global part of symbol table in file " + toString(this));