From patchwork Thu May 26 16:50:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 54423 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 022A33836677 for ; Thu, 26 May 2022 17:00:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 022A33836677 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653584432; bh=PyUNqYR8wcwnigXYACLHUj8ni7A3wSISWgZRTijsr8Y=; 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=Mde2B1IE1A5mmO8Ds/83HDliH8GMxYoeUj218PfJTfW5E36AuSs8RChE0h9W4IzKe ZNSjw3T7NIBsYWBmcROcztbaoOaKMvZy9C4JF36sZw2bgxGQHXnC9fF5A3cxomEefb q1mAoo/ytaV3f9Twqx2K3n/4L2zdGuUhotdNdJHc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id 62A5E383666E for ; Thu, 26 May 2022 16:50:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62A5E383666E Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-e5e433d66dso2853446fac.5 for ; Thu, 26 May 2022 09:50:29 -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=PyUNqYR8wcwnigXYACLHUj8ni7A3wSISWgZRTijsr8Y=; b=x3K1aO8nFwFXAAkOsoRAIUFnh2BgoPg5HBEksZLXHhaH5lwhIICGJgKziK0r65CtmF +vPogR/hk+I764B7F5aC3i+mhmBoqzub5qS99tHyNgOjZxs78wUGR7E9Am/ORBdbaqoc cnW81tR6cDC7XmX0RJcHmMMd9rEfNb2lG7RIwqPrBZcZ7poqkv3bAx+B1JEDLCToGBLx etAcPOIrGkvu3ePQF8GVKn7QPLlmQEkc9ErS8rdjo8GBDgfW4bXNGfZCBFtSTHfIKuTW IcSh7UvMzZ1hQUlbubeI3KJ9A/pegaOPZxWZb2DYL0bV+9/lfK9UHegj9jHDOv47y4WW NZgQ== X-Gm-Message-State: AOAM532b7u6nUTP5MDiTZGf1PN4znL+vR8LycDivXhM8Z2rlgyh/shdc f07kRKyRCr4ELQlwmlMq+DYMOWdRel7/3w== X-Google-Smtp-Source: ABdhPJx1hN93t49lZp5iDi9tG26OwW4lfLXP5f3e4S6ugMMtj2BFxZeclXhtnvpJD1ldgIQSqddBvw== X-Received: by 2002:a05:6871:722:b0:f1:b218:5b59 with SMTP id f34-20020a056871072200b000f1b2185b59mr1754028oap.284.1653583828682; Thu, 26 May 2022 09:50:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 09:50:28 -0700 (PDT) To: libc-alpha@sourceware.org, Szabolcs Nagy Subject: [PATCH 14/17] sh: Remove _dl_skip_args usage Date: Thu, 26 May 2022 13:50:00 -0300 Message-Id: <20220526165003.705355-15-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.8 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 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. Checked with qemu-user that arguments are correctly passed on both constructors and main program. --- sysdeps/sh/dl-machine.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h index 8b08a1fc47..99eb239408 100644 --- a/sysdeps/sh/dl-machine.h +++ b/sysdeps/sh/dl-machine.h @@ -149,20 +149,8 @@ _dl_start_user:\n\ add r0,r12\n\ .align 2\n\ 1: .long _GLOBAL_OFFSET_TABLE_\n\ -2: ! See if we were run as a command with the executable file\n\ - ! name as an extra leading argument.\n\ - mov.l .L_dl_skip_args,r0\n\ - mov.l @(r0,r12),r0\n\ - mov.l @r0,r0\n\ - ! Get the original argument count.\n\ +2: ! Get the original argument count.\n\ mov.l @r15,r5\n\ - ! Subtract _dl_skip_args from it.\n\ - sub r0,r5\n\ - ! Adjust the stack pointer to skip _dl_skip_args words.\n\ - shll2 r0\n\ - add r0,r15\n\ - ! Store back the modified argument count.\n\ - mov.l r5,@r15\n\ ! Compute argv address and envp.\n\ mov r15,r6\n\ add #4,r6\n\ @@ -188,8 +176,6 @@ _dl_start_user:\n\ .align 2\n\ .L_dl_start:\n\ .long _dl_start@PLT\n\ -.L_dl_skip_args:\n\ - .long _dl_skip_args@GOT\n\ .L_dl_init:\n\ .long _dl_init@PLT\n\ .L_dl_loaded:\n\