"Pan ruochen" <panruochen@xxxxxxxxx> writes: > For the following code: > |----------------------------------------------------| > | #define __init __attribute__((section(".init"))) | > | int __init foo_init(void) | > | { | > | ... | > | printf("foo_init\n"); | > | ... | > | } | > |----------------------------------------------------| > I want gcc to put the constant string "foo_init\n" into the section > .init as well, instead of the section .rodata. And for other functions > which are not marked as __init, the constant strings are put defaultly. > Can I do this? And how? static const char foo_init_string[] __attribute__((section(".init"))) = "foo_init\n"; ... printf(foo_init_string); I don't think there is any way to make this happen automatically. Ian