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 DC754CCA478 for ; Thu, 2 Jun 2022 13:58:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 62D5784323; Thu, 2 Jun 2022 15:58:01 +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="1dxWQ0ie"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C03A184330; Thu, 2 Jun 2022 15:57:58 +0200 (CEST) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 96A9B8432D for ; Thu, 2 Jun 2022 15:57:52 +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-x62b.google.com with SMTP id rq11so10163183ejc.4 for ; Thu, 02 Jun 2022 06:57:52 -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=3LSmCDr6rYKKdzZbgB21evaDxF4geJiIb+L3fD9vVgg=; b=1dxWQ0ie5R8Eyxu/ImJwx9s2VSYInzvAO1DOO7kdPnkSJkyqh5GWU02tuwaRpMhk9w MoPbPZ1LHG+Z+JBXss4atVJoGvCPSan1UR2CzJzu3xY4Ll3Te3mamKFgLJ6eGaiU5NBe 9hECYgb7PFqxRLgkUnGiQ4LtoL4bwg3tJ5jHvPAIMvGovqr5t3lLr91zTRn08XifK9Jf LmDsLF/b8hLqDUUFNAslk2rQtaDFzw7Xs2r0AIEjx2O2EKBTHkQRtd53mZiLM1Cw27JD +8XEnZLoy9bZPGwfCfeSa2z8Z7hvy33Bg10baTYmh6l2Gs5DNjn5XMfM8wlsaWmbmkwb qLBA== 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=3LSmCDr6rYKKdzZbgB21evaDxF4geJiIb+L3fD9vVgg=; b=lmZAxa3qSF7noNcs3gN7pY4waEU0sRq+ion62oRclP/HuPRaBtotq6AlHxZTKsdGw2 XYFB1h5hRubIwAEfaVHN8EInPLsiuThvcgOHKVc0j9ycF5A0BbESGljN6wbInPVfthdA 0T7hi9pj4dqlpjjE0bZtFopJmzVR1OLYrARtwv9WXwhMAvEYyBhcz6AxQR+4bwlz2ct+ TO3I+USsELI681NuWVMA3hXV1BicZBS/g/HlD3hE+VutFtQB2BNza7RypUmZGGk80rGo KdZGxmigqvPoq9gVuFiVngjvSHrNwNCv7Iavucgcu6nyM5e5xdWe2jcUDcOYJm7ftzhA x4+w== X-Gm-Message-State: AOAM531fmlzamTLvQXRwlvyDZeuiVUqdrgrAieDfL/zaSQ1AFVGuQ5X+ PiR8Q1bJyiFZ9f6hjvCb8+q6GSMe9T3Vsw== X-Google-Smtp-Source: ABdhPJwZTv8MiE//qhjVrANhEnWWlBoP/cDFcJm2T4gNVQ2IGRiKfC6NsEdXdDJas50NYdXHHR/7aA== X-Received: by 2002:a17:907:961a:b0:6ff:b74:7e67 with SMTP id gb26-20020a170907961a00b006ff0b747e67mr4431643ejc.424.1654178271801; Thu, 02 Jun 2022 06:57:51 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id m16-20020a170906259000b006f3ef214daesm1772125ejb.20.2022.06.02.06.57.51 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jun 2022 06:57:51 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Alistair Delva , Heiko Schocher , Heinrich Schuchardt , Marek Vasut , Michal Simek , Ovidiu Panait , Rick Chen , Sean Anderson , Simon Glass Subject: [PATCH 00/22] microblaze: Add support for full relocation Date: Thu, 2 Jun 2022 15:57:24 +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 There is still one more issue with Kconfig and conflict with MIPS but I want to send it out to be available for review. Thanks, Michal Michal Simek (22): 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 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 | 1 - arch/microblaze/Kconfig | 30 ++ 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 + common/board_f.c | 2 + configs/microblaze-generic_defconfig | 1 + include/configs/microblaze-generic.h | 4 - tools/relocate-rela.c | 545 +++++++++++++++++++++++++-- 13 files changed, 780 insertions(+), 78 deletions(-) create mode 100644 arch/microblaze/cpu/relocate.c -- 2.36.0