DSPRelated.com
Forums

Linking objects in libraries

Started by Keld Hammerum Andersen August 15, 2001
Hi everybody,

I use several functions from the object library "libc.dlb" in my 21065L
project. In my ldf I specify the "seg_pmco" sections from this library
to be placed in internal program memory. However, now I want to take a
specific function/object from this library and place it in external
memory. Specifically, I would like the function "ifft128(...)" to be
placed in and be executed from external memory.

So, my question is: how do I "separate" individual functions/objects in
the libc.dlb object library from the others in order to place them in
different memory segments?

Thanks in advance

Keld Hammerum Andersen



On Wed, 15 Aug 2001 08:55:58 +0200, Keld Hammerum Andersen wrote:

> However, now I want to take a
> specific function/object from this library and place it in external
> memory. Specifically, I would like the function "ifft128(...)" to be
> placed in and be executed from external memory.

I'm curious why you'd want to do that. That's a particularly
compute-intensive function, and would benefit from running at the
higher speed of internal memory. I'd think if you were tight for space
that you'd want to move something else that's not a number-cruncher out
of internal memory.



hello,
On a side note along the same lines. Is it possible to remove
unnecessary files from the libc build in vdsp++ so that the library doesn't
have to be quite so large? For instance if you are not using any string
functions, could those .asm files be removed from the build? or would that
have some kind of adverse effect? (the build and the target file would both
be renamed, of couse so as not to destroy anything important). Thanks :)
Tom -----Original Message-----
From: Christoph Ripcke [mailto:]
Sent: Wednesday, August 15, 2001 9:35 AM
To: 'Keld Hammerum Andersen';
Subject: AW: [adsp] Linking objects in libraries Hi Keld,

try
elfar -e libc.dlb ifft.doj
then you get the common ifft core function object. You can extract/copy the
file to somewhere within your project tree and refer in the ldf file to that
object.

seg_xmco // external code memory
{
INPUT_SECTIONS( ifft.doj(seg_pmco) ... /* other references */ )
} > seg_xmco

Have in mind that ifft.doj only contains the program code not the twiddle
factors which are included in the approbiate rfftN.doj files.
May be you know that you can use the forward fft function (if it's already
linked) to calculate the inverse fft. If not you could have a look at ADI
Aplication Handbook chapter 7.4.

regards
Christoph

>>-----Ursprgliche Nachricht-----
>>Von: Keld Hammerum Andersen [mailto:]
>>Gesendet: Mittwoch, 15. August 2001 08:56
>>An:
>>Betreff: [adsp] Linking objects in libraries
>>
>>
>>Hi everybody,
>>
>>I use several functions from the object library "libc.dlb" in
>>my 21065L
>>project. In my ldf I specify the "seg_pmco" sections from this library
>>to be placed in internal program memory. However, now I want to take a
>>specific function/object from this library and place it in external
>>memory. Specifically, I would like the function "ifft128(...)" to be
>>placed in and be executed from external memory.
>>
>>So, my question is: how do I "separate" individual
>>functions/objects in
>>the libc.dlb object library from the others in order to place them in
>>different memory segments?
>>
>>Thanks in advance
>>
>>Keld Hammerum Andersen
>>
>>
>>
>>_____________________________________
>>Note: If you do a simple "reply" with your email client, only
>>the author of this message will receive your answer. You
>>need to do a "reply all" if you want your answer to be
>>distributed to the entire group.
>>
>>_____________________________________
>>About this discussion group:
>>
>>To Join: Send an email to
>>
>>To Post: Send an email to
>>
>>To Leave: Send an email to
>>
>>Archives: http://groups.yahoo.com/group/adsp
>>
>>Other Groups: http://www.dsprelated.com/groups.php3
>>
>>
>>">http://docs.yahoo.com/info/terms/
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://groups.yahoo.com/group/adsp

Other Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/


Hi everybody,

I wouls suggest running the "elfar.exe" archiver with the -d switch. See
documentation for details.

Keld

P.S. Here is a strange thing. Why is the -e switch not explained in the archiver
command line reference document?

"Hanley, Tom" wrote:

