From patchwork Mon Jul 2 16:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140830 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139971ljj; Mon, 2 Jul 2018 09:21:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdXnfzzt1mGYaNU3WGo0gPAgU15VkKYSPxLL2RtLSPKY3OuffWEWfxsa+LD/TkBWG7XdwIo X-Received: by 2002:a6b:3e46:: with SMTP id l67-v6mr10344818ioa.294.1530548498323; Mon, 02 Jul 2018 09:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548498; cv=none; d=google.com; s=arc-20160816; b=P+0qZa+8PxbSWVDidt/y6GVuZ/jKaSrn2nUP6oSEESA6424rH4mRx+3CXtF4c+PHs+ RP4l66DzY+r3/ZADaKoj2DFbS68RIg30wA1ZGqKleBt3xYys/CWuqfYt/zXc6JYA9Agz Ahk22CWKrzulA/WwqbK1/pOaCRx/dymWzejYIuWeISP+igRzGan667RTEWluHIXY8pKY o7Ub7gMZsKKb9u+Iho7mRfhFfZOvd8e5ZcHhWWJz8XigL9+ncaBKVwJ6+Qier68fanBG YwFPXnzeYgMj+R2hHE+vT34XwmB1KB/N15dWfReNaFgS2xa9aEMI0OqulOZ7Ji+2TIXZ v9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=SpJ7mF1kpWn85VkkPyF0wK6IwZR9Dsq75QOk8teR4Fs=; b=WA4C0jt9UDFb3bC64Fcdata3Vb5g73+mmb2EV4sgNgb2H2aNk3luM+E46Fkz3xiSKo Lt1OygOm5zTCj57fTGmKPEEfFm8hzOuGeG8hejgW9QvMKTNtnH/N1lOHJs4kGn+qmtfm oCbQvPrPYuuBIMWZwVgxQLZUSo4tlO/+QBlleUPj3sXUKcOlChHRLp2zLQT/IqDlP5+Z euN6SK9yiWhtF09y+7Y8kTUdDLuS+WtP1f7Kn+Nf5XXH1xLbSB8FYY6hA0Fana6OnQAT /AJ5Onk5OhRAck7JMzlpVQgU6KJqlDeW4tsXXGJzwMINC/mJKuIExdCtpltZ7gfcdLlu 5TQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id v185-v6si5696767itd.96.2018.07.02.09.21.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Y0-0006s4-0s; Mon, 02 Jul 2018 16:19:28 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xz-0006rX-1c for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:27 +0000 X-Inumbo-ID: b1dba576-7e13-11e8-ba45-cfc176a5991c Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id b1dba576-7e13-11e8-ba45-cfc176a5991c; Mon, 02 Jul 2018 16:19:28 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D8D241529; Mon, 2 Jul 2018 09:19:25 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1DFEF3F5BA; Mon, 2 Jul 2018 09:19:24 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:09 +0100 Message-Id: <20180702161910.2013-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 6/7] xen/libfdt: Put all libfdt in init X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Libfdt is used for: - Unflatten the Flatten Device-Tree (FDT) blob - Create Device-Tree for the Hardware-Domain Both use are done during the initialization of Xen. So move all the libfdt to init. Note that the runes was borrowed from libelf Makefile. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/common/libfdt/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile index 7578fe9c50..d81f54b6b8 100644 --- a/xen/common/libfdt/Makefile +++ b/xen/common/libfdt/Makefile @@ -1,5 +1,13 @@ include Makefile.libfdt -obj-y += $(LIBFDT_OBJS) +SECTIONS := text data $(SPECIAL_DATA_SECTIONS) + +obj-y += libfdt.o CFLAGS += -I$(BASEDIR)/include/xen/libfdt/ + +libfdt.o: libfdt-temp.o Makefile + $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ + +libfdt-temp.o: $(LIBFDT_OBJS) + $(LD) $(LDFLAGS) -r -o $@ $^