This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: -ffunction-sections -fdata-sections
- To: hpetriffer at grips dot com
- Subject: Re: [ECOS] -ffunction-sections -fdata-sections
- From: Bart Veer <bartv at redhat dot com>
- Date: Mon, 19 Mar 2001 14:42:41 GMT
- Cc: ecos-discuss at sourceware dot cygnus dot com
- References: <C05DB78BB4E1D411B6C100508BF7DCD53272E0@GRIPS_NTS2>
- Reply-To: bartv at redhat dot com
>>>>> "Hans" == =?iso-8859-1?Q?Hansj=F6rg Petriffer?= <iso-8859-1> writes:
> Hello, the compiler flags "-ffunction-sections -fdata-sections"
> and the linker flag "--gc-sections" are this needed for the
> constructor priority ordering and linker garbage collection? Is
> the compiled program without this options also able to run?
-ffunction-sections, -fdata-sections and --gc-sections are needed only
for linker garbage collection, not for constructor priority ordering.
The latter is controlled by -finit-priority.
Constructor priority ordering is required. eCos initialization depends
on it, so without priority ordering it is completely random whether or
not the various initialization stages happen in the right sequence.
Linker garbage collection is not strictly speaking required. It is a
memory optimization, reducing the size of the final executable and its
RAM needs. However, note that internal testing within Red Hat always
uses linker garbage collection so there may be lurking problems if you
buid without it. In fact there was a posting back in January about
problems building the SNMP package without garbage collection.
Bart