[Bug target/71151] [avr] -fmerge-constants and -fdata-sections/-ffunction-sections results in string constants in .progmem.gcc_sw section

senthil.thecoder at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue May 31 17:26:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71151

--- Comment #7 from Senthil Kumar Selvaraj <senthil.thecoder at gmail dot com> ---
Created attachment 38613
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38613&action=edit
Tentative patch for 6.1

Looks like the right fix will need to somehow differentiate between jump tables
and other per function data when the function_rodata_section target hook is
invoked. I'll submit a tentative patch in the next couple of days that does
that.

However, I don't think that patch will get into 6.x, given that it changes the
target hook interface. The attached patch instead tries to work around the
problem, by letting default_elf_select_section run as usual, but then returning
a different section with the name reverted to the right prefix (rodata instead
of progmem), with the correct flags (MERGE and STRINGS)


More information about the Gcc-bugs mailing list