From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687AbcHSLXm (ORCPT ); Fri, 19 Aug 2016 07:23:42 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44724 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750997AbcHSLXk (ORCPT ); Fri, 19 Aug 2016 07:23:40 -0400 Subject: Re: [PATCH] UML: don't discard .text.exit section To: Andrey Ryabinin , Dmitry Vyukov References: <1471446611-16250-1-git-send-email-aryabinin@virtuozzo.com> <995ff767-9220-f9c8-c052-2b717cc7e91d@virtuozzo.com> <627a7126-87e6-0a89-19c5-612c5fb9d18f@virtuozzo.com> Cc: Jeff Dike , user-mode-linux-devel , LKML , Stefan Traby , stable From: Richard Weinberger Message-ID: Date: Fri, 19 Aug 2016 13:16:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <627a7126-87e6-0a89-19c5-612c5fb9d18f@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.08.2016 12:48, Andrey Ryabinin wrote: > On 08/19/2016 03:14 AM, Dmitry Vyukov wrote: >> On Thu, Aug 18, 2016 at 3:08 AM, Andrey Ryabinin >> wrote: >>> >>>> >>>> Sorry for delays, I am travelling. >>>> Do we need ".fini_array" section? It's also destructors that we don't >>>> run. Or does UML use them? Does discarding ".fini_array" help? >>>> >>> >>> libc has desctructors and use them for whatever purpose it needs. >> >> >> Does UML actually gracefully exit running global destructors? That >> would also require gracefully shutting down all threads/cpus. Doesn't >> it just _exit (or syscall(SYS_exit_group))? >> > > Sigh, I dunno, I didn't look that far. My intention was to fix build and keep old behavior unaffected. > If you want to wipe destructors, and think that this is ok, go ahead. UML exits like any regular C program does. The main() function is in arch/um/os-Linux/main.c, when the kernel terminates, hence linux_main() returns back to main() it just returns the exit code. At this point libc's destructors will run, right? Thanks, //richard