[ECOS] device code link problem
Bart Veer
bartv@redhat.com
Thu May 18 04:04:00 GMT 2000
>>>>> "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
More information about the Ecos-discuss
mailing list