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_phdr.h b/linker/linker_phdr.h
index d542e46..753c7e7 100644
--- a/linker/linker_phdr.h
+++ b/linker/linker_phdr.h
@@ -37,6 +37,10 @@
#include "linker.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* See linker_phdr.c for all usage documentation */
int
@@ -52,21 +56,18 @@
Elf32_Addr
phdr_table_get_load_size(const Elf32_Phdr* phdr_table,
- int phdr_count);
+ size_t phdr_count);
int
phdr_table_reserve_memory(const Elf32_Phdr* phdr_table,
- int phdr_count,
- Elf32_Addr required_base,
- void** load_start,
- Elf32_Addr* load_size,
- Elf32_Addr* load_bias);
+ size_t phdr_count,
+ void** load_start,
+ Elf32_Addr* load_size,
+ Elf32_Addr* load_bias);
int
phdr_table_load_segments(const Elf32_Phdr* phdr_table,
int phdr_count,
- void* load_start,
- Elf32_Addr load_size,
Elf32_Addr load_bias,
int fd);
@@ -109,4 +110,8 @@
int phdr_count,
Elf32_Addr load_bias);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* LINKER_PHDR_H */