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 3670BC433EF for ; Wed, 15 Jun 2022 10:04:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C4F784417; Wed, 15 Jun 2022 12:04:07 +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="p/gTHaf/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E120784280; Wed, 15 Jun 2022 12:04:05 +0200 (CEST) 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 8FEDB843F6 for ; Wed, 15 Jun 2022 12:04:03 +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-x535.google.com with SMTP id c2so15363202edf.5 for ; Wed, 15 Jun 2022 03:04:03 -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=6pjEed7iO+EIJaJWDg2Nikjusb+gNaCL0bwx6rPZWn4=; b=p/gTHaf/a/tPR4Qa7RbM1lalwkj2yivOvNl+pY9683ejcXDJdsCbJe3mcsUEXCtH02 EumilAuvXuNvuRJSrkzqEQr43/fw3GbKFhI0EK01T3rsPcWbOPlDOv3LIU18TBiqhGiS js9/41GuqdWVqcoNY6RnyYu9opODIzVIA7d3ob0m6U6a+mJCAE0yTfoudILZ8eOk2Ab3 DIUJex79EhMkl/rQy9uKBXu2D4rXUF9sYEAruqqCiK9jL+843EMzN9q6a++qzsN6Kb1Z LdXtD5RvED30AEgIyiS8XTswlLgmVWShD3RTVljY54d6ywNwScli//SxZVbuFfyjj8+Q nTLA== 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=6pjEed7iO+EIJaJWDg2Nikjusb+gNaCL0bwx6rPZWn4=; b=NcDkj4ZoJtDQQefJZ3mrc4w3+BKUR4yLyj11lof9V877EcZbQdZR8TX09uBPKr2ndU 89Ypd7mqx3POfmrNcgbQxh3nA/waWr30Ja9X7a3rO0qvh0D9YoaNxYAuVl3PlJ4nhzno z7UZY1ytyYvc88qrUK5cKvpu1cQzMVI3rn5w2b5rnSpiL4ow+fjWaO7I/zgnkJn5cplX AMYkgZrJLJufp9ivOqV1STcro9o/XCkPjrnCkL+k+JPaWVIhvZhourQDq7hr86LjYt8d /pT+nG+dGORmssiHt2gsqyinUUDWna22KEmFHDtdbwAdZARQkNIUFoxCMiu+QBOkucNz zlcA== X-Gm-Message-State: AJIora/9OvH6tyO/ggQCRBGQSiLXwzUGMkMoNtlMXR2jbwzOOQaWf+pY EMWxqdTJLnEtNqGCx8uuMe2whHRFmxbKew== X-Google-Smtp-Source: AGRyM1sVdAZ91SgSF1Og5VlBNgaFsNvc67hzHiJzV7ZT3j0mlRWYQcwGs6IwhSPz4ansrrW36Iy7HQ== X-Received: by 2002:a05:6402:ea7:b0:433:6141:840e with SMTP id h39-20020a0564020ea700b004336141840emr11689769eda.266.1655287442925; Wed, 15 Jun 2022 03:04:02 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id w26-20020a17090633da00b006fe7d269db8sm6039197eja.104.2022.06.15.03.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 03:04:01 -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 , Bin Meng , Daniel Schwierzeck , Heinrich Schuchardt , Huan Wang , Marek Vasut , Michal Simek , Ovidiu Panait , Rick Chen , Sean Anderson , Simon Glass Subject: [PATCH v3 00/23] microblaze: Add support for full relocation Date: Wed, 15 Jun 2022 12:03:37 +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 byt gitlab CI. Thanks, Michal 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