From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 14 Jan 2022 18:23:32 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8QIW-002EuN-OT for lore@lore.pengutronix.de; Fri, 14 Jan 2022 18:23:32 +0100 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n8QIV-0008Oj-37 for lore@pengutronix.de; Fri, 14 Jan 2022 18:23:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DixWQJZiIgrWg22PJY3Jkn18KiD0O3BJelm/tylrX08=; b=EWrYkbVTEbLhAg 8Cx3vLqRKCdR12B3XAMve7miWxXw/MzBdMNXP1oT0oF59haDG2V4okSzhdBQLLKCJ8aMyokSXvvFO grsIP2OU2hAtjORyvUF92OlIUR9VzrmZSUP74JJBAL7GBATbOVjc8Hucde5r38UapN/LDvpCezgo1 6oe4SIJefqKBgtj7vRO1mAf8yDxc1cT2mcfVdj2F2ABBzlhH3zNETgLPwlCPCew99pinZL2mNaVs2 8CdE944l31NSGtIG/oGIiXiWMOfEcAldCeXlc8nq0le7v/jll5WVlhUVUT4rbbAMP/gU1mQob48oP BjoE0Pmrh8eB5POrlWKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8QHH-009v9s-A5; Fri, 14 Jan 2022 17:22:15 +0000 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8QHB-009v8k-MP for barebox@lists.infradead.org; Fri, 14 Jan 2022 17:22:11 +0000 Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 68E9F2000D; Fri, 14 Jan 2022 17:22:04 +0000 (UTC) Date: Fri, 14 Jan 2022 18:21:09 +0100 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Jules Maselbas Cc: barebox@lists.infradead.org, Louis Morhet , Luc Michel , Yann Sionneau , Clement Leger Message-ID: <20220114182109.6dfe1836@fixe.home> In-Reply-To: <20220114165208.9980-5-jmaselbas@kalray.eu> References: <20220114165208.9980-1-jmaselbas@kalray.eu> <20220114165208.9980-5-jmaselbas@kalray.eu> Organization: Bootlin X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220114_092210_097906_914A5880 X-CRM114-Status: GOOD ( 19.69 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:e::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-5.5 required=4.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: [PATCH 04/13] common: elf: add elf_load_binary X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) TGUgRnJpLCAxNCBKYW4gMjAyMiAxNzo1MjowMyArMDEwMCwKSnVsZXMgTWFzZWxiYXMgPGptYXNl bGJhc0BrYWxyYXkuZXU+IGEgw6ljcml0IDoKCj4gRnJvbTogQ2xlbWVudCBMZWdlciA8Y2xlZ2Vy QGthbHJheS5ldT4KPiAKPiBJbiBvcmRlciB0byBsb2FkIGVsZiBmcm9tIGEgYmluYXJ5IGJ1ZmZl ciwgYWRkIGVsZl9sb2FkX2JpbmFyeS4gVGhpcwo+IHdpbGwgYmUgdXNlZCBieSBGSVQgc3VwcG9y dCB0byBhbGxvdyBsb2FkaW5nIGFuIGVsZiBmcm9tIEZJVC4KPiAKPiBTaWduZWQtb2ZmLWJ5OiBD bGVtZW50IExlZ2VyIDxjbGVnZXJAa2FscmF5LmV1PgoKSGkgSnVsZXMsCgpUaGlzIGlzIG5vdCBt eSBtYWlsIGFkZHJlc3MgYW55bW9yZSwgY291bGQgeW91IHVwZGF0ZSBpdCB3aXRoCmNsZW1lbnQu bGVnZXJAYm9vdGxpbi5jb20gPwoKVGhhbmtzLgoKPiBTaWduZWQtb2ZmLWJ5OiBKdWxlcyBNYXNl bGJhcyA8am1hc2VsYmFzQGthbHJheS5ldT4KPiAtLS0KPiAgY29tbW9uL2VsZi5jICB8IDgzICsr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLQo+ICBpbmNs dWRlL2VsZi5oIHwgIDEgKwo+ICAyIGZpbGVzIGNoYW5nZWQsIDYyIGluc2VydGlvbnMoKyksIDIy IGRlbGV0aW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