[lld] [LLD][COFF] Support CF guards on ARM64X (PR #128440)
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 5 17:31:11 PST 2025
ZequanWu wrote:
This causes lld-link to crash for chromium windows build:
```
Stack dump:
0. Program arguments: ..\\..\\third_party\\llvm-build\\Release+Asserts\\bin\\lld-link.exe /OUT:./nasm.exe /nologo -libpath:../../third_party/llvm-build/Release+Asserts/lib/clang/21/lib/windows /winsysroot:../../third_party/depot_tools/win_toolchain/vs_files/7393122652 /MACHINE:X64 /PDB:./nasm.exe.pdb @./nasm.exe.rsp /reproduce:repro.tar
Exception Code: 0xC0000005
#0 0x00007ff720a18d26 lld::coff::Symbol::kind C:\src\chromium\src\third_party\llvm\lld\COFF\Symbols.h:69:0
#1 0x00007ff720a18d26 lld::coff::Defined::getChunk C:\src\chromium\src\third_party\llvm\lld\COFF\Symbols.h:474:0
#2 0x00007ff720a18d26 addSymbolToRVASet C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:1964:0
#3 0x00007ff720a07edb `anonymous namespace'::Writer::markSymbolsWithRelocations C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:2040:0
#4 0x00007ff720a07edb `anonymous namespace'::Writer::createGuardCFTables C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:2092:0
#5 0x00007ff720a07edb `anonymous namespace'::Writer::createMiscChunks C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:1256:0
#6 0x00007ff720a07edb `anonymous namespace'::Writer::run C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:777:0
#7 0x00007ff720a03b32 std::vector<std::pair<lld::coff::Chunk *,lld::coff::Defined *>,std::allocator<std::pair<lld::coff::Chunk *,lld::coff::Defined *> > >::_Tidy C:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\7393122652\VC\Tools\MSVC\14.39.33519\include\vector:2052:0
#8 0x00007ff720a03b32 std::vector<std::pair<lld::coff::Chunk *,lld::coff::Defined *>,std::allocator<std::pair<lld::coff::Chunk *,lld::coff::Defined *> > >::~vector C:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\7393122652\VC\Tools\MSVC\14.39.33519\include\vector:765:0
#9 0x00007ff720a03b32 `anonymous namespace'::Writer::~Writer C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:204:0
#10 0x00007ff720a03b32 lld::coff::writeResult(class lld::coff::COFFLinkerContext &) C:\src\chromium\src\third_party\llvm\lld\COFF\Writer.cpp:355:0
#11 0x00007ff7207168a3 lld::coff::LinkerDriver::linkerMain(class llvm::ArrayRef<char const *>) C:\src\chromium\src\third_party\llvm\lld\COFF\Driver.cpp:2792:0
#12 0x00007ff72070bedd lld::coff::link(class llvm::ArrayRef<char const *>, class llvm::raw_ostream &, class llvm::raw_ostream &, bool, bool) C:\src\chromium\src\third_party\llvm\lld\COFF\Driver.cpp:98:0
#13 0x00007ff72070b642 lld::unsafeLldMain(class llvm::ArrayRef<char const *>, class llvm::raw_ostream &, class llvm::raw_ostream &, class llvm::ArrayRef<struct lld::DriverDef>, bool) C:\src\chromium\src\third_party\llvm\lld\Common\DriverDispatcher.cpp:163:0
#14 0x00007ff7206d1228 lld_main(int, char **, struct llvm::ToolContext const &) C:\src\chromium\src\third_party\llvm\lld\tools\lld\lld.cpp:115:0
#15 0x00007ff7206d1a35 main C:\src\chromium\src\third_party\llvm-build\Release+Asserts\tools\lld\tools\lld\lld-driver.cpp:17:0
#16 0x00007ff723c78de0 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
#17 0x00007ff723c78de0 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#18 0x00007fffd29e7374 (C:\Windows\System32\KERNEL32.DLL+0x17374)
#19 0x00007fffd443cc91 (C:\Windows\SYSTEM32\ntdll.dll+0x4cc91)
```
Attached a repro: [repro.tar.gz](https://github.com/user-attachments/files/19099670/repro.tar.gz)
Please revert this change if it takes a while to fix.
https://github.com/llvm/llvm-project/pull/128440
More information about the llvm-commits
mailing list