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 DD1D1C433EF for ; Tue, 7 Jun 2022 08:10:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8DD7D84297; Tue, 7 Jun 2022 10:10:52 +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="i25M6XuE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65DB18424E; Tue, 7 Jun 2022 10:10:49 +0200 (CEST) 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 4A2FA84293 for ; Tue, 7 Jun 2022 10:10:46 +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-x52e.google.com with SMTP id fd25so21925771edb.3 for ; Tue, 07 Jun 2022 01:10:46 -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=z3mBoegDN7TPIXv8+RMiz4+nNsDLO2yGJgFJbKzpW/8=; b=i25M6XuEVcx6MCFgaR4kPdfyQcbxcYjalw6yk3M+qLnCiZkuGDterkVylqemNFd1vd oaO2DNnGIX2NklQT7FFOToF5eJlB+q46LIPQVa1ie//RszhiI4z7uEFSw2ZsDAplv5se MB6LC0Y/M3/ucQfHkcrr7bYmBE31GCI8BEYvCgthfxcXl02smBkyqvqPA//wJ8jSem93 1inkUR5pSrMUyJPbxVE6deyrCyC9VhVn/w1EyGvUR9HiI0rTe7+WQthqDcP177Ouoo5i wVKZ5lwRt01Egm170O/vnBDiYVMJB1T52Rp64HJrO2leusMGv9Feb9m5iM4gD8tAKT73 visw== 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=z3mBoegDN7TPIXv8+RMiz4+nNsDLO2yGJgFJbKzpW/8=; b=O7slXTsb73QlAU7Mzs50J9yoV+2nYfkBaj8eLzdK6AtOR//CYGcOYT0Nc7U3RiZmyW 5Wt+m/iSr/xIku65ODCyybGwsuUrhyWIq8Y+c9NNVeOdFfKARJieKfkHSaUFMJ7ZHd6H 79M4IYGy/v6mR+d5HD7IfFPSs24H//V9Ncy37fkpwg+mxt57G8/SMGRIuHD4WS7Mz3Oi lR8aAsV6kmSnTlR6DZ61YfoEnhPrGP1uAJzJloYSKIJ6HWXYcdGXdapFz8slPVCmC+li m0j62LUabZ2GlKd0ornq8aDWkYk8uBNet3GjJ3rc1EMLHNJY2RdUyHEij+Ub8dcyB3pe Rc1g== X-Gm-Message-State: AOAM530Ybptp/qwNl1IMqz7btL6GZ64HcPBfQtlKrVcsjkJQ6uKN+2Gw uY/w1WVmwPpHXYC5ap0pAdu3FXkSW0cnwg== X-Google-Smtp-Source: ABdhPJzEZs/BIeMCZJtpWjZuVhTj16EO3HhFBBy/DHoDzJEtQRn9UYd6ZI+vDibTOp1uZgcWjF7a7g== X-Received: by 2002:a05:6402:4390:b0:42e:b7e:e9ac with SMTP id o16-20020a056402439000b0042e0b7ee9acmr30654624edc.97.1654589445469; Tue, 07 Jun 2022 01:10:45 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id 10-20020a170906308a00b006fece722508sm7296695ejv.135.2022.06.07.01.10.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jun 2022 01:10:44 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Alistair Delva , Bin Meng , Daniel Schwierzeck , Heinrich Schuchardt , Marek Vasut , Michal Simek , Ovidiu Panait , Rick Chen , Sean Anderson , Simon Glass Subject: [PATCH v2 00/23] microblaze: Add support for full relocation Date: Tue, 7 Jun 2022 10:10:17 +0200 Message-Id: X-Mailer: git-send-email 2.36.0 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. Thanks, Michal 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 | 23 +- 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 +++++++++++++++++++++++++-- 14 files changed, 786 insertions(+), 96 deletions(-) create mode 100644 arch/microblaze/cpu/relocate.c -- 2.36.0