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 7A50FC61DA4 for ; Sun, 5 Mar 2023 17:50:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F109F85DB6; Sun, 5 Mar 2023 18:49: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=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="GlMtGb33"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EBDC984F3E; Sun, 5 Mar 2023 18:49:41 +0100 (CET) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 E8BF385A1F for ; Sun, 5 Mar 2023 18:49:37 +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-x52e.google.com with SMTP id j11so10157253edq.4 for ; Sun, 05 Mar 2023 09:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678038577; 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=cLD3go4pi19BVd9g7EXoZj5abT43m8kiVgS/4cQT3Uc=; b=GlMtGb33zL96s8yrn5ZsirREUpuJH9snMdTD7U59lHN0jRQHUbcI6bkDOiMdiovmZd Afvb/1+DdFk0pEJcrbZEjjSBv0PpVHZqNh0tkprKFs0aYcMwRssDh4mjlKbW879y7JoW YwZlPVox+5N7tJudDW6OaEm125mLIwJ0pGbVyWoJwESzBKiwh8M0lYe2UUqmITGYAoEm 9930dQ6bl1oji+PIq6eCMod7u/s1LqQ7DMCUDQknCgpLBi0IFmlyAiUoFDlHKFf/mnKF w1NnkJjKwcrUi7EcJuuEALna0YE6SETSBSaDjjTL+09fuGEGfZdGIOOKZw9pmLEcKXvO hW4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678038577; 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=cLD3go4pi19BVd9g7EXoZj5abT43m8kiVgS/4cQT3Uc=; b=aCITa0HDnbtJfIJ5mElzAg9nPFFtoKK4edpdj6l2wnj16ETCBBZnem+J+P5GO8mWis fb3nsIA9VSWTszhxFoNyeC8ZqwO7M6Ja0VPFnYOaJSuNkYxzgoZleUFv75L4vzavVk+I HdAvdt3DsMqzKYCbl1lmHtzylJH6zC9maRTP41xu67Pf6lNn8vuY7nXfi8xynIctedEs /4J6N+NENfjebRwRgPwKuH9kijETD0pB6GQq0u/Tc4WVktmzXJe3J/o+t8IXsW9Mi2/Y gnrhzG9X3S4iRaa4DZ9+64vDcxSCpGTfcMkTW3Dx7SmDecuFeYhrCb2bv9MKMWWCANwb Vv+g== X-Gm-Message-State: AO0yUKUSzrDe6see5MARR14i6IEZvD6DaR6Il51iGh9B3op6vYunba68 8kcyF9cmiILjOAflM+ILPcquOEVeDKQ= X-Google-Smtp-Source: AK7set8rojCrOE/0gSDyoEZJUEudEgr41YWzQhGIBETo4gwFR3QmFAie/f8tQ1HCsi/M2+OTZPErFQ== X-Received: by 2002:a17:906:32d9:b0:8aa:bf4e:7b2c with SMTP id k25-20020a17090632d900b008aabf4e7b2cmr9028429ejk.21.1678038577437; Sun, 05 Mar 2023 09:49:37 -0800 (PST) Received: from localhost.localdomain ([2a02:2f0e:c915:3800:3ec7:a5bc:2321:4538]) by smtp.gmail.com with ESMTPSA id l26-20020a170906231a00b008b69aa62efcsm3464985eja.62.2023.03.05.09.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Mar 2023 09:49:37 -0800 (PST) From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Michal Simek , Michal Simek , Simon Glass Subject: [PATCH 5/5] microblaze: drop remnants of manual reloc Date: Sun, 5 Mar 2023 19:49:19 +0200 Message-Id: <20230305174919.293393-5-ovpanait@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230305174919.293393-1-ovpanait@gmail.com> References: <20230305174919.293393-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.6 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 Signed-off-by: Ovidiu Panait --- 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