+//FIXME : imv_read won't work with optimized immediate values.
+//will need to issue one sys_marker call for each immediate value.
+__attribute__ ((visibility ("protected")))
+void testip(void)
+{
+ printf("addr : %p\n", __builtin_return_address(0));
+}
+
+__attribute__((constructor, visibility ("protected")))
+void marker_init(void)
+{
+ struct marker *iter;
+ int ret;
+
+ printf("Marker section : from %p to %p (init)\n",
+ __start___markers, __stop___markers);
+ testip();
+ for (iter = __start___markers; iter < __stop___markers; iter++) {
+ printf("Marker : %s\n", iter->name);
+ ret = sys_marker(iter->name, iter->format,
+ &imv_read(iter->state), 1);
+ if (ret)
+ perror("Error connecting markers");
+ }
+}
+
+__attribute__((destructor, visibility ("protected")))
+void marker_fini(void)