From patchwork Thu May 26 16:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 54412 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3DC5E38376ED for ; Thu, 26 May 2022 16:52:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DC5E38376ED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653583962; bh=HuZwuGaz8lhU0DuyefILpq0xUYYyREhgpKT5TED3yWs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wM0wm3Gt5t0EOFWzgTV5BLlULse7rkEfER9KkCVDmyRgGyq/3GlOyUlbB6jogxQa6 HFmFdn/p6Rj2bnbFlqqAiAWQQ+jHMvrUpTk/l3YJkxqppthRKQW1wja0pMoWSGps/9 dCmE3zvEvsGDhPzoYJkyOv4It/cEaYQWaf35lxDY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by sourceware.org (Postfix) with ESMTPS id 628CB385737E for ; Thu, 26 May 2022 16:50:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 628CB385737E Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-edeb6c3642so2862971fac.3 for ; Thu, 26 May 2022 09:50:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HuZwuGaz8lhU0DuyefILpq0xUYYyREhgpKT5TED3yWs=; b=t2WV7N3wT7aT6YUUmdZ97uPrI041KDuXbqiL8SRR9TJ3n8qQTRJvHa1bB1zcYPGe15 yWW57MO+BAtwuBez+N3nZorA7q/t1suLubTDQzQ/mYlnWDnIYaGb+uM7tqFZjPZfcRH4 mMLX2KQwBBoHh/MaWBKt5og63zVFqB9drG9z80F/CTP3CxlX7fPlzQEHS91WTAA3rCO4 ESsdbZsn6Xu5b7FncScWHKvH76siLoTYEOYsQjefr3kiD3HxfCZa96CBtmnPXTebrtx9 Ne+kbqeoMPgEOJS5DdZZ5h6Oe8VDRm1mvv6Gslz3WwdZXSKmCZjuH5eZYwcIE56krS3g e3ig== X-Gm-Message-State: AOAM533vjsycIDwgI3FyHOKmQ009h+8ZTK2OQO+UisO5Bk1M+QFobuhR iGmjuXGZLMSizLqcswv2eh+yAugQRij/XA== X-Google-Smtp-Source: ABdhPJznkBkZxG3esODeOgnsRaI2EdVmkx9XsXYhEf6b1+5M5L5tIBO6tnQLA+mC3suvMQ7JGq4Rkw== X-Received: by 2002:a05:6870:8315:b0:e9:c1a:a1e0 with SMTP id p21-20020a056870831500b000e90c1aa1e0mr1783597oae.153.1653583812130; Thu, 26 May 2022 09:50:12 -0700 (PDT) Received: from birita.. ([2804:431:c7cb:9f85:b1e1:5370:63bd:a2ac]) by smtp.gmail.com with ESMTPSA id y26-20020a9d461a000000b0060603221255sm802521ote.37.2022.05.26.09.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 09:50:11 -0700 (PDT) To: libc-alpha@sourceware.org, Szabolcs Nagy Subject: [PATCH 03/17] arc: Remove _dl_skip_args usage Date: Thu, 26 May 2022 13:49:49 -0300 Message-Id: <20220526165003.705355-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220526165003.705355-1-adhemerval.zanella@linaro.org> References: <20220526165003.705355-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. --- sysdeps/arc/dl-machine.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sysdeps/arc/dl-machine.h b/sysdeps/arc/dl-machine.h index 4ac3848557..c6ad232384 100644 --- a/sysdeps/arc/dl-machine.h +++ b/sysdeps/arc/dl-machine.h @@ -161,29 +161,16 @@ __start: \n\ bl.d _dl_start \n\ mov_s r0, sp /* pass ptr to aux vector tbl. */ \n\ mov r13, r0 /* safekeep app elf entry point. */ \n\ - \n\ - /* (2). If ldso ran with executable as arg. */ \n\ - /* skip the extra args calc by dl_start. */ \n\ ld_s r1, [sp] /* orig argc. */ \n\ - ld r12, [pcl, _dl_skip_args@pcl] \n\ - breq r12, 0, 1f \n\ \n\ - add2 sp, sp, r12 /* discard argv entries from stack. */ \n\ - sub_s r1, r1, r12 /* adjusted argc on stack. */ \n\ - st_s r1, [sp] \n\ - add r2, sp, 4 \n\ - /* intermediate LD for ST emcoding limitations. */ \n\ - ld r3, [pcl, _dl_argv@gotpc] \n\ - st r2, [r3] \n\ -1: \n\ - /* (3). call preinit stuff. */ \n\ + /* (2). call preinit stuff. */ \n\ ld r0, [pcl, _rtld_local@pcl] \n\ add r2, sp, 4 ; argv \n\ add2 r3, r2, r1 \n\ add r3, r3, 4 ; env \n\ bl _dl_init@plt \n\ \n\ - /* (4) call app elf entry point. */ \n\ + /* (3) call app elf entry point. */ \n\ add r0, pcl, _dl_fini@pcl \n\ j [r13] \n\ \n\