From patchwork Fri Aug 2 12:33:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Fedotov X-Patchwork-Id: 170430 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp759386ile; Fri, 2 Aug 2019 05:34:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmABOW0I860UZKi1mBS7YqQRqS97amFTReWOxkHtP5roWCSeeEOlEOBaTSpUBeJeGzmAsi X-Received: by 2002:a62:5c3:: with SMTP id 186mr13491141pff.144.1564749267294; Fri, 02 Aug 2019 05:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564749267; cv=none; d=google.com; s=arc-20160816; b=sNi0gX2l1Jgvk0CpCaSM+badHpzsaQWLxKz9Q9R1jmeOwH6mjFEu4sPM7EPuxYgIRD CYYXO5al+bs3lWwJ+NTNBVP2cIf698qZ3McXaBizCEwacBqozFgxRav2CsoGOpitD6/o pqp34nK75wGtsON3h4XBDDrMiVoqV5ykn+3WmnVIPCYKvKoShkXpVBzv5gnnz67jF0RP dfdS/+Hr+4YRFgblr7eQYVvl/fpTRzAtPPPK1NswDqv0PbBZndjWk4zP3H3bH8Bu8iqw 2L7nzCMsh548E7i9IyTjzQRbN8bJF/L/wWHi2V+Fd/gHHSxyh/7iH2SW0W9KlLWyRAEJ /+JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=oCXqKrUi8p032xqF8G8VEUPuwLXQl1/PcpqwrD0t5hc=; b=hUe5oqTlkCzgmK+wcZ5kOYkV6ixxLVysxVXJjuyBGhJ3mikD6SK0SgNE3KnB7VMr4b FAxu8WXd4ZkFS7fUVecvT5SGaHXnXNe0xofeT15/5Q9o1VeocXu+SOCdzj0Z+pixZtaN dkHV371I8+ioZBXWfaUFSmv5buo4ja4S9+rXoi/R77Fp8VgPcQTL2e5vN3YKU5z+e0T8 YvkWiiBXf+MbVZG9cosYHsoCCDR6w35vqEJUHp1xZt20FyJ3dtpLAsrlSQmLBBmHWeuR yHWkzeQ5EmmrscI8gWRLyWo0bcr5JP+OTOlKAqXKMbc6/dQKVVAgvLURteR5jZ/lAKlt z1Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=L3sA9AoW; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pSq6CyvY; spf=pass (google.com: domain of newlib-return-17121-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-17121-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t2si41406553pgq.488.2019.08.02.05.34.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2019 05:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-17121-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=L3sA9AoW; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pSq6CyvY; spf=pass (google.com: domain of newlib-return-17121-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-17121-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=fkZnEWyaYDvX8sK8uweuaOIWt43snGA nVi24DIXGClDPVnWns51x+vajHh7YiwU5yDmNwrMzb3/ZooTmq2+1Bxb9aETS+jK wsZATudEHOSmZuOTinws2D2jhc/7U614+ucICX1NYbJVtgqs5a/LMhDuqo1vweQy PzHFJ86O5+lg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=xR73x7EDsHxbRpGUj9ro/tz5W2w=; b=L3sA9 AoWgvNI/rwknz7orXfzaavIplZpU9wK4jpKW5VaM8XTLgxC4/s+W/3mMkwR3E74z VDLxohRIQ36ODwT34jPe/7b7rRomOJQv8/zRSL7/i5x3SHFJf4nV6oG8Ll3rpMQQ A9miX/6SpyfOcimRrxBwJiUTuUjS/DkmJOf1UU= Received: (qmail 47734 invoked by alias); 2 Aug 2019 12:33:57 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 47632 invoked by uid 89); 2 Aug 2019 12:33:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f181.google.com Received: from mail-lj1-f181.google.com (HELO mail-lj1-f181.google.com) (209.85.208.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Aug 2019 12:33:55 +0000 Received: by mail-lj1-f181.google.com with SMTP id v24so72823353ljg.13 for ; Fri, 02 Aug 2019 05:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oCXqKrUi8p032xqF8G8VEUPuwLXQl1/PcpqwrD0t5hc=; b=pSq6CyvYhVPj/TpW52OE0D8K5Uw3cL5RrYjkQxMj2u+W/nMQuuDrQN78u2mzJxDm/M 7qxdPxGIsT36h/xHqFuWqYNVMhQb11/eeAMOJQXBl3FuLjWj3o/wlXlvNzuA+lObmUuD nH6EXd3ApseSpnwbErWRGU4l9tXkReqFhqg4d4us+/cplryvTrxqq8IFT+QaQ+3/8689 0YjMQUUAkh39cfT7UsAXg1/WapdBempKtZbIDcqkIIjZgKyUTX2nPqcX/+xi8DiX8pE3 IJ2FKMtCyljUp+Ujag1Ct58Wz8dY9LJXF1Uw76DdLMGzuFYUnbB5p5W7LZCFxNMGF0KW ksrQ== Return-Path: Received: from af-ubuntu18-hyperv.cmtknet.ru (relay.cmtk.ru. [195.5.145.226]) by smtp.gmail.com with ESMTPSA id u9sm12914135lfk.64.2019.08.02.05.33.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 05:33:52 -0700 (PDT) From: Alexander Fedotov To: newlib@sourceware.org Cc: Alexander Fedotov Subject: [PATCH v2 3/4] Align libgloss/arm and libc/sys/arm sources: Lite exit support Date: Fri, 2 Aug 2019 07:33:45 -0500 Message-Id: <20190802123346.5377-4-alfedotov@gmail.com> In-Reply-To: <20190802123346.5377-1-alfedotov@gmail.com> References: <20190802123346.5377-1-alfedotov@gmail.com> Applied changes from commit 2404223: * arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini when lite exit is enabled. --- newlib/libc/sys/arm/crt0.S | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.17.1 diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S index a55aa365b..5e677a23c 100644 --- a/newlib/libc/sys/arm/crt0.S +++ b/newlib/libc/sys/arm/crt0.S @@ -518,8 +518,17 @@ __change_mode: for _fini to be called at program exit. */ movs r4, r0 movs r5, r1 +#ifdef _LITE_EXIT + /* Make reference to atexit weak to avoid unconditionally pulling in + support code. Refer to comments in __atexit.c for more details. */ + .weak FUNCTION(atexit) + ldr r0, .Latexit + cmp r0, #0 + beq .Lweak_atexit +#endif ldr r0, .Lfini bl FUNCTION (atexit) +.Lweak_atexit: bl FUNCTION (_init) movs r0, r4 movs r1, r5 @@ -589,6 +598,13 @@ change_back: .LC2: .word __bss_end__ #ifdef __USES_INITFINI__ +#ifdef _LITE_EXIT +.Latexit: + .word FUNCTION(atexit) + + /* Weak reference _fini in case of lite exit. */ + .weak FUNCTION(_fini) +#endif .Lfini: .word FUNCTION(_fini) #endif