From: Ian Campbell Subject: Re: [PATCH v10 1/5] gcov: Call constructors during initialization Date: Fri, 22 Feb 2013 08:50:51 +0000 Message-ID: <1361523051.26546.106.camel@zakaz.uk.xensource.com> References: <1361463225-21750-1-git-send-email-frediano.ziglio@citrix.com> <1361463225-21750-2-git-send-email-frediano.ziglio@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1361463225-21750-2-git-send-email-frediano.ziglio@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio , Tim Deegan , Stefano Stabellini Cc: George Dunlap , Konrad Rzeszutek Wilk , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2013-02-21 at 16:13 +0000, Frediano Ziglio wrote: > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S > index 410d7db..50e0c4b 100644 > --- a/xen/arch/arm/xen.lds.S > +++ b/xen/arch/arm/xen.lds.S > @@ -84,6 +84,13 @@ SECTIONS > *(.init.data) > *(.init.data.rel) > *(.init.data.rel.*) > + > + . = ALIGN(4); > + __CTOR_LIST__ = .; > + LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) > + *(.ctors) > + LONG(0) > + __CTOR_END__ = .; > } :text > . = ALIGN(32); > .init.setup : { This broke my 64-bit branch (not your fault, it's not merged yet, but I was planning to commit it shortly): prelink.o: In function `init_constructors': /local/scratch/ianc/devel/arm/xen.git/xen/common/lib.c:491:(.init.text+0xc44): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `__CTOR_LIST__' defined in .init.data section in /local/scratch/ianc/devel/arm/xen.git/xen/.xen-arm64-syms.0 To fixup I intend to add the following to my "xen: arm64: initial build + config changes, start of day code". Xen doesn't have a xen/xen.lds.h header, but perhaps adding that and using it to define common things like this as macros might be an interesting future cleanup. 8<-------------------------------------- diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 9043994..5136b79 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -91,9 +91,9 @@ SECTIONS *(.init.data.rel) *(.init.data.rel.*) - . = ALIGN(4); + . = ALIGN(BYTES_PER_LONG); __CTOR_LIST__ = .; - LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) + LONG((__CTOR_END__ - __CTOR_LIST__) / BYTES_PER_LONG - 2) *(.ctors) LONG(0) __CTOR_END__ = .;