rtld: add .cfi_undefined lr to rtld_start.S on powerpc*

Without it, LLVM libunwind doesn't know where to stop when unwinding the
main thread, so it uses a stale LR as the return address and crashes.
Our libunwind doesn't do that since 5866c369e4 reverted it, but
programs that bundle their own copy, like ClickHouse, are hit by it.

amd64, arm64, i386 and riscv already have the same annotation.

Approved by:	jhibbits
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D60740
This commit is contained in:
Piotr Kubaj committed 2026-10-15 15:59:57 +02:00
1 parent d7d237ce73
commit c4fde87a32
2 files changed
+2

No files matched your search

+1
View File
@@ -34,6 +34,7 @@
.extern _DYNAMIC
_ENTRY(.rtld_start)
.cfi_undefined lr
stwu %r1,-48(%r1) /* 16-byte aligned stack for reg saves +
exit_proc & obj _rtld args +
backchain & lrsave stack frame */
+1
View File
@@ -33,6 +33,7 @@
.extern _DYNAMIC
_ENTRY(_rtld_start)
.cfi_undefined lr
stdu %r1,-144(%r1) /* 16-byte aligned stack for reg saves +
exit_proc & obj _rtld args +
backchain & lrsave stack frame */