From: Fangrui Song Date: Sun, 4 Sep 2022 22:38:52 +0000 (-0700) Subject: [ELF] Clarify a workaround for mips GNU ld<2.31 X-Git-Tag: upstream/17.0.6~34438 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=634a722dd926b570ac926a6f7f744a26584721a9;p=platform%2Fupstream%2Fllvm.git [ELF] Clarify a workaround for mips GNU ld<2.31 --- diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 88ba11d..0290244 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -1486,10 +1486,10 @@ template void SharedFile::parse() { continue; } - // MIPS BFD linker puts _gp_disp symbol into DSO files and incorrectly - // assigns VER_NDX_LOCAL to this section global symbol. Here is a - // workaround for this bug. - if (config->emachine == EM_MIPS && idx == VER_NDX_LOCAL && + // In GNU ld < 2.31 (before 3be08ea4728b56d35e136af4e6fd3086ade17764), the + // MIPS port puts _gp_disp symbol into DSO files and incorrectly assigns + // VER_NDX_LOCAL. Workaround this bug. + if (idx == VER_NDX_LOCAL && config->emachine == EM_MIPS && name == "_gp_disp") continue;