From patchwork Thu May 26 16:49:47 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: 54410 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 5C89F3857355 for ; Thu, 26 May 2022 16:51:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C89F3857355 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653583872; bh=a3EHeRFX/s4xweqfndf1aDY9doZYfpsGYYWmYMVE0CY=; 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=OriRcHbR3J/LkjsHXAf5GutrfxpeoJUg67l+xXxNQ+Z7OHWlF1/vHROEj1QjnU2JG sVLermQ+SlXF3PnvQyNUZcwyextbgsg8znKktt0+Vn0hX9v4Q4652hRUzWp4X2p7as ArK4BbJSJC8Od4qKBSAUR0vIwploUROVTqWpXdEY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by sourceware.org (Postfix) with ESMTPS id 68CF43857428 for ; Thu, 26 May 2022 16:50:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 68CF43857428 Received: by mail-oo1-xc31.google.com with SMTP id c17-20020a4ac311000000b0040ea8bf80f2so383377ooq.1 for ; Thu, 26 May 2022 09:50:11 -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=a3EHeRFX/s4xweqfndf1aDY9doZYfpsGYYWmYMVE0CY=; b=dODropFPWmhU/Sov9hTwlzkRzjUmQpi6FMp7M4Z4tSCxn+SPaFUhdRpWYxmthL87F7 q7UcKhPD+kuKnF184nua78qq9baHvTqvjqyGs6bKTye+isjDzoKf2DPH8URG1DLHwhZn 3q7Sj1unonsvCwamIcMme2Di+o9/b6nhuxlyU2DtKcLNuccCQvsUC9WTRzNGWU4DQMFB lYKCdz98NFDDMZrM1fRgdOwMp68VX6gs/BHy2zhnk9J129Kux00u2m85dDnksai50PC8 3oH2ti6FKB8dEeMNzurHimgsIaumRhdzXkr7aAu6BveHhhB3OTxFaB+sLGu+rTjBJOWh mTag== X-Gm-Message-State: AOAM531FilwQ3CQjEkZeOc4dsHSKLzBDdc8bY19i9HOdR/T+J1C/Z5p0 4Km6jitFarllpABO/1QuFWMzY59owlqJow== X-Google-Smtp-Source: ABdhPJwEdzlAT2+0jMMAw4JGG4uk1YvnFeaWrALq2uPWlAzMO6EGCPM5/4mNrmyoeHqoSHeaj/1pkw== X-Received: by 2002:a4a:c19a:0:b0:40e:4a3c:202e with SMTP id w26-20020a4ac19a000000b0040e4a3c202emr15285126oop.48.1653583809339; Thu, 26 May 2022 09:50:09 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 09:50:08 -0700 (PDT) To: libc-alpha@sourceware.org, Szabolcs Nagy Subject: [PATCH 01/17] alpha: Remove _dl_skip_args usage Date: Thu, 26 May 2022 13:49:47 -0300 Message-Id: <20220526165003.705355-2-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=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SCC_5_SHORT_WORD_LINES, 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. It makes the fixup_stack branch ununsed. Checked with qemu-user that arguments are correctly passed on both constructors and main program. --- sysdeps/alpha/dl-machine.h | 41 -------------------------------------- 1 file changed, 41 deletions(-) diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index ccee972c96..f0ba8e88af 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -156,12 +156,6 @@ _dl_start_user: \n\ .prologue 0 \n\ /* Save the user entry point address in s0. */ \n\ mov $0, $9 \n\ - /* See if we were run as a command with the executable \n\ - file name as an extra leading argument. */ \n\ - ldah $1, _dl_skip_args($gp) !gprelhigh \n\ - ldl $1, _dl_skip_args($1) !gprellow \n\ - bne $1, $fixup_stack \n\ -$fixup_stack_ret: \n\ /* The special initializer gets called with the stack \n\ just as the application's entry point will see it; \n\ it can switch stacks if it moves these contents \n\ @@ -182,41 +176,6 @@ $fixup_stack_ret: \n\ /* Jump to the user's entry point. */ \n\ mov $9, $27 \n\ jmp ($9) \n\ -$fixup_stack: \n\ - /* Adjust the stack pointer to skip _dl_skip_args words.\n\ - This involves copying everything down, since the \n\ - stack pointer must always be 16-byte aligned. */ \n\ - ldah $7, __GI__dl_argv($gp) !gprelhigh \n\ - ldq $2, 0($sp) \n\ - ldq $5, __GI__dl_argv($7) !gprellow \n\ - subq $31, $1, $6 \n\ - subq $2, $1, $2 \n\ - s8addq $6, $5, $5 \n\ - mov $sp, $4 \n\ - s8addq $1, $sp, $3 \n\ - stq $2, 0($sp) \n\ - stq $5, __GI__dl_argv($7) !gprellow \n\ - /* Copy down argv. */ \n\ -0: ldq $5, 8($3) \n\ - addq $4, 8, $4 \n\ - addq $3, 8, $3 \n\ - stq $5, 0($4) \n\ - bne $5, 0b \n\ - /* Copy down envp. */ \n\ -1: ldq $5, 8($3) \n\ - addq $4, 8, $4 \n\ - addq $3, 8, $3 \n\ - stq $5, 0($4) \n\ - bne $5, 1b \n\ - /* Copy down auxiliary table. */ \n\ -2: ldq $5, 8($3) \n\ - ldq $6, 16($3) \n\ - addq $4, 16, $4 \n\ - addq $3, 16, $3 \n\ - stq $5, -8($4) \n\ - stq $6, 0($4) \n\ - bne $5, 2b \n\ - br $fixup_stack_ret \n\ .end _dl_start_user \n\ .set noat \n\ .previous");