From patchwork Tue Jun 7 08:10:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1639843 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=l5jBcDW8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LHNPW2XyQz9sFs for ; Tue, 7 Jun 2022 18:12:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC42D84337; Tue, 7 Jun 2022 10:11:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu 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=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="l5jBcDW8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0568842C4; Tue, 7 Jun 2022 10:10:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (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 22F0F842C4 for ; Tue, 7 Jun 2022 10:10:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x62a.google.com with SMTP id q1so33579225ejz.9 for ; Tue, 07 Jun 2022 01:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oTkshP69xYswgmg+YnTRs6B8wROWaYzZPGAAiK/27UE=; b=l5jBcDW8mJaSxSQPwCAP4Rd/nR18q7RoAYVJdq26NWHlg+JPgQMctnfcUKN/ipu+9I t5PNuEnJNpHIX24/TmZm3B4CI2p7TLz7pTzJUZkBOZKeQF5w1OEvojMFY6DJu15+exsa ES1xgiiqZhioAQCKJ/Rd8CeTyK3JzgPfLB1QQ4fu7JtdRpXtMzIWQQyrH0ATdo+NZ//4 ti1i0izGtn/XjZttajorQI0e9JIGLzNQNQSNw1I17TmKuBXSKJTTUVObbtY86XEv75n9 vzA7An/RDzR2ppxsHz741FpNteuKfqBDloNW/FMmC/a08cdzXOwW2REzbewY4gQYYMCf ogjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oTkshP69xYswgmg+YnTRs6B8wROWaYzZPGAAiK/27UE=; b=dz3cDvzjlsJi9PmgLpFhzbD+FVSudt3HeY8U/FklLPQpUuRTOnfnyKaAsKGWFhgEY7 txavPMZ7QnNSrrKbRVzWN5ZmLyYLyTYAyfT+uPiHChPbFankHPx1Qjk1GM2N7P0ABHAN VAPmZRUXASK1I99adgQwoQrwR/DwZOzm6m3AtRoycg0fcIYVhA+1FqwTgeJS41vvkcW8 4QxRLwqCOghG70xuKKkIx64702XTKCInwiwNBJ+cbVpF2geim7FsEDRNW8x8STJr5SFO j4ChUEMlea5oHN1vmJXkqzFkvOw/mFfIR8lvaAoTKm6A4qf8+VountMG3FtCGeHJoFb1 otxQ== X-Gm-Message-State: AOAM531MXnNBm0pjsMdxOCe5MACopRmbA6SK3YBm47oFr/wcbRHRocf0 /AHeaUR6AGtwc0ji2yrpy2kLsPpDErXjJw== X-Google-Smtp-Source: ABdhPJwEYbxwcaaTAG7ZlsYzOMZv8zX9Kedjd+ResLY8MFzyVhk+q1jn5Nb/V9qerpPIriinf3C1Pg== X-Received: by 2002:a17:907:972a:b0:6f4:f456:50a7 with SMTP id jg42-20020a170907972a00b006f4f45650a7mr24922351ejc.431.1654589452076; Tue, 07 Jun 2022 01:10:52 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id n8-20020aa7d048000000b0042dcdfb003esm9870426edo.53.2022.06.07.01.10.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jun 2022 01:10:51 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Alistair Delva Subject: [PATCH v2 03/23] tools: relocate-rela: Use global variables Date: Tue, 7 Jun 2022 10:10:20 +0200 Message-Id: <2d65fc56c3785f2e1ad4d2d21f84856ca5c7c268.1654589430.git.michal.simek@amd.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: References: MIME-Version: 1.0 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 Declare rela_start/end and text_base as global variables. It will help with using these variables for ELF decoding. Signed-off-by: Michal Simek --- (no changes since v1) tools/relocate-rela.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c index 883987111869..67a138aa67d7 100644 --- a/tools/relocate-rela.c +++ b/tools/relocate-rela.c @@ -20,6 +20,8 @@ #define R_AARCH64_RELATIVE 1027 #endif +static uint64_t rela_start, rela_end, text_base; + static const bool debug_en; static void debug(const char *fmt, ...) @@ -63,7 +65,7 @@ int main(int argc, char **argv) { FILE *f; int i, num; - uint64_t rela_start, rela_end, text_base, file_size; + uint64_t file_size; if (argc != 5) { fprintf(stderr, "Statically apply ELF rela relocations\n");