[lld] [ELF] Merge copyLocalSymbols and demoteLocalSymbolsInDiscardedSections (PR #69425)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 09:13:25 PDT 2023


ilovepi wrote:

I think we're seeing an issue with this patch when building Fuchsia. I haven't bisected precisely yet, but given that this is the only ELF/LLD change in the blame it seems highly likely.

Can you take a look?

Bot: https://luci-milo.appspot.com/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.x64-release/b8766941698462381393/overview

```
136211/280027](64) LINK kernel_x64/zircon.elf
FAILED: kernel_x64/zircon.elf kernel_x64/zircon.elf.map kernel_x64/zircon.elf.build-id.stamp
../../prebuilt/third_party/clang/custom/bin/clang++ -o kernel_x64/zircon.elf -Wl,-T,../../zircon/kernel/kernel.ld -Wl,--emit-relocs -g3 -gdwarf-4 -gz=zstd -fdata-sections -ffunction-sections -Wl,--gc-sections -O2 -fno-exceptions -fno-rtti -ffile-compilation-dir=. -no-canonical-prefixes -fuse-ld=lld -Wl,-z,relro --target=x86_64-fuchsia -fcolor-diagnostics -Wl,--color-diagnostics -fcrash-diagnost...
ld.lld: lld/ELF/InputSection.cpp:438: void lld::elf::InputSection::copyRelocations(uint8_t *, llvm::iterator_range<RelIt>) [ELFT = llvm::object::ELFType<llvm::endianness::little, true>, RelTy = llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::endianness::little, true>, true>, RelIt = llvm::mapped_iterator<const llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::endianness::little, tru...
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
ld.lld: lld/ELF/InputSection.cpp:438: void lld::elf::InputSection::copyRelocations(uint8_t *, llvm::iterator_range<RelIt>) [ELFT = llvm::object::ELFType<llvm::endianness::little, true>, RelTy = llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::endianness::little, true>, true>, RelIt = llvm::mapped_iterator<const llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::endianness::little, tru...
clang++: error: unable to execute command: Aborted
clang++: error: ld.lld command failed due to signal (use -v to see invocation)
Fuchsia clang version 18.0.0 (https://llvm.googlesource.com/llvm-project 6971081cefdc498ed474182cc06aec68b007955c)
Target: x86_64-unknown-fuchsia
Thread model: posix
InstalledDir: ../../prebuilt/third_party/clang/custom/bin
clang++: note: diagnostic msg:
```

I had to split the reproducer w/ zip. You should be able to recombine them in the following way:
```
mv linker-reproducer.z01.zip linker-reproducer.z01 # rename file to work around github upload limitations

zip -F linker-reproducer.zip --out combined-reproducer.zip
```
The following page has more details if needed: https://superuser.com/questions/336219/how-do-i-split-a-zip-file-into-multiple-segments

[linker-reproducer.zip](https://github.com/llvm/llvm-project/files/13030971/linker-reproducer.zip)

[linker-reproducer.z01.zip](https://github.com/llvm/llvm-project/files/13030980/linker-reproducer.z01.zip)

https://github.com/llvm/llvm-project/pull/69425


More information about the llvm-commits mailing list