avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] PROGMEM section variables throw away by --gc-sections


From: Rolf Ebert
Subject: Re: [avr-libc-dev] PROGMEM section variables throw away by --gc-sections?
Date: Wed, 14 Nov 2007 07:13:16 +0100
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Dean schrieb:
Hi guys,

I've been noticing some strange behaviour with my makefile arguments.

Firstly, LD.exe crashes when I use -mshort-calls with the --relax linker 
option, but *only* if I *don't* use -ffunction-sections and --gc-sections. With 
the latter two options enabled both -mshort-calls and --relax work just fine.

Secondly, -ffunction-sections and --gc-sections seems to throw away some of my 
PROGMEM variables. I rely on a few PROGMEM variables being embedded into the 
binary so I can later distinguish which version it was compiled from, similar 
to:

char PROGMEM buildtime[] = __TIME__;

--gc-sections seems to remove this, although I thought it was only designed to 
remove unused functions and not PROGMEM data. Is there a workaround to this?

--gc_sections removes all sections, that the linker thinks are unused. Did you compile also with the -fdata-sections compiler switch?

The assembler symbol of buildtime is not modified by -ffunction-sections, only by -fdata-sections.

I can also imagine a missing KEEP instruction in the linker script

Rolf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]