This is the mail archive of the ecos-discuss@sourceware.cygnus.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: device code link problem


>>>>> "Norbert" == Norbert Schulze <Norbert.Schulze@t-online.de> writes:

    Norbert> I wrote a new device driver and I see the code in
    Norbert> libtarget.a. But the code is not included in the test
    Norbert> program for the new device. What's the trick to include
    Norbert> code from a library that is indirectly accessed?

You are being hit by selective linking. The device driver functions
are never accessed directly, only indirectly via the device name and
the driver table. Hence the linker things that the code is not used
and garbage-collects it.

The eCos build system actually generates two libraries: libtarget.a
and libextras.a. Via some build and linker script magic we make sure
that everything in the latter ends up in the application image,
bypassing the garbage collection. You should specify the destination
library in the CDL line, for example:

    compile -library=libextras.a xyzzy.c

For more details see:
http://sourceware.cygnus.com/ecos/docs-1.3.1/cdl/build.make.html#BUILD.EXTRAS

Bart

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