diff options
Diffstat (limited to 'lld/ELF')
-rw-r--r-- | lld/ELF/Driver.cpp | 1 | ||||
-rw-r--r-- | lld/ELF/InputFiles.h | 3 | ||||
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 39314c2aef1..4cbc701edea 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -987,6 +987,7 @@ void LinkerDriver::createFiles(opt::InputArgList &Args) { if (!InputFile::IsInGroup) error("stray --end-group"); InputFile::IsInGroup = false; + ++InputFile::NextGroupId; break; case OPT_start_lib: InLib = true; diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 6b60ba9f1fa..cb6bccb5e8c 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -118,6 +118,7 @@ public: // ID. For more info, see checkDependency() in SymbolTable.cpp. uint32_t GroupId; static bool IsInGroup; + static uint32_t NextGroupId; protected: InputFile(Kind K, MemoryBufferRef M); @@ -126,8 +127,6 @@ protected: private: const Kind FileKind; - - static uint32_t NextGroupId; }; template <typename ELFT> class ELFFileBase : public InputFile { diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 907f1025e93..5ed5b491aa4 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -333,6 +333,8 @@ void ScriptParser::readGroup() { InputFile::IsInGroup = true; readInput(); InputFile::IsInGroup = Orig; + if (!Orig) + ++InputFile::NextGroupId; } void ScriptParser::readInclude() { |