platform_bionic/libc
Ryan Prichard 8f639a4096 Allow invoking the linker on an executable.
The executable can be inside a zip file using the same syntax used for
shared objects: path.zip!/libentry.so.

The linker currently requires an absolute path. This restriction could be
loosened, but it didn't seem important? If it allowed non-absolute paths,
we'd need to decide how to handle:
 - foo/bar      (relative to CWD?)
 - foo          (search PATH / LD_LIBRARY_PATH, or also relative to CWD?)
 - foo.zip!/bar (normalize_path() requires an absolute path)

The linker adjusts the argc/argv passed to main() and to constructor
functions to hide the initial linker argument, but doesn't adjust the auxv
vector or files like /proc/self/{exe,cmdline,auxv,stat}. Those files will
report that the kernel loaded the linker as an executable.

I think the linker_logger.cpp change guarding against (g_argv == NULL)
isn't actually necessary, but it seemed like a good idea given that I'm
delaying initialization of g_argv until after C++ constructors have run.

Bug: http://b/112050209
Test: bionic unit tests
Change-Id: I846faf98b16fd34218946f6167e8b451897debe5
2018-10-10 14:31:06 -07:00
..
arch-arm Remove workarounds for old versions of clang and GCC. 2018-07-11 13:18:29 -07:00
arch-arm64 Merge "Annotate siglongjmp for HWASan." 2018-09-06 21:35:09 +00:00
arch-common/bionic Call __emutls_unregister_key on dlclose 2018-06-19 13:22:36 -07:00
arch-mips Remove __overloadable/__RENAME_CLANG 2018-02-06 13:35:56 -08:00
arch-mips64 bionic: add vdso clock_getres 2017-12-07 09:41:48 -08:00
arch-x86 Merge "Remove valgrind workarounds." 2018-06-13 00:30:28 +00:00
arch-x86_64 Make memcpy memmove 2018-06-11 18:12:45 +00:00
async_safe Add async_safe_format_fd_va_list 2018-10-08 13:27:16 -07:00
bionic Allow invoking the linker on an executable. 2018-10-10 14:31:06 -07:00
dns Clear the resolver timeout when setting default __res_params 2018-08-09 17:58:35 +09:00
include <sys/param.h>: pollute the namespace with <endian.h>. 2018-10-05 14:54:48 -07:00
kernel Update to v4.17.3 kernel headers. 2018-06-27 14:12:29 -07:00
malloc_debug Add new parameter for creation of MapInfo object. 2018-10-04 08:41:10 -07:00
malloc_hooks Fix malloc_hooks for hooks_write_malloc_leak_info. 2018-07-18 15:25:45 +01:00
private Allow invoking the linker on an executable. 2018-10-10 14:31:06 -07:00
seccomp seccomp: Generate the policy files at compile time 2018-08-06 11:10:25 -07:00
stdio Make fclose/pclose distinct. 2018-10-01 16:17:37 -07:00
stdlib Add PR_SET_VMA and PR_SET_VMA_ANON_NAME to <sys/prctl.h>. 2018-08-22 10:36:23 -07:00
system_properties Add PR_SET_VMA and PR_SET_VMA_ANON_NAME to <sys/prctl.h>. 2018-08-22 10:36:23 -07:00
tools seccomp: Generate the policy files at compile time 2018-08-06 11:10:25 -07:00
tzcode Add strptime %s. 2018-02-28 16:29:40 -08:00
upstream-freebsd Add reallocarray(3). 2018-09-26 14:24:18 -07:00
upstream-netbsd Remove unused NetBSD compatibility cruft. 2018-09-20 13:27:41 -07:00
upstream-openbsd Add reallocarray(3). 2018-09-26 14:24:18 -07:00
versioner-dependencies Unified sysroot: kill arch-specific include dirs. 2017-10-12 13:19:51 -07:00
Android.bp Merge "Disable STL for crt objects" 2018-09-27 23:23:19 +00:00
fs_config_generator.py Revert "Revert "move android_ids into bionic"" 2016-12-13 23:47:25 +00:00
libc.arm.map Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libc.arm64.map Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libc.map.txt Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libc.mips.map Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libc.mips64.map Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libc.x86.map Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libc.x86_64.map Add reallocarray(3). 2018-09-26 14:24:18 -07:00
libstdc++.arm.map Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
libstdc++.arm64.map Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
libstdc++.map.txt Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
libstdc++.mips.map Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
libstdc++.mips64.map Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
libstdc++.x86.map Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
libstdc++.x86_64.map Mark new/delete as weak in the NDK stubs. 2017-07-28 11:01:33 -07:00
MODULE_LICENSE_BSD
NOTICE Add reallocarray(3). 2018-09-26 14:24:18 -07:00
SECCOMP_BLACKLIST_APP.TXT Allow several syscalls to app process 2018-03-28 16:30:20 -07:00
SECCOMP_BLACKLIST_COMMON.TXT Split zygote's seccomp filter into two 2018-01-04 12:28:40 -08:00
SECCOMP_WHITELIST_APP.TXT Move pipe, open, and getdents from the APP to COMMON seccomp whitelist. 2018-09-11 19:20:34 -04:00
SECCOMP_WHITELIST_COMMON.TXT Move pipe, open, and getdents from the APP to COMMON seccomp whitelist. 2018-09-11 19:20:34 -04:00
SECCOMP_WHITELIST_GLOBAL.TXT Create global seccomp policy. 2017-07-21 20:30:21 -07:00
SECCOMP_WHITELIST_SYSTEM.TXT Add bpf syscall to seccomp whitelist 2018-01-18 12:08:34 -08:00
SYSCALLS.TXT Add sigset64_t and accompanying functions. 2018-01-30 18:47:16 -08:00
version_script.txt