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_environ.h b/linker/linker_environ.h
index 98ad1de..d5f75a1 100644
--- a/linker/linker_environ.h
+++ b/linker/linker_environ.h
@@ -28,6 +28,10 @@
 #ifndef LINKER_ENVIRON_H
 #define LINKER_ENVIRON_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Call this function before anything else. 'vecs' must be the pointer
  * to the environment block in the ELF data block. The function returns
  * the start of the aux vectors after the env block.
@@ -47,8 +51,12 @@
  * after this function. */
 extern const char* linker_env_get(const char* name);
 
-/* Remove unsecure environment variables. This should be used when
+/* Remove insecure environment variables. This should be used when
  * running setuid programs. */
 extern void        linker_env_secure(void);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* LINKER_ENVIRON_H */