Make dl_iterate_phdr weak in libdl.
This needs to be defined as weak because it is also defined in libc.a.
Without this, static executables will have a multiple definition
error.
Test: make checkbuild
Bug: None
Change-Id: If2024ef4191c8ab7cf087d21d76fefdc92b58da1
diff --git a/libdl/libdl.c b/libdl/libdl.c
index 6a95629..f7ca3f1 100644
--- a/libdl/libdl.c
+++ b/libdl/libdl.c
@@ -128,6 +128,11 @@
}
#endif
+/*
+ * This needs to be defined as weak because it is also defined in libc.a.
+ * Without this, static executables will have a multiple definition error.
+ */
+__attribute__((__weak__))
int dl_iterate_phdr(int (*cb)(struct dl_phdr_info* info, size_t size, void* data), void* data) {
return __loader_dl_iterate_phdr(cb, data);
}