From f76e91d21a8cd368fe24ca39598413b51c51790f Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Fri, 14 Nov 2025 12:44:23 -0800 Subject: [PATCH] lld workaround .gnu.version change --- lld/ELF/InputFiles.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index a5921feb1829..7de9ff4020be 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -1698,6 +1698,7 @@ template void SharedFile::parse() { continue; } + /* if (ver == VER_NDX_LOCAL || (ver != VER_NDX_GLOBAL && idx >= verdefs.size())) { // In GNU ld < 2.31 (before 3be08ea4728b56d35e136af4e6fd3086ade17764), the @@ -1709,7 +1710,7 @@ template void SharedFile::parse() { << " for symbol " << name << " is out of bounds\n>>> defined in " << this; continue; - } + }*/ uint32_t alignment = getAlignment(sections, sym); if (ver == idx) { @@ -1723,7 +1724,8 @@ template void SharedFile::parse() { // Also add the symbol with the versioned name to handle undefined symbols // with explicit versions. - if (ver == VER_NDX_GLOBAL) + if (sym.isExternal() && + (ver == VER_NDX_LOCAL || ver == VER_NDX_GLOBAL)) continue; StringRef verName = -- 2.52.0