If you have sections, it might still work for some cases though: on x86
Ubuntu it worked once I changed the section name from autodata to xautodata.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* together at runtime to form tables. This is often used in place of
* having a central registration function or table.
*
* together at runtime to form tables. This is often used in place of
* having a central registration function or table.
*
+ * Note that this technique does not work in general for shared libaries,
+ * only for code compiled into a binary.
+ *
* License: BSD-MIT
*
* Example:
* License: BSD-MIT
*
* Example:
*/
#define AUTODATA_TYPE(name, type) \
typedef type autodata_##name##_; \
*/
#define AUTODATA_TYPE(name, type) \
typedef type autodata_##name##_; \
- extern type *__start_autodata_##name[], *__stop_autodata_##name[]
+ extern type *__start_xautodata_##name[], *__stop_xautodata_##name[]
/**
* AUTODATA - add a pointer to this autodata set
/**
* AUTODATA - add a pointer to this autodata set
*/
#define AUTODATA(name, ptr) \
static const autodata_##name##_ *NEEDED \
*/
#define AUTODATA(name, ptr) \
static const autodata_##name##_ *NEEDED \
- __attribute__((section("autodata_" #name))) \
+ __attribute__((section("xautodata_" #name))) \
AUTODATA_VAR_(name, __LINE__) = (ptr);
/**
AUTODATA_VAR_(name, __LINE__) = (ptr);
/**
*/
#define autodata_get(name, nump) \
((autodata_##name##_ **) \
*/
#define autodata_get(name, nump) \
((autodata_##name##_ **) \
- autodata_get_section(__start_autodata_##name, \
- __stop_autodata_##name, (nump)))
+ autodata_get_section(__start_xautodata_##name, \
+ __stop_xautodata_##name, (nump)))
#endif /* HAVE_SECTION_START_STOP */
/**
#endif /* HAVE_SECTION_START_STOP */
/**