[llvm] [RuntimeDyld][ELF][AArch64] Fix resolveAArch64ShortBranch. (PR #92245)

Michał Górny via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 1 00:02:50 PDT 2024


mgorny wrote:

The added LLVM test is failing for me when performing 32-bit x86 build. Presumably it fails on all 32-bit systems:

```
FAIL: LLVM :: ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s (28964 of 52814)
******************** TEST 'LLVM :: ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
RUN: at line 1: /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.tmp /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s
+ /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.tmp /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s
RUN: at line 2: /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.tmp
+ /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.tmp
llvm-rtdyld: /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:497: void llvm::RuntimeDyldELF::resolveAArch64Relocation(const llvm::SectionEntry&, uint64_t, uint64_t, uint32_t, int64_t): Assertion `isInt<28>(BranchImm)' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.tmp
 #0 0xffffffffee4b67ee llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/../lib/libLLVM.so.19.0git1af0778f+0xd517ee)
 #1 0xffffffffee4b6cef PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #2 0xffffffffee4b3995 llvm::sys::RunSignalHandlers() (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/../lib/libLLVM.so.19.0git1af0778f+0xd4e995)
 #3 0xffffffffee4b3b23 SignalHandler(int) Signals.cpp:0:0
 #4 0xfffffffff7fb3590 (linux-gate.so.1+0x590)
 #5 0xfffffffff7fb3579 (linux-gate.so.1+0x579)
 #6 0xffffffffed302347 (/usr/lib/libc.so.6+0x93347)
 #7 0xffffffffed2a72f1 raise (/usr/lib/libc.so.6+0x382f1)
 #8 0xffffffffed28e2b8 abort (/usr/lib/libc.so.6+0x1f2b8)
 #9 0xffffffffed28e1be (/usr/lib/libc.so.6+0x1f1be)
#10 0xffffffffed29f32b (/usr/lib/libc.so.6+0x3032b)
#11 0xfffffffff144c1e4 .L1696 RuntimeDyldELF.cpp:0:0
#12 0xfffffffff14510ff llvm::RuntimeDyldELF::resolveAArch64Branch(unsigned int, llvm::RelocationValueRef const&, llvm::object::content_iterator<llvm::object::RelocationRef>, std::map<llvm::RelocationValueRef, unsigned int, std::less<llvm::RelocationValueRef>, std::allocator<std::pair<llvm::RelocationValueRef const, unsigned int>>>&) (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/../lib/libLLVM.so.19.0git1af0778f+0x3cec0ff)
#13 0xfffffffff1451b7c .L3815 RuntimeDyldELF.cpp:0:0
#14 0xfffffffff142e678 llvm::RuntimeDyldImpl::loadObjectImpl(llvm::object::ObjectFile const&) (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/../lib/libLLVM.so.19.0git1af0778f+0x3cc9678)
#15 0xfffffffff1450076 llvm::RuntimeDyldELF::loadObject(llvm::object::ObjectFile const&) (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/../lib/libLLVM.so.19.0git1af0778f+0x3ceb076)
#16 0xfffffffff1425906 llvm::RuntimeDyld::loadObject(llvm::object::ObjectFile const&) (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/../lib/libLLVM.so.19.0git1af0778f+0x3cc0906)
#17 0x565910c7 linkAndVerify() (.isra.0) llvm-rtdyld.cpp:0:0
#18 0x565807ba .L4257 llvm-rtdyld.cpp:0:0
#19 0xffffffffed28fe23 (/usr/lib/libc.so.6+0x20e23)
#20 0xffffffffed28fee8 __libc_start_main (/usr/lib/libc.so.6+0x20ee8)
#21 0x565821d7 _start (/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-rtdyld+0xa1d7)
/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.script: line 2: 154586 Aborted                 (core dumped) /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/bin/llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=/var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_xsec_branch.s /var/tmp/portage/sys-devel/llvm-19.0.0_pre20240601/work/llvm_build-abi_x86_32.x86/test/ExecutionEngine/RuntimeDyld/AArch64/Output/ELF_ARM64_xsec_branch.s.tmp

--

********************
```

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


More information about the llvm-commits mailing list