Re: Regarding symbol resolving in VxWorks



On Jun 27, 7:32 am, "Michael R. Kesti" <michaelke...@xxxxxxxxxx>
wrote:
"Ignacio G.T." wrote:
satish....@xxxxxxxxx escribió:

I have one more question. It will be helpful for me if anybody
clarifies me this.

I built one library "libtest.a"  which has functions named func1,
func2, func3, func4, func5 , func6 in a single file.

And I built one application "app.out" which uses only one function
func5 from above library.

[X]

Is there any way to link only the function func5 in my application?

I thought of breaking each function into different file but this is
not effective solution for me.

This is the only solution, as far as I know. The linker always links
whole compilation units, i.e., object files (*.o).

This, for most linkers, is true for object files (*.o) but not for
libraries/archives.  This can be observed in the VxWorks driver libs
where multiple drivers are archived per file but only those referenced
are linked into the output file.

Satish, you can help us help you by providing more information.  What
tool set are you using?  How did you build the library and how are you
linking it into you app.out.  (Supplying actual command lines would be
a good way to answer the latter.)

You know, it could be that, because you are creating an application, the
partial linker rules are being used and the linker decides it cannot know
which functions are going to be ultimately referenced and therefore
includes them all.

Why is this not effective for you?

Regardless of the answer to that question, this is an interesting
"academic" query!

--
========================================================================
          Michael Kesti            |  "And like, one and one don't make
                                   |   two, one and one make one."
    mrkesti at hotmail dot com     |          - The Who, Bargain- Hide quoted text -

- Show quoted text -

Hi Michael,

I am using MIPS64gnu tool chain.

I built my library by setting archive in the "rules" tab.

Then, in my application project, I am giving following commands in
"rules" tab.


Target : app.out dependencies : test_app.a

$(LD) -EB -r -o app.out app.o -LD:/Satish-6-23-2008/test_lib\MIPS64gnu
-ltest



In above command, app.c is my application, libtest.a is my library.

Please let me know if I have any problem with commnd options.

Regards
Satish.

.



Relevant Pages

  • Re: linkage problems when building a VC7.1 project from the command line
    ... at least one problem seems to be that your link command does not take object files as inputs. ... If I look at a random link command on my system, it contains a list of object files to link together. ... Creating temporary file "c:\timer\Debug\RSP000007.rsp" with contents ... What are these .rsp (linker response) files and how may I re-create them on the command line? ...
    (microsoft.public.dotnet.languages.vc)
  • How a linker works (continued)
    ... Some people insisted that I was generalizing too much and there could be C implementations without object files and C implementations that do not link files in separate compilation but just parse and digest each module, making the whole code generation step in the linker, from an unknown representation. ... Here I am speaking about the very common where the compiler produces traditional object files, ... and two types of relocations for the debug information, ...
    (comp.lang.c)
  • Re: extern variable
    ... the linker is from another GNU package ... GNU doc, ... actually invoked under) gcc marks items in the object files as ... AFAIK GNU ld always does this for common, ...
    (comp.lang.c)
  • Re: Object files
    ... >> .c file are source files in human reabable form, ... > that depends on the brand of compiler you use. ... > linker or another version of the same compiler. ... or more object files stored one after the other in a single ...
    (comp.lang.c)
  • How do linkers work?
    ... this is an error because the linker ... The COFF format used under windows 32 bit ... are seen by the linker in the same way as many object files. ... speaking about extended characters in identifiers, ...
    (comp.lang.c)