diff options
author | Ryan Prichard <rprichard@google.com> | 2019-02-07 21:31:31 -0800 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2019-02-07 21:48:42 -0800 |
commit | 1990ba5601f5230851d1e2112c28bebbf78c3f40 (patch) | |
tree | 89ac1bae3d31e58b42324787a2bf038ffe0b59f4 /libc/malloc_hooks/malloc_hooks.cpp | |
parent | f827d82cdde0fe7f11015fb5ead39bac861ab6bd (diff) |
Fix linker self-exec detection
When the linker is invoked on itself, (`linker64 /system/bin/linker64`),
the linker prints an error, because self-invocation isn't allowed. The
current method for detecting self-invocation fails because the second
linker instance can crash in a constructor function before reaching
__linker_init.
Fix the problem by moving the error check into a constructor function,
which finishes initializing libc sufficiently to call async_safe_fatal.
The only important thing missing is __libc_sysinfo on 32-bit x86. The aux
vector isn't readily accessible, so use the fallback int 0x80.
Bug: http://b/123637025
Test: bionic unit tests (32-bit x86)
Change-Id: I8be6369e8be3938906628ae1f82be13e6c510119
Diffstat (limited to 'libc/malloc_hooks/malloc_hooks.cpp')
0 files changed, 0 insertions, 0 deletions