Always log errno when aborting.
(Where errno is relevant.)
Also consistently use -1 as the fd for anonymous mmaps. (It doesn't matter,
but it's more common, and potentially more intention-revealing.)
Bug: http://b/65608572
Test: ran tests
Change-Id: Ie9a207632d8242f42086ba3ca862519014c3c102
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index e8b02d6..3862d8c 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -276,11 +276,8 @@
const char* executable_path = get_executable_path();
soinfo* si = soinfo_alloc(&g_default_namespace, executable_path, &file_stat, 0, RTLD_GLOBAL);
- if (si == nullptr) {
- async_safe_fatal("Couldn't allocate soinfo: out of memory?");
- }
- /* bootstrap the link map, the main exe always needs to be first */
+ // Bootstrap the link map, the main exe always needs to be first.
si->set_main_executable();
link_map* map = &(si->link_map_head);