Mark the link register as undefined at the entry point, as was done for amd64 (D40794), aarch64 (D40844), i386 (D40949) and riscv (D46406).
.rtld_start calls the program's _start with blrl, so unwinding the main thread of a dynamically linked program reaches it, but its FDE (from the .cfi_startproc in _ENTRY()) has no rule for the return address. LLVM libunwind then reuses the stale LR value of the innermost frame as the return address (https://reviews.llvm.org/D83573, which the base copy reverts in rG5866c369e4fd for PR 256864), unwinds into the argument and environment strings above the initial stack frame and crashes. On powerpc64 this breaks every main thread backtrace in programs that link their own libunwind. ClickHouse, for example, crashes whenever clickhouse-client or clickhouse-local throws an exception on its main thread, because the exception collects a stack trace.
Static binaries and new threads are not affected, since exec_setregs() and cpu_set_upcall() start them with LR cleared.