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 18A3BC6FD1C for ; Sat, 11 Mar 2023 17:39:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 579E485FD4; Sat, 11 Mar 2023 18:39:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="M1LDjvof"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49E1E85FC9; Sat, 11 Mar 2023 18:38:59 +0100 (CET) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 F196C85FC0 for ; Sat, 11 Mar 2023 18:38:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ovpanait@gmail.com Received: by mail-ed1-x535.google.com with SMTP id x3so32982507edb.10 for ; Sat, 11 Mar 2023 09:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678556334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MrZm70QsxV0vNLJKkFKy4s2AKRQUAXLoV/fj00AQkhc=; b=M1LDjvoflKHH6QYd+PeE1yyLJfX/06guFxc9rcVnId8o11N+uU0wJKyUxnL1HcVkTw iS6opxNciweHzu5xG13phur3wdzunFbclJ/DBJB67/zKkRk2T8BDCxrBspZReEI6mVym tX4dyIezlTBQsqyHogVFb2p84+l3YUEKMgd0+4QDxRT+jB1WOfMzzj5zjv2k5K1mhbaO sLenyR8lwCJ0fiZFv0Ondz/uWUQDlS3cm8eL+xaIgDVo5nI4XO+CC0w8vn38nKkXYSef 7c0du6sAa07S6mIagarAfbwiWm5XB5kE+LEml6QH5dlTLo1WnuEtmDYvKciexv1OpNJ4 LUpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678556334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MrZm70QsxV0vNLJKkFKy4s2AKRQUAXLoV/fj00AQkhc=; b=2B1almV7Es/z7TgxeBdyHkRMsWUIRJdeR92iBIikz8bg50pph1tiQwyqDUmAZ/5ooD 6Pt7TR5nuIND1YBizJ2LhgfbYdvBJgdnv4apvQDcnkbxupbnKRcV/W5qyFjx269bjZT6 TSsyk7ut+nI3O6Eur+EMJmCdvgL4TlRfK44vx/eRp5LSyjIEzskMZNYcYNYbAnROWKvl YoAO8WcGJPanEmEwvqzSzX4BvKUcoBlSXYbVAYY4jK8tLKEUS8ZiJdCPQ8axMcGrS9WR 4yJCPw3DG0AAPixrZJV/zZyCeHQfZ7oR9Ts86G/GsTCe6eTNBElznPlLwzOmyPQp0Wou GP3w== X-Gm-Message-State: AO0yUKWu2u9TK29C4owBkPtTS3uI9bkLL5Nt+phLmR65mhx9jd+g6uVJ vIB+c8nGdDZtMPPwmPRRh7IhJ16DUfM= X-Google-Smtp-Source: AK7set8mSwuGCdsos5TEzKpLbWGTeIgDF2xnZqIj3clZ3MPuIN6icczlq5XFJNNczpjKpQXb3xzUyQ== X-Received: by 2002:a17:906:66cd:b0:878:605b:ffef with SMTP id k13-20020a17090666cd00b00878605bffefmr31671011ejp.55.1678556334627; Sat, 11 Mar 2023 09:38:54 -0800 (PST) Received: from localhost.localdomain ([2a02:2f0e:c915:3800:d24b:dc4a:599b:7c80]) by smtp.gmail.com with ESMTPSA id p10-20020a170906614a00b008e7916f0bdesm1303986ejl.138.2023.03.11.09.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Mar 2023 09:38:54 -0800 (PST) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Michal Simek , Michal Simek , Simon Glass Subject: [PATCH v2 5/5] microblaze: drop remnants of manual reloc Date: Sat, 11 Mar 2023 19:38:38 +0200 Message-Id: <20230311173838.521804-5-ovpanait@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230311173838.521804-1-ovpanait@gmail.com> References: <20230311173838.521804-1-ovpanait@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.8 at phobos.denx.de X-Virus-Status: Clean Runtime relocation has been made the default for microblaze, so do the following cleanups: - drop all manual reloc codepaths in start.S - drop all STATIC_RELA ifdefs, as it is now enabled unconditionally in Kconfig Reviewed-by: Michal Simek Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/config.mk | 4 ---- arch/microblaze/cpu/Makefile | 3 +-- arch/microblaze/cpu/start.S | 28 ---------------------------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index 467c5ca1b1..64c3f31319 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -13,10 +13,6 @@ LDFLAGS_FINAL += --gc-sections ifeq ($(CONFIG_SPL_BUILD),) PLATFORM_CPPFLAGS += -fPIC -endif - -ifeq ($(CONFIG_STATIC_RELA),y) -PLATFORM_CPPFLAGS += -fPIC LDFLAGS_u-boot += -pic endif diff --git a/arch/microblaze/cpu/Makefile b/arch/microblaze/cpu/Makefile index 1c586a7de0..b8c1dcbe14 100644 --- a/arch/microblaze/cpu/Makefile +++ b/arch/microblaze/cpu/Makefile @@ -5,7 +5,6 @@ extra-y = start.o obj-y = irq.o -obj-y += interrupts.o cache.o exception.o cpuinfo.o -obj-$(CONFIG_STATIC_RELA) += relocate.o +obj-y += interrupts.o cache.o exception.o cpuinfo.o relocate.o obj-$(CONFIG_XILINX_MICROBLAZE0_PVR) += pvr.o obj-$(CONFIG_SPL_BUILD) += spl.o diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S index 7079d9e170..c1e0fcda0a 100644 --- a/arch/microblaze/cpu/start.S +++ b/arch/microblaze/cpu/start.S @@ -10,16 +10,11 @@ #include #include -#if defined(CONFIG_STATIC_RELA) #define SYM_ADDR(reg, reg_add, symbol) \ mfs r20, rpc; \ addik r20, r20, _GLOBAL_OFFSET_TABLE_ + 8; \ lwi reg, r20, symbol@GOT; \ addk reg, reg reg_add; -#else -#define SYM_ADDR(reg, reg_add, symbol) \ - addi reg, reg_add, symbol -#endif .text .global _start @@ -35,7 +30,6 @@ _start: addi r1, r0, CONFIG_SPL_STACK #else add r1, r0, r20 -#if defined(CONFIG_STATIC_RELA) bri 1f /* Force alignment for easier ASM code below */ @@ -67,7 +61,6 @@ uboot_sym_start: brlid r15, mb_fix_rela nop -#endif #endif addi r1, r1, -4 /* Decrement SP to top of memory */ @@ -310,7 +303,6 @@ relocate_code: brlid r15, __setup_exceptions nop -#if defined(CONFIG_STATIC_RELA) /* reloc_offset is current location */ SYM_ADDR(r10, r0, _start) @@ -331,27 +323,7 @@ relocate_code: add r9, r9, r5 brlid r15, mb_fix_rela nop - /* end of code which does relocation */ -#else - /* Check if GOT exist */ - addik r21, r23, _got_start - addik r22, r23, _got_end - cmpu r12, r21, r22 - beqi r12, 2f /* No GOT table - jump over */ - - /* Skip last 3 entries plus 1 because of loop boundary below */ - addik r22, r22, -0x10 - - /* Relocate the GOT. */ -3: lw r12, r21, r0 /* Load entry */ - addk r12, r12, r23 /* Add reloc offset */ - sw r12, r21, r0 /* Save entry back */ - - cmpu r12, r21, r22 /* Check if this cross boundary */ - bneid r12, 3b - addik r21. r21, 4 -#endif /* Flush caches to ensure consistency */ brlid r15, flush_cache_all -- 2.25.1