Clean up the linker a bit, remove prelinking support.
Also make the errors more readable, since none of us seemed to know
what they actually meant. The new style is still as verbose as the
old, but that's probably necessary in the absence of chained exceptions
in C. Here's what you'd see if you try to boot after removing
libsurfaceflinger.so:
32267 32267 E AndroidRuntime: java.lang.UnsatisfiedLinkError: Cannot load library: (linker.c:1629, pid 32259) soinfo_link_image: could not load library "libsystem_server.so" needed by "libandroid_servers.so"; caused by (linker.c:1629, pid 32259) soinfo_link_image: could not load library "libsurfaceflinger.so" needed by "libsystem_server.so"; caused by (linker.c:709, pid 32259) load_library: library "libsurfaceflinger.so" not found
This patch also fixes almost all of the compiler warnings.
Change-Id: I64bb59aed6d4e039c15ea45be2367f319ef879f8
diff --git a/linker/linker_format.h b/linker/linker_format.h
index 6ae2bad..3766b62 100644
--- a/linker/linker_format.h
+++ b/linker/linker_format.h
@@ -31,6 +31,10 @@
#include <stdarg.h>
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Formatting routines for the dynamic linker's debug traces */
/* We want to avoid dragging the whole C library fprintf() */
/* implementation into the dynamic linker since this creates */
@@ -38,4 +42,8 @@
int format_buffer(char *buffer, size_t bufsize, const char *format, ...);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* _LINKER_FORMAT_H */