Can I control the output section for constant strings?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All

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?


-------------
Best Regards,
PRC
Aug 14, 2008

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux