[all-commits] [llvm/llvm-project] 945741: [LLD] [COFF] Fix linking MSVC generated implib hea...
Martin Storsjö via All-commits
all-commits at lists.llvm.org
Tue Jan 21 13:56:03 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9457418e66766d8fafc81f85eb8045986220ca3e
https://github.com/llvm/llvm-project/commit/9457418e66766d8fafc81f85eb8045986220ca3e
Author: Martin Storsjö <martin at martin.st>
Date: 2025-01-21 (Tue, 21 Jan 2025)
Changed paths:
M lld/COFF/InputFiles.cpp
M lld/test/COFF/empty-section-decl.yaml
M llvm/include/llvm/Object/COFF.h
R llvm/test/Object/coff-sec-sym.test
Log Message:
-----------
[LLD] [COFF] Fix linking MSVC generated implib header objects (#122811)
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).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list