ld linker script INPUT(-lfile)

Posted on 2009-04-30
Last Modified: 2012-06-27
hi all ,
I just reading the documents about the how to write linker scripts ,

and the INPUT command explains like this

>>If you use INPUT (-lfile), ld will transform the name to libfile.a, as with the command line argument -l.

>>When you use the INPUT command in an implicit linker script, the files will be included in the >>link at the point at which the linker script file is included. This can affect archive searching.

what is the difference of the libfile.a and file.o ?

is that .a means that static library file ? what is that command line options ?

-- Thanks in advance --
Question by:NicAx64
    LVL 86

    Expert Comment

    >>what is the difference of the libfile.a and file.o ?

    libfile.a is a static library created with 'ar', e.g. like

    ar -cr libfile.a libfile.o

    (creates libfile.a from file.o)

    whereas file.o is just an object file created during the compilation proces, which can either be linked to an executable image via 'ld' or archived in a lib using 'ar' as above.
    LVL 86

    Accepted Solution


    Author Comment

    excellent sir ,
    that's meet the answer to the question, however if you got something to read please let me know.
    I'm currently reading this ,

    Author Closing Comment

    nice work
    thanks in advance ,
    I'm reading you'r man pages.
    LVL 86

    Expert Comment

    Hm, I guess would be some good material on this issue, as well as the other HOWTOs listed under

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    countTriple  challenge 8 59
    lucky13 challenge 11 96
    tenRun challenge 28 72
    sumDigits  challenge 7 41
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now