|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] coverage: fix on ARM
commit 49cc1f0431b7ff62780fc84975302eb444edbe05
Author: Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Fri Feb 22 10:57:40 2013 +0000
Commit: Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Tue Mar 12 15:46:50 2013 +0000
coverage: fix on ARM
Use a list of pointers to simplify the handling of 32- vs 64-bit.
Also on ARM the section name is ".init_array" and not ".ctors".
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
[ ijc -- tweak whitespace per Frediano's comment ]
---
xen/arch/arm/xen.lds.S | 10 ++++------
xen/arch/x86/xen.lds.S | 6 ++----
xen/common/lib.c | 13 +++++--------
3 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 9043994..fd755d7 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -91,12 +91,10 @@ SECTIONS
*(.init.data.rel)
*(.init.data.rel.*)
- . = ALIGN(4);
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
+ . = ALIGN(8);
+ __ctors_start = .;
+ *(.init_array)
+ __ctors_end = .;
} :text
. = ALIGN(32);
.init.setup : {
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 5570389..d959941 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -110,11 +110,9 @@ SECTIONS
__trampoline_seg_stop = .;
. = ALIGN(8);
- __CTOR_LIST__ = .;
- QUAD((__CTOR_END__ - __CTOR_LIST__) / 8 - 2)
+ __ctors_start = .;
*(.ctors)
- QUAD(0)
- __CTOR_END__ = .;
+ __ctors_end = .;
} :text
. = ALIGN(32);
.init.setup : {
diff --git a/xen/common/lib.c b/xen/common/lib.c
index e0c65cf..e3cb3f4 100644
--- a/xen/common/lib.c
+++ b/xen/common/lib.c
@@ -479,17 +479,14 @@ unsigned long long parse_size_and_unit(const char *s,
const char **ps)
return ret;
}
-extern const struct
-{
- unsigned long count;
- void (*funcs[1])(void);
-} __CTOR_LIST__;
+typedef void (*ctor_func_t)(void);
+extern const ctor_func_t __ctors_start[], __ctors_end[];
void __init init_constructors(void)
{
- unsigned long n;
- for ( n = 0; n < __CTOR_LIST__.count; ++n )
- __CTOR_LIST__.funcs[n]();
+ const ctor_func_t *f;
+ for ( f = __ctors_start; f < __ctors_end; ++f )
+ (*f)();
}
/*
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |