From patchwork Wed Jul 31 16:38:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Fedotov X-Patchwork-Id: 170194 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4245999ile; Wed, 31 Jul 2019 09:38:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqytD+oICAjbTAoAQ/JVoXprIyz3Ado8llDhKfWxmr6GNzd3catKst8pH/6uETmM8qJqENln X-Received: by 2002:a17:90a:c68c:: with SMTP id n12mr3861371pjt.33.1564591129501; Wed, 31 Jul 2019 09:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564591129; cv=none; d=google.com; s=arc-20160816; b=Y/os2SIWX/9QXUx1Ag/zkFE/VOPZFaTwc2gsoOYZHm0fjcm7A0quJebCwLzw42Ao2i hf/AqzEjfPiPtGjItyIRRoW+1Ro+8DbPPBZtHgjtW9bqyzMJCfWye5kozI/GI7Yta8e/ 7nGYMNThfCOVEIBICZt/SvsXE/7+X/O/kh38AWS3g2JcKAAFmr9p08Nt0f1RriI31dR/ GDiZ2icOJvsBkRgo97v4n7Ef2FCW3aU+dA4DREFgKNHy7rcJu+Ey04CcnlQtnDZ0o9SY fdD1AeHTvupG7Ad6HDI1S/JQVXXEUJiHZTg7H5/vxHjfikYlmZJu9/lmns4AzjUH9Xd5 zSXg== 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=SO6nCUY6/ihAUyyRWtH74/pBtcGKX84BNcFboYthc7A=; b=BNFlLVWQnmXNCUc/gv+QOabCAhzEOIC+X0sjgTydTxJtbKmTYWXrRbBSmLp/7PD9G2 41q6ezhtCY8X7EADUwQDpxtK6KVLP91nluYOPclOm/79Hhmgw6jkPu4JyuIl1YQ1T5DJ +zM5L7FU7fvLQLesMi8w3x96uIBwEP2AjFN97kU4jOA40BOD/JfjCmjkg6gGFbNbRmrF szdJiVIcNmOVdGCpCxRWs01KNKDXfOxaPzufMCqTJmOYgXlURGuP/nE8mSZWhc7+UCwm rLAPy+oWZGje3uKgBwMaOvtm9stg8OkCGcH7jb4ISk5MpIYaooPMG5CgvXdX1KjtQO3M Y2UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=NbIJ8TYw; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dKCaC93T; spf=pass (google.com: domain of newlib-return-17096-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-17096-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 f3si28551172plr.187.2019.07.31.09.38.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jul 2019 09:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-17096-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=NbIJ8TYw; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dKCaC93T; spf=pass (google.com: domain of newlib-return-17096-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-17096-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=nHcfwcdPFei03vr8tBbBr548LoCAU/v pqgF24YzRkivzwnQNRTFmN7TBNdB8HPq+EKsKBJ8v6h1l/VyLtrmlvPPWHoIWTLV 58cqBVvNR+9Jg8IXAnqQLXJmPFRFfm9r1mRmT6rqZbrA46Dh6zyp0jYR4WArOyY4 sWdn1+X7Ud6M= 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=MHaX9RpnNgFi0G95+X8EZ0WBas0=; b=NbIJ8 TYwsHDOv8RvrZiF43Gz+x9gyouj9S8VUpeozisMhEE1lXiMJ5x3UMd1uw9+MKLaw 0WwdL9Fb27aFf3gL9PSZkYgVtbBdjTiVBx0f+r+tZjlV7T7vw0i8ux+YIqxRE58R X1DDFNmbOWORvJM/bEEsPo3REgUdIepv5p34Gc= Received: (qmail 75151 invoked by alias); 31 Jul 2019 16:38:35 -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 75068 invoked by uid 89); 31 Jul 2019 16:38:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 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=5188, HX-Languages-Length:1116, UD:cygwin.com, cygwincom X-HELO: mail-lf1-f65.google.com Received: from mail-lf1-f65.google.com (HELO mail-lf1-f65.google.com) (209.85.167.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 Jul 2019 16:38:34 +0000 Received: by mail-lf1-f65.google.com with SMTP id q26so47940600lfc.3 for ; Wed, 31 Jul 2019 09:38:33 -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=SO6nCUY6/ihAUyyRWtH74/pBtcGKX84BNcFboYthc7A=; b=dKCaC93TPsn7st9nrbjgVcUeHL5qD8CRbo1uYkymINm/5EKZUXA2HOFOgTOV1zzknS T4hDH/SyRXUisqlscA9e7m1UbnaGDGRiFGvFtnb7+ZVrWAF0JjOhmEHIm132o+ywghh/ +g1neEBv0frJBRdoDvmD1qk3g6n0Nig0ibQsHFna9bPi5dJWUYRSyulaRgMRjvd/84Qq OPcYC649ObNJaUTxNpn5wm583DCPm1On/WySrDB6Xj20ZcLA+PiM5KQf+wcr4M/kOOv5 rgR3LBQTQsQbutrVauOEMbn1AS3g1E6L4L3p3FYMePxXN6f1M4XtvB2LOmmDyfO+sFfH wYtw== Return-Path: Received: from af-ubuntu18-hyperv.cmtknet.ru (relay.cmtk.ru. [195.5.145.226]) by smtp.gmail.com with ESMTPSA id q4sm16001413lje.99.2019.07.31.09.38.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 09:38:31 -0700 (PDT) From: Alexander Fedotov To: Richard.Earnshaw@arm.com, newlib@sourceware.org Cc: Alexander Fedotov Subject: [PATCH v1 2/3] Reflect commit 2404223 (https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git; a=commit; h=2404223df651ceef42c6e2f2c9fa42fb7963db10) Date: Wed, 31 Jul 2019 11:38:04 -0500 Message-Id: <20190731163805.28834-2-alfedotov@gmail.com> In-Reply-To: <20190731163805.28834-1-alfedotov@gmail.com> References: <20190731163805.28834-1-alfedotov@gmail.com> --- 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