Open hstk30-hw opened 7 months ago
Stack dump: 0. Program arguments: /opt/buildtools/llvm-15.0.4/bin/ld.lld -pie -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o main /usr/lib/x86_64-linux-gnu/Scrt1.o /usr/lib/x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7.5.0/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7.5.0 -L/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/lib -L/usr/lib /tmp/main-fcc50c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/7.5.0/crtendS.o /usr/lib/x86_64-linux-gnu/crtn.o -T /home/lld/test/ELF/linkerscript/Output/discard-section-dynsym.s.tmp.lds #0 0x0000000000969aef PrintStackTraceSignalHandler(void*) Signals.cpp:0:0 #1 0x000000000096745c SignalHandler(int) Signals.cpp:0:0 #2 0x00007fa13119e980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980) #3 0x0000000000b36ce6 lld::elf::VersionTableSection::finalizeContents() (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0xb36ce6) #4 0x0000000000b8fbac finalizeSynthetic(lld::elf::SyntheticSection*) Writer.cpp:0:0 #5 0x0000000000babfb6 (anonymous namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true>>::finalizeSections() (.isra.1328) Writer.cpp:0:0 #6 0x0000000000bae0f1 void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true>>() (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0xbae0f1) #7 0x0000000000a77112 lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0xa77112) #8 0x0000000000a78ddf lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0xa78ddf) #9 0x0000000000a7a20c lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0xa7a20c) #10 0x00000000008e0ae1 lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) lld.cpp:0:0 #11 0x000000000085ec25 main (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0x85ec25) #12 0x00007fa12fc2ac87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0 #13 0x00000000008dfb7a _start (/opt/buildtools/llvm-15.0.4/bin/ld.lld+0x8dfb7a) clang-15: error: unable to execute command: Segmentation fault clang-15: error: linker command failed due to signal (use -v to see invocation)
Link script /home/lld/test/ELF/linkerscript/Output/discard-section-dynsym.s.tmp.lds like
SECTIONS { /DISCARD/ : { *(.dynsym .dynstr) } }
just from commit https://github.com/llvm/llvm-project/commit/f4a3569d0ad61907692fe10b1ffe1fa7763e9c26
It fail in https://github.com/llvm/llvm-project/blob/09327efdf0f02c4f865a4536db96cac539bb1c01/lld/ELF/SyntheticSections.cpp#L3120C1-L3124C2
It's this commit not cover this case?
command like
clang main.o -o main -T discard-section-dynsym.s.tmp.lds
main.c just a hello world.
CC @MaskRay
@llvm/issue-subscribers-lld-elf
Author: None (hstk30-hw)
Link script /home/lld/test/ELF/linkerscript/Output/discard-section-dynsym.s.tmp.lds like
just from commit https://github.com/llvm/llvm-project/commit/f4a3569d0ad61907692fe10b1ffe1fa7763e9c26
It fail in https://github.com/llvm/llvm-project/blob/09327efdf0f02c4f865a4536db96cac539bb1c01/lld/ELF/SyntheticSections.cpp#L3120C1-L3124C2
It's this commit not cover this case?
command like
main.c just a hello world.