How to apply section attribute to a each string inside strings array

Elad Yosef elad.yosef@gmail.com
Fri Jul 13 05:41:00 GMT 2012


Hi, I have a constant strings array that I init in the following way.

__attribute__((section("syslog.stringstable."#_name))) const CHAR*
_name[_size] =
{
    [0] = "error string 1",
    [1] = "error string 2",
    [2] = "error string 3"
}

I see that the array itself is in the right section, but the strings
are in different section.
The array has contains addresses of the strings in the rodata section.

How can I set section attribute section to the strings?

Thanks

Elad



More information about the Gcc-help mailing list