Merge "Enable __cxa_atexit && __cxa_finalize for linker"
This commit is contained in:
commit
d2bd3c4717
@ -8,6 +8,7 @@ LOCAL_SRC_FILES:= \
|
|||||||
linker.cpp \
|
linker.cpp \
|
||||||
linker_allocator.cpp \
|
linker_allocator.cpp \
|
||||||
linker_environ.cpp \
|
linker_environ.cpp \
|
||||||
|
linker_libc_support.c \
|
||||||
linker_phdr.cpp \
|
linker_phdr.cpp \
|
||||||
rt.cpp \
|
rt.cpp \
|
||||||
|
|
||||||
|
@ -32,6 +32,9 @@ template<typename T, typename Allocator>
|
|||||||
class LinkedList {
|
class LinkedList {
|
||||||
public:
|
public:
|
||||||
LinkedList() : head_(nullptr), tail_(nullptr) {}
|
LinkedList() : head_(nullptr), tail_(nullptr) {}
|
||||||
|
~LinkedList() {
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
void push_front(T* const element) {
|
void push_front(T* const element) {
|
||||||
LinkedListEntry<T>* new_entry = Allocator::alloc();
|
LinkedListEntry<T>* new_entry = Allocator::alloc();
|
||||||
|
@ -2167,16 +2167,6 @@ static void init_linker_info_for_gdb(ElfW(Addr) linker_base) {
|
|||||||
* and other non-local data at this point.
|
* and other non-local data at this point.
|
||||||
*/
|
*/
|
||||||
static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(Addr) linker_base) {
|
static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(Addr) linker_base) {
|
||||||
/* NOTE: we store the args pointer on a special location
|
|
||||||
* of the temporary TLS area in order to pass it to
|
|
||||||
* the C Library's runtime initializer.
|
|
||||||
*
|
|
||||||
* The initializer must clear the slot and reset the TLS
|
|
||||||
* to point to a different location to ensure that no other
|
|
||||||
* shared library constructor can access it.
|
|
||||||
*/
|
|
||||||
__libc_init_tls(args);
|
|
||||||
|
|
||||||
#if TIMING
|
#if TIMING
|
||||||
struct timeval t0, t1;
|
struct timeval t0, t1;
|
||||||
gettimeofday(&t0, 0);
|
gettimeofday(&t0, 0);
|
||||||
@ -2403,6 +2393,8 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) {
|
|||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__libc_init_tls(args);
|
||||||
|
|
||||||
// Initialize the linker's own global variables
|
// Initialize the linker's own global variables
|
||||||
linker_so.CallConstructors();
|
linker_so.CallConstructors();
|
||||||
|
|
||||||
@ -2412,7 +2404,6 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) {
|
|||||||
solist = get_libdl_info();
|
solist = get_libdl_info();
|
||||||
sonext = get_libdl_info();
|
sonext = get_libdl_info();
|
||||||
|
|
||||||
|
|
||||||
// We have successfully fixed our own relocations. It's safe to run
|
// We have successfully fixed our own relocations. It's safe to run
|
||||||
// the main part of the linker now.
|
// the main part of the linker now.
|
||||||
args.abort_message_ptr = &g_abort_message;
|
args.abort_message_ptr = &g_abort_message;
|
||||||
|
17
linker/linker_libc_support.c
Normal file
17
linker/linker_libc_support.c
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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 "../libc/arch-common/bionic/__dso_handle.h"
|
@ -366,7 +366,7 @@ endif
|
|||||||
|
|
||||||
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
|
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
|
||||||
# add target to run lp32 tests
|
# add target to run lp32 tests
|
||||||
bionic-unit-tests-run-on-host32: bionic-unit-tests $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
|
bionic-unit-tests-run-on-host32: bionic-unit-tests_32 $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
|
||||||
if [ ! -d /system -o ! -d /system/bin ]; then \
|
if [ ! -d /system -o ! -d /system/bin ]; then \
|
||||||
echo "Attempting to create /system/bin"; \
|
echo "Attempting to create /system/bin"; \
|
||||||
sudo mkdir -p -m 0777 /system/bin; \
|
sudo mkdir -p -m 0777 /system/bin; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user