[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-libc-dev] PROGMEM section variables throw awayby --gc-sections?
From: |
Weddington, Eric |
Subject: |
RE: [avr-libc-dev] PROGMEM section variables throw awayby --gc-sections? |
Date: |
Wed, 14 Nov 2007 06:45:54 -0700 |
-----Original Message-----
From: address@hidden on behalf of Dean
Sent: Wed 2007-11-14 3:59 AM
To: Rolf Ebert
Cc: address@hidden
Subject: Re: [avr-libc-dev] PROGMEM section variables throw awayby
--gc-sections?
> --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
>
Tested with -ffunction-sections and -fdata-sections, neither make any
difference. Funny thing is, not all my PROGMEM data is being thrown away,
only two unreferenced ones. I suppose the linker's technically justified in
removing them, but is there a way to indicate that I want *all* PROGMEM
variables preserved, no matter what?
Come on, the linker is doing what you tell it to do. It's not psychic! Either
don't use the -gc-sections switch, or use a custom linker script that uses the
KEEP directive on the section. (See the ld manual for more information about
this.)