1405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham/* 2368860124c34e101f2e9fda71870b5562108357aPete Delaney * Copyright (C) 2013 The Android Open Source Project 3405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * All rights reserved. 4405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * 5405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * Redistribution and use in source and binary forms, with or without 6405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * modification, are permitted provided that the following conditions 7405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * are met: 8405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * * Redistributions of source code must retain the above copyright 9405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * notice, this list of conditions and the following disclaimer. 10405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * * Redistributions in binary form must reproduce the above copyright 11405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * notice, this list of conditions and the following disclaimer in 12405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * the documentation and/or other materials provided with the 13405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * distribution. 14405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * 15405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham * SUCH DAMAGE. 27405b8029a6888f386adf3512113a33546141d1c8Raghu Gandham */ 28368860124c34e101f2e9fda71870b5562108357aPete Delaney 29368860124c34e101f2e9fda71870b5562108357aPete Delaneyextern void __cxa_finalize(void *); 30368860124c34e101f2e9fda71870b5562108357aPete Delaneyextern void *__dso_handle; 31368860124c34e101f2e9fda71870b5562108357aPete Delaney 32368860124c34e101f2e9fda71870b5562108357aPete Delaney__attribute__((visibility("hidden"),destructor)) 33368860124c34e101f2e9fda71870b5562108357aPete Delaneyvoid __on_dlclose() { 34368860124c34e101f2e9fda71870b5562108357aPete Delaney __cxa_finalize(&__dso_handle); 35368860124c34e101f2e9fda71870b5562108357aPete Delaney} 36368860124c34e101f2e9fda71870b5562108357aPete Delaney 37368860124c34e101f2e9fda71870b5562108357aPete Delaney#include "__dso_handle_so.h" 38368860124c34e101f2e9fda71870b5562108357aPete Delaney#include "atexit.h" 39