4 ms·
"text" isn't the right section name; that'll create a new data section named "text", and then you'll segfault trying to execute out of a data section. Specifyi
by JoshTriplett 10y ago
"text" isn't the right section name; that'll create a new data section named "text", and then you'll segfault trying to execute out of a data section.
Specifying ".text" causes the toolchain to attempt to create a data section named ".text", which causes the "changed section attributes" message; the array then correctly ends up in the executable ".text" section, though. I'd like to see a way to declare a section without attempting to make it a data section, but I think the compiler folks' answer to that would probably be "use a linker script". And I don't know a way to disable the warning.