From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEA81C433EF for ; Mon, 30 May 2022 10:01:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37DAC843D3; Mon, 30 May 2022 12:00:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="SE6liuhP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7897D843B2; Mon, 30 May 2022 12:00:38 +0200 (CEST) Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 73075843A4 for ; Mon, 30 May 2022 12:00:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3wJWUYgYKBlk1J3LCC7FF7C5.3FDL-2FFKC9JKJ.45EO.45@flex--ascull.bounces.google.com Received: by mail-wm1-x34a.google.com with SMTP id p16-20020a1c5450000000b0039a137ee107so1289789wmi.6 for ; Mon, 30 May 2022 03:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=XN31tTAYEKZcC1K7wFZePLROSoLHgaUvH28On+s8URE=; b=SE6liuhPPosMbI9QjZr7gNnmb32uq39HX419zfSQgTs5LJmKH2Te+pT19/8fQhB2Lk fbz4XIr84i0lRkc2xqT6y1qFXO/NymVlt+igCzzbbsaLeeIf6XqNK8SikfLsydMHg9j6 NekHNpHGO7JKD09vt8WwOctlY+yS1o9tLUCA0vLrb04YBUs1UWJgJBWY2ufqeVv2gzYY /mJFc2kn9DQ57pRCjXO95LxctD3zu83ngN7aNpLGwCehucFihSCBPFMTYHJEunaW/zge N1GKwe5fhUV/E3cYZfdmuiveKvI6DrirubTvRoqCFOzOeRrAmGyeHia/mdSn/BlQqesN bkpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=XN31tTAYEKZcC1K7wFZePLROSoLHgaUvH28On+s8URE=; b=dzaLtr9oNPKIK8Z4a/HF4z+ZC9AlS/k0HauUydkZRxLf1x+iF9LgmeWUDAfJkIzvil 7DQvBC+641fHqf39Lbc2goXCiWf6Q23TZgvuuW7PzkMkM+tcMwMn6ibkrppjAsiV9ltF FndZpGaijldcW1xYRvQNON91LaaTbKQeANKIoy8AA4CFpN7oWl7x0v2PT65XQpi02AQE 0015PY+E6Qj3LY6zbzhSbtTNk0ip7PNYW+Xdu2Ec1a5H2Mc1qNk4j9c3GiRNtwUa3PyK R0nZILkAVbOfujINEZzRkp15iVD+cUJcCxYGzoB2iBmgzRxmD8MKhMASa/ZjJ8MQIND7 JXAQ== X-Gm-Message-State: AOAM532yO6RBAIIgZXvxX71rRVXh4L4WC3Tt7LsKY0KpRPqJMS/vbiSe 8t5xzac16EPqvlIX/DKoSd86uAEpiIirldQ6WYgt8ZDfEh59HCORqCwhBw4+2T0hJoTRW4avVD6 xJ8EIjHvOJG2nieW47LwBz/dy8ECHEzfkSS+5rrFkLhl8RAoSCl81mZrvW5c= X-Google-Smtp-Source: ABdhPJzJqzcOlGsMxo1CJwxlCfWuZk94hT2ARxpzTOjqS1OJDfWkpO24hOzKIKsJKBE7cBUQu4YuVlGy/jQ= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a1c:ac89:0:b0:393:fbb4:f52c with SMTP id v131-20020a1cac89000000b00393fbb4f52cmr687721wme.0.1653904832970; Mon, 30 May 2022 03:00:32 -0700 (PDT) Date: Mon, 30 May 2022 10:00:03 +0000 In-Reply-To: <20220530100013.3753780-1-ascull@google.com> Message-Id: <20220530100013.3753780-4-ascull@google.com> Mime-Version: 1.0 References: <20220530100013.3753780-1-ascull@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [PATCH v3 03/13] sandbox: Rename getopt sections From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, xypron.glpk@gmx.de, jonbottarini@google.com, seanga2@gmail.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Rename the sections used for defining sandbox command line options so that they don't start with a '.'. ELF says that sections starting with a '.' are reserved for system use, but the sandbox runs as a normal user process so should be using user sections instead. Clang's ASAN adds redzones to non-user sections and the extra padding meant that the list of options was being corrupted. Naming the sections as user sections avoids this issue as clang handles them as we intended. Signed-off-by: Andrew Scull --- arch/sandbox/cpu/u-boot-spl.lds | 6 +++--- arch/sandbox/cpu/u-boot.lds | 6 +++--- arch/sandbox/include/asm/getopt.h | 2 +- arch/sandbox/include/asm/sections.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/sandbox/cpu/u-boot-spl.lds b/arch/sandbox/cpu/u-boot-spl.lds index 206e265e74..6b300bcc93 100644 --- a/arch/sandbox/cpu/u-boot-spl.lds +++ b/arch/sandbox/cpu/u-boot-spl.lds @@ -22,9 +22,9 @@ SECTIONS } _u_boot_sandbox_getopt : { - *(.u_boot_sandbox_getopt_start) - KEEP(*(.u_boot_sandbox_getopt)) - *(.u_boot_sandbox_getopt_end) + *(_u_boot_sandbox_getopt_start) + KEEP(*(_u_boot_sandbox_getopt)) + *(_u_boot_sandbox_getopt_end) } } diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds index d2cb12fc29..1f89a3329e 100644 --- a/arch/sandbox/cpu/u-boot.lds +++ b/arch/sandbox/cpu/u-boot.lds @@ -14,9 +14,9 @@ SECTIONS } _u_boot_sandbox_getopt : { - *(.u_boot_sandbox_getopt_start) - *(.u_boot_sandbox_getopt) - *(.u_boot_sandbox_getopt_end) + *(_u_boot_sandbox_getopt_start) + *(_u_boot_sandbox_getopt) + *(_u_boot_sandbox_getopt_end) } efi_runtime_start : { diff --git a/arch/sandbox/include/asm/getopt.h b/arch/sandbox/include/asm/getopt.h index d2145ad6e2..df30572d6c 100644 --- a/arch/sandbox/include/asm/getopt.h +++ b/arch/sandbox/include/asm/getopt.h @@ -44,7 +44,7 @@ struct sandbox_cmdline_option { .callback = sandbox_cmdline_cb_##f, \ }; \ /* Ppointer to the struct in a special section for the linker script */ \ - static __used __section(".u_boot_sandbox_getopt") \ + static __used __section("_u_boot_sandbox_getopt") \ struct sandbox_cmdline_option \ *sandbox_cmdline_option_##f##_ptr = \ &sandbox_cmdline_option_##f diff --git a/arch/sandbox/include/asm/sections.h b/arch/sandbox/include/asm/sections.h index f4351ae7db..88837bb35c 100644 --- a/arch/sandbox/include/asm/sections.h +++ b/arch/sandbox/include/asm/sections.h @@ -17,7 +17,7 @@ static inline struct sandbox_cmdline_option ** __u_boot_sandbox_option_start(void) { static char start[0] __aligned(4) __attribute__((unused)) - __section(".u_boot_sandbox_getopt_start"); + __section("_u_boot_sandbox_getopt_start"); return (struct sandbox_cmdline_option **)&start; } @@ -26,7 +26,7 @@ static inline struct sandbox_cmdline_option ** __u_boot_sandbox_option_end(void) { static char end[0] __aligned(4) __attribute__((unused)) - __section(".u_boot_sandbox_getopt_end"); + __section("_u_boot_sandbox_getopt_end"); return (struct sandbox_cmdline_option **)&end; } -- 2.36.1.124.g0e6072fb45-goog