how can i move such function code which i did not use in my application progamme ?

Joel Sherrill joel.sherrill at OARcorp.com
Thu Jun 14 13:05:22 UTC 2001


"Aaron J. Grier" wrote:
> 
> On Wed, Jun 13, 2001 at 11:43:15AM +0800, red-eye at 263.net wrote:
> > i look at my rtems-helloworld.num file
> 
> [snip]
> 
> > in the hello-world programe ,you know,i did not use many function in
> > the rtems-helloworld.num.why it compile in my code size? such as
> >
> > 0200ce60 T __CORE_semaphore_Initialize
> > 0200cea0 T __CORE_semaphore_Seize
> > 0200cf1c T __CORE_semaphore_Surrender
> > 0200cf6c T __CORE_semaphore_Flush
> >
> > obviously,in the hello-world programe ,i did not use semaphore can you
> > tell me why ?  and how can i move such function code which i did not
> > use in my application progamme ? use confdefs? but how ?

NEver say obviously. :)  There are numerous support libraries in play.
hello world uses the console which may use termios which in turn
uses semaphores.  THe network stack uses events.
 
> somewhere in the code these symbols are being referenced, and so at
> final link code for them is being pulled in.
> 
> my guess is that you are compiling in managers you are not using.  If
> you are using hand-built Makefile with RTEMS-provided makefile includes,
> I think if you define MANAGERS= (nothing) then you will not get extra
> code, or only tiny stubs.

This is  possible.  Use the -Map option (I think) on ld to figure out
why it is referenced.  If it is not necessary, then minor code tinkering
usually solves it.  Say two functions f() and g() are in the same
file.  You use f() not g() and g() calls sin().  You always end up
with sin() even though you never call g().  SPlitting f() and g()
into separate files will remove this dependency.
 
> --
>   Aaron J. Grier   |    Frye Electronics, Tigard, OR   |   aaron at frye.com
>                        Of course unix clones exist...
>                   How else are unix supposed to reproduce?

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list