> hello,
> On a side note along the same lines. Is it possible to remove
> unnecessary files from the libc build in vdsp++ so that the library doesn't
> have to be quite so large? For instance if you are not using any string
> functions, could those .asm files be removed from the build? or would that
> have some kind of adverse effect? (the build and the target file would both
> be renamed, of couse so as not to destroy anything important). Thanks :)
> Tom
>
> -----Original Message-----
> From: Christoph Ripcke [mailto:]
> Sent: Wednesday, August 15, 2001 9:35 AM
> To: 'Keld Hammerum Andersen';
> Subject: AW: [adsp] Linking objects in libraries
>
> Hi Keld,
>
> try
> elfar -e libc.dlb ifft.doj
> then you get the common ifft core function object. You can extract/copy the
> file to somewhere within your project tree and refer in the ldf file to that
> object.
>
> seg_xmco // external code memory
> {
> INPUT_SECTIONS( ifft.doj(seg_pmco) ... /* other references */ )
> } > seg_xmco
>
> Have in mind that ifft.doj only contains the program code not the twiddle
> factors which are included in the approbiate rfftN.doj files.
> May be you know that you can use the forward fft function (if it's already
> linked) to calculate the inverse fft. If not you could have a look at ADI
> Aplication Handbook chapter 7.4.
>
> regards
> Christoph
>
> >>-----Ursprgliche Nachricht-----
> >>Von: Keld Hammerum Andersen [mailto:]
> >>Gesendet: Mittwoch, 15. August 2001 08:56
> >>An:
> >>Betreff: [adsp] Linking objects in libraries
> >>
> >>
> >>Hi everybody,
> >>
> >>I use several functions from the object library "libc.dlb" in
> >>my 21065L
> >>project. In my ldf I specify the "seg_pmco" sections from this library
> >>to be placed in internal program memory. However, now I want to take a
> >>specific function/object from this library and place it in external
> >>memory. Specifically, I would like the function "ifft128(...)" to be
> >>placed in and be executed from external memory.
> >>
> >>So, my question is: how do I "separate" individual
> >>functions/objects in
> >>the libc.dlb object library from the others in order to place them in
> >>different memory segments?
> >>
> >>Thanks in advance
> >>
> >>Keld Hammerum Andersen
> >>
> >>
> >>
> >>_____________________________________
> >>Note: If you do a simple "reply" with your email client, only
> >>the author of this message will receive your answer. You
> >>need to do a "reply all" if you want your answer to be
> >>distributed to the entire group.
> >>
> >>_____________________________________
> >>About this discussion group:
> >>
> >>To Join: Send an email to
> >>
> >>To Post: Send an email to
> >>
> >>To Leave: Send an email to
> >>
> >>Archives: http://groups.yahoo.com/group/adsp
> >>
> >>Other Groups: http://www.dsprelated.com/groups.php3
> >>
> >>
> >>">http://docs.yahoo.com/info/terms/
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author of
> this message will receive your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you want
your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/




"Hanley, Tom" wrote:
> hello,
> On a side note along the same lines. Is it possible to remove
> unnecessary files from the libc build in vdsp++ so that the library doesn't
> have to be quite so large? For instance if you are not using any string
> functions, could those .asm files be removed from the build? or would that
> have some kind of adverse effect? (the build and the target file would both
> be renamed, of couse so as not to destroy anything important). Thanks :)

The linker places only object files into an executable which are needed
(e.g. are referenced within another object). It doesn't matter if the
object file is seperate or comes from a lib.

In other words: if you don't use any string functions, they are not
included in the executable, even if they are in a lib which is included
in the build process.

Michael



On Thu, 16 Aug 2001 17:53:00 +0200, Michael Haertl wrote:

> The linker places only object files into an executable which are needed
> (e.g. are referenced within another object). It doesn't matter if the
> object file is seperate or comes from a lib.

That's true of modules in libraries, but I don't think it's true of
separate object modules specified on the command line or in the LDF
file. Separate object modules will get linked even if you don't
reference them.

You *can* get the linker to delete unused functions and data within
modules. It's a little tricky as you have to specify an anchoring
symbol that's the root of the "used stuff" tree. You also have to
specify which segments are eligible for pruning. There were some bug in
the 1.0 library structure that caused some required code to get tossed
if you used this mechanism, so be sure to apply the service pack first
if you want to use sub-module pruning.