summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 176ccd4)
raw | patch | inline | side by side (parent: 176ccd4)
author | Dmitriy Ivanov <dimitry@google.com> | |
Tue, 1 Jul 2014 21:24:45 +0000 (14:24 -0700) | ||
committer | Dmitriy Ivanov <dimitry@google.com> | |
Tue, 1 Jul 2014 21:46:03 +0000 (14:46 -0700) |
Change-Id: Ia8d6e256768fa51786d0139d3f3b6e9e4bebe027
libc/bionic/libc_logging.cpp | patch | blob | history | |
linker/linker.cpp | patch | blob | history |
index 8966a5f5e153c9cf0b8b084aad7ff5cc5d631c14..8b3d3f1fc3f57963bdd0a117d168c540f19a7777 100644 (file)
BufferOutputStream os(msg, sizeof(msg));
out_vformat(os, format, args);
- // TODO: log to stderr for the benefit of "adb shell" users.
+ // log to stderr for the benefit of "adb shell" users.
+ write(2, msg, strlen(msg));
// Log to the log for the benefit of regular app developers (whose stdout and stderr are closed).
__libc_write_log(ANDROID_LOG_FATAL, "libc", msg);
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 442f7cededa3f7bfecd1cbf7ff89d5af4b28ac49..bf923c197ddb6fe4a6a9b515f8ac506a579f6373 100644 (file)
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
#define DISALLOW_ALLOCATION(return_type, name, ...) \
return_type name __VA_ARGS__ \
{ \
- const char* msg = "ERROR: " #name " called from the dynamic linker!\n"; \
- __libc_format_log(ANDROID_LOG_FATAL, "linker", "%s", msg); \
- write(2, msg, strlen(msg)); \
- abort(); \
+ __libc_fatal("ERROR: " #name " called from the dynamic linker!\n"); \
}
DISALLOW_ALLOCATION(void*, malloc, (size_t u __unused));
DISALLOW_ALLOCATION(void, free, (void* u __unused));
@@ -467,10 +464,8 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name,
static_cast<size_t>(s->st_size));
return s;
default:
- const char* msg = "FATAL: Unexpected ST_BIND\n";
- __libc_format_log(ANDROID_LOG_FATAL, "linker", "%s", msg);
- write(2, msg, strlen(msg));
- abort();
+ __libc_fatal("ERROR: Unexpected ST_BIND value: %d for '%s' in '%s'",
+ ELF_ST_BIND(s->st_info), name, si->name);
}
}