From patchwork Thu May 26 16:49:54 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: 54417 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 622163836674 for ; Thu, 26 May 2022 16:56:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 622163836674 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653584173; bh=pYtq2gKf5WQATYnqbsbIf1P3eoL0xNRQHt7ovGFFeos=; 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=QSxU0VDC8SMRqXJNpCVb1wJfBbyFkooBTsciRG7q3ImrTYekNepOYAogWd3lGI6TK OJl1tguggbEZD42zX3ifwYU1FGrsxjeqbkPzq+CqAjzmZxu9xapi07bswwiSsNTQIu eaMsVEHijBLGo1BSYWhSLZJFdXxqT4Wc3pfoeIJ4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id 984AD3839C69 for ; Thu, 26 May 2022 16:50:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 984AD3839C69 Received: by mail-oi1-x233.google.com with SMTP id y66so2802510oia.1 for ; Thu, 26 May 2022 09:50:20 -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=pYtq2gKf5WQATYnqbsbIf1P3eoL0xNRQHt7ovGFFeos=; b=cuISB8vQb5QMp//RAd76cRTt0QpK1DXS3+GKEf+v4vP+71LMFTyHf5j9G9AZopuTxl Iv08Kk7jiHadyPvcaP3B9wbSs45WSiG3xG3zamXtwdqCTZz/hS4MB0ARsN3bzgZ44+RA w32zbLt/VqeUw52FRhqPSRHQjXMqntWq7bVmXLWBaP415i05sC9NyuEPoKTxLtyqUMgl /jfxQBeSaEoqGzNMfP1oLRu3dCayIK3+GVCgRQWEgBmkwAcOCSTScrY7V2Na9LU56pOu INV0z6t6oNBKNIOKZhHg1h3znVLHMG7akW+ELkA5N0+M3z1LvPeoLsefnwHavfzmzeDq OF7g== X-Gm-Message-State: AOAM532RQp6p3MajyjoeUeTxiPiHbTO4b1wf8r1aYp6q8T4+v8w4hwXv tjXJAGljsGn3to/fW98+SVGXIb74vRm+lg== X-Google-Smtp-Source: ABdhPJxW5Uc7yJrbve8HwZVPc2p2xyGquzEKB/18VZKmqBRsarUhvmeLE87ZYGAnIwV+rjn6/AdAyw== X-Received: by 2002:a05:6808:10c5:b0:327:2259:ef7d with SMTP id s5-20020a05680810c500b003272259ef7dmr1629071ois.156.1653583819826; Thu, 26 May 2022 09:50:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 09:50:19 -0700 (PDT) To: libc-alpha@sourceware.org, Szabolcs Nagy Subject: [PATCH 08/17] m68k: Remove _dl_skip_args usage Date: Thu, 26 May 2022 13:49:54 -0300 Message-Id: <20220526165003.705355-9-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.7 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. Checked with qemu-user that arguments are correctly passed on both constructors and main program. --- sysdeps/m68k/dl-machine.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h index bb51b4198c..4204fa3df8 100644 --- a/sysdeps/m68k/dl-machine.h +++ b/sysdeps/m68k/dl-machine.h @@ -142,15 +142,10 @@ _start:\n\ _dl_start_user:\n\ | Save the user entry point address in %a4.\n\ move.l %d0, %a4\n\ - | See if we were run as a command with the executable file\n\ - | name as an extra leading argument.\n\ - " PCREL_OP ("move.l", "_dl_skip_args", "%d0", "%d0", "%pc") "\n\ | Pop the original argument count\n\ move.l (%sp)+, %d1\n\ - | Subtract _dl_skip_args from it.\n\ - sub.l %d0, %d1\n\ - | Adjust the stack pointer to skip _dl_skip_args words.\n\ - lea (%sp, %d0*4), %sp\n\ + | Adjust the stack pointer to skip the loaders arguments.\n\ + lea (%sp), %sp\n\ | Push back the modified argument count.\n\ move.l %d1, -(%sp)\n\ # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\