Make the _Unwind_Ptr declaration match clang's.
Bug: https://issuetracker.google.com/37126620
Test: builds, boots angler
Change-Id: I7d4a9b998f2e5c4c7b0beed87807d7b76a564c5c
diff --git a/libc/include/link.h b/libc/include/link.h
index 0d07cb9..dd3b99f 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -28,6 +28,7 @@
#ifndef _LINK_H_
#define _LINK_H_
+#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
@@ -55,7 +56,7 @@
#endif
#ifdef __arm__
-typedef long unsigned int* _Unwind_Ptr;
+typedef uintptr_t _Unwind_Ptr;
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr, int*);
#endif
diff --git a/linker/linker.cpp b/linker/linker.cpp
index f43d6fc..39062e6 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -361,16 +361,14 @@
//
// Intended to be called by libc's __gnu_Unwind_Find_exidx().
_Unwind_Ptr do_dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
- uintptr_t addr = reinterpret_cast<uintptr_t>(pc);
-
for (soinfo* si = solist_get_head(); si != 0; si = si->next) {
- if ((addr >= si->base) && (addr < (si->base + si->size))) {
+ if ((pc >= si->base) && (pc < (si->base + si->size))) {
*pcount = si->ARM_exidx_count;
return reinterpret_cast<_Unwind_Ptr>(si->ARM_exidx);
}
}
*pcount = 0;
- return nullptr;
+ return 0;
}
#endif