From patchwork Wed May 17 19:14:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 1782939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=bAZ9bUi7; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QM2s804B4z20dn for ; Thu, 18 May 2023 05:16:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A2FE388B694 for ; Wed, 17 May 2023 19:16:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A2FE388B694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684350986; bh=lDW7m9qT30zUHDJ7STKcuPub1TiTzDZj1uSu9leu8PE=; 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=bAZ9bUi7N+oN2R7VNquP3G8lvbxVH8OWmGsRurzyFqL0DzVoJ1Af1U0Ym6pkCCn+l tzIF3v3UhiCIu9obKhk+cnRhGw+0DqRkHEBEo7+YmYPSSQ4gC/3Una/5PyV+eA7cc/ UUjYFmH0ZtTQYp34cJf8qssh967vOLLM/qlpFQb4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 2D48C3856DDF for ; Wed, 17 May 2023 19:14:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D48C3856DDF Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f383d6f2f8so1431838e87.2 for ; Wed, 17 May 2023 12:14:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684350891; x=1686942891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lDW7m9qT30zUHDJ7STKcuPub1TiTzDZj1uSu9leu8PE=; b=J/aGl5/c97gMBxMp641c6erP4cH8Qlj4oT/E69SAT2AV2cZWGgxrW2h356xF+Bltxi vEDypWC818K8vK4LapCjgpdtAq++0mpHkEQhKBW/kvbKxjV4LVX9arVw1kra2//2/99K T5XJGALggx0AvAt0vAVTprzR785zz5q8k5R7e+SQEiMRx7yD39aOM3iJBXRqBBXwjBni diXcKOr8BZtZBm1fqkOzb28saiTMtoNa2hcqg/FXTxDvOhXDi8LZG7HHn1xuBylvY2lr ZwnjvSnApxgSiUlHc2kRWxE/DFWK1d8fcqnNTfw3+C/RyJ+Fn0qLWbSEbZcz9SMQRCZK q2Bw== X-Gm-Message-State: AC+VfDxq8+ePm8KpGNL7eiUF64wO1DwGr3WwzwDpxlgqZ0OqmXa3c26k pP4KkU3WOgJtWO51ycK7oMvZ3rI75zI= X-Google-Smtp-Source: ACHHUZ5MoFgLF8bdigsaFiqKTl4k0n94vnYovclKrTz/G4UQB+MoYTCX4RtVQGF2ylqIL+exlEWz/w== X-Received: by 2002:ac2:4a76:0:b0:4f2:7b64:f16f with SMTP id q22-20020ac24a76000000b004f27b64f16fmr472508lfp.52.1684350891141; Wed, 17 May 2023 12:14:51 -0700 (PDT) Received: from surface-pro-6.. ([194.190.106.50]) by smtp.gmail.com with ESMTPSA id o18-20020ac24352000000b004eed8de597csm3415744lfl.32.2023.05.17.12.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 12:14:50 -0700 (PDT) To: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: [PATCH 09/10] hurd: Also make it possible to call strlen very early Date: Wed, 17 May 2023 22:14:35 +0300 Message-Id: <20230517191436.73636-10-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517191436.73636-1-bugaevc@gmail.com> References: <20230517191436.73636-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" strlen, which is another ifunc-selected function, is invoked during early static executable startup if the argv arrives from the exec server. Make it not crash. Checked on x86_64-gnu: statically linked executables launched after the exec server is up now start up successfully. Signed-off-by: Sergey Bugaev --- sysdeps/mach/hurd/x86_64/static-start.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysdeps/mach/hurd/x86_64/static-start.S b/sysdeps/mach/hurd/x86_64/static-start.S index cc8e2410..0fed375c 100644 --- a/sysdeps/mach/hurd/x86_64/static-start.S +++ b/sysdeps/mach/hurd/x86_64/static-start.S @@ -22,6 +22,9 @@ _start: leaq __memcpy_sse2_unaligned(%rip), %rax movq %rax, memcpy@GOTPCREL(%rip) + leaq __strlen_sse2(%rip), %rax + movq %rax, strlen@GOTPCREL(%rip) + call _hurd_stack_setup xorq %rdx, %rdx jmp _start1