aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/lib.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-02-22 10:57:40 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-03-12 15:46:50 +0000
commit49cc1f0431b7ff62780fc84975302eb444edbe05 (patch)
treece6ab80008a249f489d6497cfa876ea41b0e4b44 /xen/common/lib.c
parentb0583c0e64cc8bb6229c95c3304fdac2051f79b3 (diff)
downloadxen-49cc1f0431b7ff62780fc84975302eb444edbe05.tar.gz
xen-49cc1f0431b7ff62780fc84975302eb444edbe05.tar.bz2
xen-49cc1f0431b7ff62780fc84975302eb444edbe05.zip
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@citrix.com> Acked-by: Keir Fraser <keir@xen.org> [ ijc -- tweak whitespace per Frediano's comment ]
Diffstat (limited to 'xen/common/lib.c')
-rw-r--r--xen/common/lib.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/xen/common/lib.c b/xen/common/lib.c
index e0c65cfec3..e3cb3f4730 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)();
}
/*