Bug 40113 - [avr] C++, -fdata-sections not works with .progmem data
Summary: [avr] C++, -fdata-sections not works with .progmem data
Status: RESOLVED DUPLICATE of bug 39456
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.2
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-12 10:28 UTC by Sergey A. Borshch
Modified: 2009-05-12 14:51 UTC (History)
3 users (show)

See Also:
Host: x86
Target: avr-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey A. Borshch 2009-05-12 10:28:26 UTC
all data placed to single .progmem.data section.
test.cpp:
char __attribute__((__progmem__)) Test1[] = "test1";
char const __attribute__((__progmem__)) Test2[] = "test2";

void const * array[] = 
{
    Test1, Test2
};

cmd line:
avr-gcc  -mmcu=atmega8 -fdata-sections -Wall -Os -Wa,-ahlmsd=test.lst -c  test.cpp -o test.o

listing:
   8               	.global	Test1
   9               		.section	.progmem.data,"a",@progbits
  12               	Test1:
  13 0000 7465 7374 		.string	"test1"
  13      3100 
  14               	.global	array
  15               		.section	.data.array,"aw",@progbits
  18               	array:
  19 0000 0000      		.word	Test1
  20 0002 0000      		.word	_ZL5Test2
  21               		.section	.progmem.data
  24               	_ZL5Test2:
  25 0006 7465 7374 		.string	"test2"
  25      3200 

here array placed into unique section .data.array, while Test1 and Test2 into single section .progmem.data
Comment 1 Andrew Pinski 2009-05-12 14:51:30 UTC

*** This bug has been marked as a duplicate of 39456 ***