am 442d41fc: Merge "Write message to stderr on __libc_fatal()"
* commit '442d41fc128646d7f572da842d5d5b1918341c53': Write message to stderr on __libc_fatal()
This commit is contained in:
commit
51c812cd22
@ -619,7 +619,8 @@ static void __libc_fatal(const char* format, va_list args) {
|
|||||||
BufferOutputStream os(msg, sizeof(msg));
|
BufferOutputStream os(msg, sizeof(msg));
|
||||||
out_vformat(os, format, args);
|
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).
|
// 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);
|
__libc_write_log(ANDROID_LOG_FATAL, "libc", msg);
|
||||||
|
@ -168,10 +168,7 @@ static unsigned bitmask[4096];
|
|||||||
#define DISALLOW_ALLOCATION(return_type, name, ...) \
|
#define DISALLOW_ALLOCATION(return_type, name, ...) \
|
||||||
return_type name __VA_ARGS__ \
|
return_type name __VA_ARGS__ \
|
||||||
{ \
|
{ \
|
||||||
const char* msg = "ERROR: " #name " called from the dynamic linker!\n"; \
|
__libc_fatal("ERROR: " #name " called from the dynamic linker!\n"); \
|
||||||
__libc_format_log(ANDROID_LOG_FATAL, "linker", "%s", msg); \
|
|
||||||
write(2, msg, strlen(msg)); \
|
|
||||||
abort(); \
|
|
||||||
}
|
}
|
||||||
DISALLOW_ALLOCATION(void*, malloc, (size_t u __unused));
|
DISALLOW_ALLOCATION(void*, malloc, (size_t u __unused));
|
||||||
DISALLOW_ALLOCATION(void, free, (void* 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));
|
static_cast<size_t>(s->st_size));
|
||||||
return s;
|
return s;
|
||||||
default:
|
default:
|
||||||
const char* msg = "FATAL: Unexpected ST_BIND\n";
|
__libc_fatal("ERROR: Unexpected ST_BIND value: %d for '%s' in '%s'",
|
||||||
__libc_format_log(ANDROID_LOG_FATAL, "linker", "%s", msg);
|
ELF_ST_BIND(s->st_info), name, si->name);
|
||||||
write(2, msg, strlen(msg));
|
|
||||||
abort();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user