Force _start to be the top frame for the linker.

I noticed that sometimes the old unwinder will add an extra PC 0 frame
after this change, but the new unwinder works in all cases. I'm not going
to fix the old unwinder since I plan to remove it very soon.

Bug: 67784501

Test: Forced a crash in the linker and verified that the unwind
Test: stops in __dl_start. Tested on arm/aarch64/x86/x86_64.

Change-Id: Id6585768023256be5c1d341df7b06b786a220b40
diff --git a/linker/arch/arm/begin.S b/linker/arch/arm/begin.S
index 480047a..80d9fe1 100644
--- a/linker/arch/arm/begin.S
+++ b/linker/arch/arm/begin.S
@@ -29,6 +29,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(_start)
+  // Force unwinds to end in this function.
+  .cfi_undefined r14
+
   mov r0, sp
   bl __linker_init
 
diff --git a/linker/arch/arm64/begin.S b/linker/arch/arm64/begin.S
index a6ea583..a947475 100644
--- a/linker/arch/arm64/begin.S
+++ b/linker/arch/arm64/begin.S
@@ -29,6 +29,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(_start)
+  // Force unwinds to end in this function.
+  .cfi_undefined x30
+
   mov x0, sp
   bl __linker_init
 
diff --git a/linker/arch/x86/begin.c b/linker/arch/x86/begin.c
index a734f25..331b79e 100644
--- a/linker/arch/x86/begin.c
+++ b/linker/arch/x86/begin.c
@@ -32,6 +32,9 @@
 extern unsigned __linker_init(void* raw_args);
 
 __LIBC_HIDDEN__ void _start() {
+  // Force unwinds to end in this function.
+  asm volatile(".cfi_undefined \%eip");
+
   void (*start)(void);
 
   void* raw_args = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
diff --git a/linker/arch/x86_64/begin.S b/linker/arch/x86_64/begin.S
index 7945a31..4722301 100644
--- a/linker/arch/x86_64/begin.S
+++ b/linker/arch/x86_64/begin.S
@@ -29,6 +29,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(_start)
+  // Force unwinds to end in this function.
+  .cfi_undefined %rip
+
   mov %rsp, %rdi
   call __linker_init