From nobody Mon Feb 9 16:54:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1571849393; cv=none; d=zoho.com; s=zohoarc; b=Bq0TCjD0Lfs28L+X964tUIyKOe+g0Snw6aimlLHEttaYvn6uVnvfgvsAHyO283hGRcmShuvg9sv84RWIzmFTxT/B85pqRxr7QllYrZHBW0ZOQJPwkDO66onfIabgWoWcuxEwRDtAMaBxEhiLgN7T1twHK7EkBr1L3M+yNrZ0Zik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571849393; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/78oK7UlJvd9mNdL73uMCobz+l0vOC+xTVYf3dxNpps=; b=WJKDo6LIUN9Jv3DhxX6X1hp34uCtBG1+egQ8hghRC3rs8rOMb+AehfbjKK72Hr4scea8dSDRvjjNTaEo/1qP4tgJT7Fhqo8dtoDmv66bALhovsIEx1p1UwLm8DOBawevk1E4vpdvZ2f2RgC1KGOCm1mD7fNqM+j4zNejFSzPKYY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1571849393972170.22098054361277; Wed, 23 Oct 2019 09:49:53 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNJob-0007Ps-AA; Wed, 23 Oct 2019 16:48:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNJoa-0007PX-EJ for xen-devel@lists.xenproject.org; Wed, 23 Oct 2019 16:48:52 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f87304b8-f5b4-11e9-8aca-bc764e2007e4; Wed, 23 Oct 2019 16:48:42 +0000 (UTC) X-Inumbo-ID: f87304b8-f5b4-11e9-8aca-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1571849322; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y0FIGjiDgCfrCtvVDl/alvj9oiarFxRbWo4lLPMs7go=; b=bhPRlh2NIp7GKhDiRSaNdkBVMbo0W6/f4kXvue5VUTrIjbKxX3zMeYIM H6v2j/Lr5jV12wUUjU+1bx8jEyGJ9nJljXfL4DVBn/CCVt1cxmVMzB7Cg hdZe804AWcJ6o8WJ8reKDPYcEsthVTxSYfI17lPR56oz8cV1MP2/FCsrd c=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: yKiBPdXyuu/vc7oB8ss7mW29PQ7Ayo/226IZUNZjpy1IlrGh/hamTc4s2R+AsgYH2alAn9c+CP FAIUt5QsmIIoAuETD8fG//zlq1oX9ots8e9VLlajhwr+cGaK3GnU1+eyOTKw1ad86nMdlIbfLE 9dKmSkkvSyP2zK8hu0/OboBSaDO7RPx7Ghqf1sWawfd96v+NkYGB73+rLfHCSNMUKcLBXAEsVX UdxxcoIcWwp3TgsXTYGmHYVhDcvTmSSV6ZuIKtzy5mdfnDKl26vqWqGc3AbnOFsmqG6wiZeptF rxo= X-SBRS: 2.7 X-MesageID: 7778031 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,221,1569297600"; d="scan'208";a="7778031" From: Anthony PERARD To: Date: Wed, 23 Oct 2019 17:48:21 +0100 Message-ID: <20191023164837.2700240-8-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191023164837.2700240-1-anthony.perard@citrix.com> References: <20191023164837.2700240-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [RFC XEN PATCH 07/23] xen, Kbuild: Handle obj-bin-y and %.init.o objects 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: Anthony PERARD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) SPECIAL_DATA_SECTIONS is put in Kbuild.include so it can be use in kbuild makefiles. Signed-off-by: Anthony PERARD --- xen/scripts/Kbuild.include | 10 ++++++++++ xen/scripts/Makefile.build | 24 ++++++++++++++++++++++++ xen/scripts/Makefile.lib | 7 +++++++ 3 files changed, 41 insertions(+) diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include index 4b0432e095ae..6f95a2519f3c 100644 --- a/xen/scripts/Kbuild.include +++ b/xen/scripts/Kbuild.include @@ -326,6 +326,16 @@ endef # ##########################################################################= ##### =20 +# For building %.init.o files, can be used in kbuild makefiles +SPECIAL_DATA_SECTIONS :=3D rodata $(foreach a,1 2 4 8 16, \ + $(foreach w,1 2 4, \ + rodata.str$(w).$(a)) \ + rodata.cst$(a)) \ + $(foreach r,rel rel.ro,data.$(r).local) + +##########################################################################= ##### + + # delete partially updated (i.e. corrupted) files on error .DELETE_ON_ERROR: =20 diff --git a/xen/scripts/Makefile.build b/xen/scripts/Makefile.build index dd972d5b5edb..68b504c9bdc5 100644 --- a/xen/scripts/Makefile.build +++ b/xen/scripts/Makefile.build @@ -384,6 +384,30 @@ $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE targets +=3D $(filter-out $(subdir-obj-y), $(real-obj-y)) $(real-obj-m) $(= lib-y) targets +=3D $(extra-y) $(MAKECMDGOALS) $(always) =20 +# %.init.o objects +# ---------------- + +quiet_cmd_obj_init_o =3D INIT_OBJ $@ +define cmd_obj_init_o + set -e; \ + $(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' | while read idx name s= z rest; do \ + case "$$name" in \ + .*.local) ;; \ + .text|.text.*|.data|.data.*|.bss) \ + test $$sz !=3D 0 || continue; \ + echo "Error: size of $<:$$name is 0x$$sz" >&2; \ + exit $$(expr $$idx + 1);; \ + esac; \ + done; \ + $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=3D= .init.$(s)) $< $@ +endef + +$(obj)/%.init.o: $(obj)/%.o FORCE + $(call if_changed,obj_init_o) + +# Add intermediates files into tagets +targets +=3D $(patsubst %.init.o,%.o,$(filter %.init.o,$(targets))) + # Linker scripts preprocessor (.lds.S -> .lds) # ------------------------------------------------------------------------= --- quiet_cmd_cpp_lds_S =3D LDS $@ diff --git a/xen/scripts/Makefile.lib b/xen/scripts/Makefile.lib index b746199b7f6b..e022f053494e 100644 --- a/xen/scripts/Makefile.lib +++ b/xen/scripts/Makefile.lib @@ -16,6 +16,10 @@ KBUILD_CFLAGS +=3D $(subdir-ccflags-y) # only build the compiled-in version obj-m :=3D $(filter-out $(obj-y),$(obj-m)) =20 +# For a non-LTO build, bundle obj-bin targets in with the normal objs. +obj-y +=3D $(obj-bin-y) +obj-bin-y :=3D + # Libraries are always collected in one lib file. # Filter out objects already built-in lib-y :=3D $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m))) @@ -108,6 +112,9 @@ name-fix =3D $(squote)$(quote)$(subst $(comma),_,$(subs= t -,_,$1))$(quote)$(squote) basename_flags =3D -DKBUILD_BASENAME=3D$(call name-fix,$(basetarget)) modname_flags =3D -DKBUILD_MODNAME=3D$(call name-fix,$(modname)) =20 +# See comment about INIT_SECTIONS_ONLY in include/xen/compiler.h +$(filter %.init.o,$(real-obj-y) $(extra-y)): ccflags-y +=3D -DINIT_SECTION= S_ONLY + orig_c_flags =3D $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ $(ccflags-y) $(CFLAGS_$(basetarget).o) _c_flags =3D $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c= _flags)) --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel