[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v10 1/5] gcov: Call constructors during initialization



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__ = .;





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.