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 A8DF7C433EF for ; Wed, 15 Jun 2022 13:21:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 67EC7844AD; Wed, 15 Jun 2022 15:21:36 +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="MMFNI0PC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 281D783E9A; Wed, 15 Jun 2022 15:21:31 +0200 (CEST) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 561C1843EA for ; Wed, 15 Jun 2022 15:21:25 +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-ed1-x534.google.com with SMTP id z7so16081514edm.13 for ; Wed, 15 Jun 2022 06:21:25 -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:mime-version :content-transfer-encoding; bh=YUwOVh2+AGYRLPxUatyITjJAOi9M67KoVaeU8D8NmnE=; b=MMFNI0PC32/4Z9KH4+4f0bXdV+R+gClrB1YqXnIQpJaTbOzDaZ1JOJrqchnkg+jGUa h2PeLf1Dmajrz5a7fM0Yg+E3H2CKvQKEVMQeob4qRpO38vgRzXzg4AXuuk9cTqmqmeRF zUoOcG6EnBQmF4DpSV5Q936dNE5EUdN9PkLIj6auxVgvmIVMuhDUTQMX2GqZsoxCxZzX ok02yIqsnuVngP85eKOhmIzWyFSoW7bTI0Blc/q2x43GEelf6RE0d+VJ3NDdiOwgMN0l l+1Ka15OvECoGgiDUZAV8IUzGwo46yJhKYJEmrP9ZhNwAyfVuXbYh3wluQDQDgbwiJpG cfhg== 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:mime-version :content-transfer-encoding; bh=YUwOVh2+AGYRLPxUatyITjJAOi9M67KoVaeU8D8NmnE=; b=xcS/0nNai2i34HqgHUO7iU9u3W9Z7CNqa2FbtXd5UoOPUqgkQ5+DDg1KPJSoPkKBQR b/UAOrkxZ9hGI8DMMWxDxgRRFWdIwwz0iitEpA2c9KBiaBMITuWfCIjEz/0w4GEEDCcr wppPu1aI8G8nF71DpI8XrYDj6GVzXHh/bxI50x8Oe+K6xqVLlKIjGCogartweIMbMMns 1NX3ymLnk/y6B4TJjX0fnWKf9SUAMcP3aZy2p01DK8XKB0+qQJtgteaAlXjMusoVgUgs 4an6r1jNbddKMrqPKcCQYrKdWs6Jzrg+qXRmdjb7FSCuoFsStrMaxKKQ6wpp+y6T2cq0 H6vQ== X-Gm-Message-State: AOAM532BPo4x9wfhTkutp6auyp/wg0yHaBpcON0sqULUSMeRPdtCITGK d5e5bSVOl/fJr0qrbvqWDYZDHuWCz60gcw== X-Google-Smtp-Source: ABdhPJyjgm2FnFyNxUzN/DJpsO4n8977mltLgbKWsj7A+7p1AHsMQi2AHzzQDYdhTOfb/qezg1NUMA== X-Received: by 2002:a05:6402:b45:b0:42d:bf43:8db1 with SMTP id bx5-20020a0564020b4500b0042dbf438db1mr12881537edb.100.1655299284626; Wed, 15 Jun 2022 06:21:24 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id vp5-20020a17090712c500b006f3ef214ddesm6272241ejb.68.2022.06.15.06.21.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 06:21:23 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Alistair Delva , Angelo Dureghello , Daniel Schwierzeck , Heiko Schocher , Heinrich Schuchardt , Huan Wang , Marek Vasut , Michal Simek , Ovidiu Panait , Rick Chen , Sean Anderson , Simon Glass Subject: [PATCH v4 00/23] microblaze: Add support for full relocation Date: Wed, 15 Jun 2022 15:20:56 +0200 Message-Id: X-Mailer: git-send-email 2.36.1 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.5 at phobos.denx.de X-Virus-Status: Clean Hi, this series is adding support for full rela relocation. Origin NEEDS_MANUAL_RELOC option is still there as default. Code has been tested with multiple configurations on QEMU. - Origin behavior - u-boot - Relocated version - u-boot.elf - Loading u-boot.bin to higher address than TEXT_BASE - Loading u-boot.bin to lower address than TEXT_BASE In v2 I fixed Kconfig issue reported in v1 series. In v3 fix issues reported by gitlab CI. I incorrectly squashed m68k change to wrong patch. V4 fixes it. Thanks, Michal Changes in v4: - Revert incorrect m68k merge - wrong patch - Aligned NEEDS_MANUAL_RELOC for m68k Changes in v3: - Move NEEDS_MANUAL_RELOC to m68k Kconfig to avoid Kconfig issues Changes in v2: - new patch in series to solve Kconfig warning - Fix endian selection Michal Simek (23): tools: relocate-rela: Open binary u-boot file later Makefile: Fix description for relocate-rela parameters tools: relocate-rela: Use global variables tools: relocate-rela: Read rela start/end directly from ELF microblaze: Switch absolute branches to relative microblaze: Fix stack protection behavior microblaze: Fix early stack allocation microblaze: Remove CONFIG_TEXT_BASE from code microblaze: Fix typo in exception.c mips: Move endianness selection to arch/Kconfig microblaze: Enable REMAKE_ELF microblaze: Separate code end substraction microblaze: Change stack protection address to new stack address microblaze: Optimize register usage in relocate_code microblaze: Remove code around r20 in relocate_code() microblaze: Remove _start symbol handling at U-Boot start microblaze: Add comment about reset location microblaze: Create SYM_ADDR macro to deal with symbols tools: relocate-rela: Extract elf64 reloc to special function tools: relocate-rela: Check that relocation works only for EM_AARCH64 tools: relocate-rela: Add support for elf32 decoding tools: relocate-rela: Add support for 32bit Microblaze relocation microblaze: Add support for run time relocation Makefile | 6 +- arch/Kconfig | 26 +- arch/m68k/Kconfig | 3 + arch/microblaze/Kconfig | 14 + arch/microblaze/config.mk | 11 + arch/microblaze/cpu/Makefile | 1 + arch/microblaze/cpu/exception.c | 2 +- arch/microblaze/cpu/relocate.c | 111 ++++++ arch/microblaze/cpu/start.S | 130 +++++-- arch/microblaze/cpu/u-boot.lds | 14 + arch/mips/Kconfig | 18 - common/board_f.c | 2 + configs/microblaze-generic_defconfig | 1 + include/configs/microblaze-generic.h | 4 - tools/relocate-rela.c | 545 +++++++++++++++++++++++++-- 15 files changed, 789 insertions(+), 99 deletions(-) create mode 100644 arch/microblaze/cpu/relocate.c -- 2.36.1