WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Xen

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH, v2] force out-of-line instances of inline functions

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH, v2] force out-of-line instances of inline functions into .init.text in init-only code
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: 2011年3月14日 09:06:27 +0000
Delivery-date: 2011年3月14日 02:06:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Some compiler versions may choose to not inline certain functions, but
the check introduced in c/s 23003:768269c43914 wants .text to be empty.
Also make sure an eventual error gets properly propagated even on the
first section of an object (.text typically being the first one), and
cover a broader set of sections.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -100,6 +100,8 @@ obj-y := $(patsubst %/,%/built-in.o,$
 
 subdir-all := $(subdir-y) $(subdir-n)
 
+$(filter %.init.o,$(obj-y) $(obj-bin-y)): CFLAGS += -DINIT_SECTIONS_ONLY
+
 ifeq ($(lto),y)
 # Would like to handle all object files as bitcode, but objects made from
 # pure asm are in a different format and have to be collected separately.
@@ -158,8 +160,10 @@ SPECIAL_DATA_SECTIONS := rodata $(foreac
 %.init.o: %.o Makefile
 $(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p}' | while read idx name 
sz rest; do \
 case "$$name" in \
- .text|.data|.bss) test $$sz = 0 || \
- { echo "Error: size of $<:$$name is 0x$$sz" >&2; exit 
$$idx; };; \
+ .text|.text.*|.data|.data.*|.bss) \
+ test $$sz != 0 || continue; \
+ echo "Error: size of $<:$$name is 0x$$sz" >&2; \
+ exit $(shell expr $$idx + 1);; \
 esac; \
 done
 $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section 
.$(s)=.init.$(s)) $< $@
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -14,6 +14,15 @@
 #define always_inline __inline__ __attribute__ ((always_inline))
 #define noinline __attribute__((noinline))
 
+#ifdef INIT_SECTIONS_ONLY
+/*
+ * For sources indicated to have only init code, make sure even
+ * inline functions not expanded inline get placed in .init.text.
+*/
+#include <xen/init.h>
+#define __inline__ __inline__ __init
+#endif
+
 #define __attribute_pure__ __attribute__((pure))
 #define __attribute_const__ __attribute__((__const__))
 

Attachment: init-inline.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH, v2] force out-of-line instances of inline functions into .init.text in init-only code, Jan Beulich <=
Previous by Date: Re: [Xen-devel] page table walk in guest OS , Tim Deegan
Next by Date: Re: [Xen-devel] Kernel BUG at drivers/xen/core/smpboot.c:242 , Jan Beulich
Previous by Thread: [Xen-devel] [xen-4.0-testing test] 6419: regressions - FAIL , xen . org
Next by Thread: [Xen-devel] pvops0 kernel 2.6.32.x still does not boot if x > 18, shouldn't that be fixed for release of Xen 4.0.2/4.1 , Andreas Kinzler
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /