aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Option/OptTable.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2025-01-23 09:15:47 +0200
committerGitHub <noreply@github.com>2025-01-23 09:15:47 +0200
commit8eb99bbe6e8878bfd73fb301899ced6bb5dfff38 (patch)
tree49e370c383b2cfc7bc4cc1d891243a9f641d95c6 /llvm/lib/Option/OptTable.cpp
parent3fb8c5b43195d6e11ff0557d07e75700343d369f (diff)
downloadllvm-8eb99bbe6e8878bfd73fb301899ced6bb5dfff38.zip
llvm-8eb99bbe6e8878bfd73fb301899ced6bb5dfff38.tar.gz
llvm-8eb99bbe6e8878bfd73fb301899ced6bb5dfff38.tar.bz2
Reland [LLD] [COFF] Fix linking MSVC generated implib header objects (#123916)
ecb5ea6a266d5cc4e05252f6db4c73613b73cc3b tried to fix cases when LLD links what seems to be import library header objects from MSVC. However, the fix seems incorrect; the review at https://reviews.llvm.org/D133627 concluded that if this (treating this kind of symbol as a common symbol) is what link.exe does, it's fine. However, this is most probably not what link.exe does. The symbol mentioned in the commit message of ecb5ea6a266d5cc4e05252f6db4c73613b73cc3b would be a common symbol with a size of around 3 GB; this is not what might have been intended. That commit tried to avoid running into the error ".idata$4 should not refer to special section 0"; that issue is fixed for a similar style of section symbols in 4a4a8a1476b1386b523dc5b292ba9a5a6748a9cf. Therefore, revert ecb5ea6a266d5cc4e05252f6db4c73613b73cc3b and extend the fix from 4a4a8a1476b1386b523dc5b292ba9a5a6748a9cf to also work for the section symbols in MSVC generated import libraries. The main detail about them, is that for symbols of type IMAGE_SYM_CLASS_SECTION, the Value field is not an offset, but it is an optional set of flags, corresponding to the Characteristics of the section header (although it may be empty). This is a reland of a previous version of this commit, earlier merged in 9457418e66766d8fafc81f85eb8045986220ca3e / #122811. The previous version failed tests when run with address sanitizer. The issue was that the synthesized coff_symbol_generic object actually will be used to access a full coff_symbol16 or coff_symbol32 struct, see DefinedCOFF::getCOFFSymbol. Therefore, we need to make a copy of the full size of either of them.
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
0 files changed, 0 insertions, 0 deletions