This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -ffunction-sections -fdata-sections


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]