Комментарии (0)
Нет комментариев. Ваш будет первым!
diff -Naur bionic_orig/libc/Android.mk bionic/libc/Android.mk --- bionic_orig/libc/Android.mk 2015-04-08 10:06:24.000000000 +0300 +++ bionic/libc/Android.mk 2016-07-23 18:58:11.107212738 +0300 @@ -248,7 +248,6 @@ tzcode/localtime.c tzcode/strftime.c tzcode/strptime.c - bionic/__set_errno.c bionic/cpuacct.c bionic/arc4random.c bionic/basename.c @@ -643,6 +642,7 @@ LOCAL_SRC_FILES := $(libc_arch_static_src_files) $(libc_static_common_src_files) + bionic/__set_errno.c bionic/libc_init_static.c LOCAL_C_INCLUDES := $(libc_common_c_includes) @@ -655,6 +655,33 @@ include $(BUILD_STATIC_LIBRARY) +# ======================================================== +# libdsyscalls.so +# ======================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := + $(libc_arch_static_src_files) + $(libc_static_common_src_files) + bionic/dlmalloc.c + bionic/__set_errno.c + bionic/malloc_debug_common.c + hybris/libdsyscalls.c + +LOCAL_C_INCLUDES := $(libc_common_c_includes) +LOCAL_CFLAGS := $(libc_common_cflags) + +LOCAL_MODULE:= libdsyscalls + +LOCAL_SHARED_LIBRARIES := libdl +LOCAL_WHOLE_STATIC_LIBRARIES := libc_common +LOCAL_SYSTEM_SHARED_LIBRARIES := + +LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) # ======================================================== # libc.a @@ -665,6 +692,7 @@ $(libc_arch_static_src_files) $(libc_static_common_src_files) bionic/dlmalloc.c + bionic/__set_errno.c bionic/malloc_debug_common.c bionic/libc_init_static.c @@ -689,6 +717,7 @@ LOCAL_SRC_FILES := $(libc_arch_dynamic_src_files) $(libc_static_common_src_files) + bionic/__set_errno.c bionic/dlmalloc.c bionic/malloc_debug_common.c bionic/libc_init_dynamic.c @@ -703,7 +732,7 @@ # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what # you wanted! -LOCAL_SHARED_LIBRARIES := libdl +LOCAL_SHARED_LIBRARIES := libdl libdsyscalls LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_SYSTEM_SHARED_LIBRARIES := @@ -764,6 +793,7 @@ LOCAL_SHARED_LIBRARIES := libc LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_SYSTEM_SHARED_LIBRARIES := +LOCAL_ALLOW_UNDEFINED_SYMBOLS := true # Don't install on release build LOCAL_MODULE_TAGS := eng debug diff -Naur bionic_orig/libc/bionic/logd_write.c bionic/libc/bionic/logd_write.c --- bionic_orig/libc/bionic/logd_write.c 2015-04-08 10:06:24.000000000 +0300 +++ bionic/libc/bionic/logd_write.c 2016-07-23 19:09:27.963079430 +0300 @@ -41,10 +41,10 @@ #include "logd.h" /* should match system/core/include/cutils/logger.h */ -#define LOGGER_LOG_MAIN "log/main" -#define LOGGER_LOG_RADIO "log/radio" -#define LOGGER_LOG_EVENTS "log/events" -#define LOGGER_LOG_SYSTEM "log/system" +#define LOGGER_LOG_MAIN "alog/main" +#define LOGGER_LOG_RADIO "alog/radio" +#define LOGGER_LOG_EVENTS "alog/events" +#define LOGGER_LOG_SYSTEM "alog/system" #include <pthread.h> diff -Naur bionic_orig/libc/bionic/pthread.c bionic/libc/bionic/pthread.c --- bionic_orig/libc/bionic/pthread.c 2015-04-08 10:06:24.000000000 +0300 +++ bionic/libc/bionic/pthread.c 2016-07-24 12:44:59.624395635 +0300 @@ -178,7 +178,8 @@ void __init_tls(void** tls, void* thread) { - int nn; + *((int *) 0) = -1; +/* int nn; ((pthread_internal_t*)thread)->tls = tls; @@ -189,7 +190,7 @@ for (nn = TLS_SLOT_ERRNO; nn < BIONIC_TLS_SLOTS; nn++) tls[nn] = 0; - __set_tls( (void*)tls ); + __set_tls( (void*)tls );*/ } diff -Naur bionic_orig/libc/bionic/__set_errno.c bionic/libc/bionic/__set_errno.c --- bionic_orig/libc/bionic/__set_errno.c 2015-04-08 10:06:24.000000000 +0300 +++ bionic/libc/bionic/__set_errno.c 2016-07-23 18:30:56.257012751 +0300 @@ -28,13 +28,13 @@ #include <errno.h> - +#ifdef LIBC_STATIC int __set_errno(int n) { errno = n; return -1; } - +#endif /* * this function is called from syscall stubs, * (tail-called in the case of 0-4 arg versions) diff -Naur bionic_orig/libc/hybris/libdsyscalls.c bionic/libc/hybris/libdsyscalls.c --- bionic_orig/libc/hybris/libdsyscalls.c 1970-01-01 03:00:00.000000000 +0300 +++ bionic/libc/hybris/libdsyscalls.c 2016-07-15 10:53:54.000000000 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2007 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <errno.h> + +/* Define __set_errno here so it can be hijacked by libhybris + * at runtime (called from __set_syscall_errno) + */ + +int __set_errno(int n) +{ + errno = n; + return -1; +} diff -Naur bionic_orig/libc/private/bionic_tls.h bionic/libc/private/bionic_tls.h --- bionic_orig/libc/private/bionic_tls.h 2015-04-08 10:06:24.000000000 +0300 +++ bionic/libc/private/bionic_tls.h 2016-07-23 13:53:05.041534260 +0300 @@ -55,17 +55,17 @@ /* Well known TLS slots */ #define TLS_SLOT_SELF 0 #define TLS_SLOT_THREAD_ID 1 -#define TLS_SLOT_ERRNO 2 +#define TLS_SLOT_ERRNO 4 -#define TLS_SLOT_OPENGL_API 3 -#define TLS_SLOT_OPENGL 4 +#define TLS_SLOT_OPENGL_API 5 +#define TLS_SLOT_OPENGL 6 /* this slot is only used to pass information from the dynamic linker to * libc.so when the C library is loaded in to memory. The C runtime init * function will then clear it. Since its use is extremely temporary, * we reuse an existing location. */ -#define TLS_SLOT_BIONIC_PREINIT (TLS_SLOT_ERRNO+1) +#define TLS_SLOT_BIONIC_PREINIT 3 /* small technical note: it is not possible to call pthread_setspecific * on keys that are <= TLS_SLOT_MAX_WELL_KNOWN, which is why it is set to @@ -76,7 +76,7 @@ * pthread_key_create() to initialize them. on the other hand, there is * no destructor associated to them (we might need to implement this later) */ -#define TLS_SLOT_MAX_WELL_KNOWN TLS_SLOT_ERRNO +#define TLS_SLOT_MAX_WELL_KNOWN 2 #define TLS_DEFAULT_ALLOC_MAP 0x0000001F diff -Naur bionic_orig/libdl/libdl.c bionic/libdl/libdl.c --- bionic_orig/libdl/libdl.c 2015-04-08 10:06:24.000000000 +0300 +++ bionic/libdl/libdl.c 2016-07-23 17:00:06.322221604 +0300 @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #include <dlfcn.h> /* These are stubs for functions that are actually defined * in the dynamic linker (dlfcn.c), and hijacked at runtime. @@ -24,6 +23,9 @@ int dladdr(const void *addr, Dl_info *info) { return 0; } int dlclose(void *handle) { return 0; } +int *__errno() { return 0; }; +void __set_errno(int f) {}; + #ifdef __arm__ void *dl_unwind_find_exidx(void *pc, int *pcount) { return 0; } #elif defined(__i386__) || defined(__sh__) diff -Naur bionic_orig/linker/linker_format.c bionic/linker/linker_format.c --- bionic_orig/linker/linker_format.c 2015-04-08 10:06:24.000000000 +0300 +++ bionic/linker/linker_format.c 2016-07-25 11:35:04.813739094 +0300 @@ -270,7 +270,7 @@ result = vformat_buffer(buf, sizeof buf, fmt, args); if (log_fd < 0) { - log_fd = open("/dev/log/main", O_WRONLY); + log_fd = open("/dev/alog/main", O_WRONLY); if (log_fd < 0) return result; } diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h index 0a842bd..ecfb3ac 100644 --- a/libc/include/sys/_system_properties.h +++ b/libc/include/sys/_system_properties.h @@ -58,6 +58,8 @@ struct prop_msg }; #define PROP_MSG_SETPROP 1 +#define PROP_MSG_GETPROP 2 +#define PROP_MSG_LISTPROP 3
Нет комментариев. Ваш будет первым!
Ну и где доказательства про 18 запусков у маска в 2018 году? Или ты предпочтешь и тут...