This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil Linker problems.

Hello,

I am using Keil4.1 and STM32F107VCT processor.
After compilation of a set of files we require .map file even if all function definitions are not available. I am using --partial to achieve this.

But usage of this option results in "Library Totals" = 0


     Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Object Name

        28          6          0          8          0         76   Subsystem.o

    ----------------------------------------------------------------------
        28          6          0         12          0         76   Object Totals
         0          0          0          4          0          0   (incl. Generated)
         0          0          0          0          0          0   (incl. Padding)

    ----------------------------------------------------------------------
         0          0          0          0          0          0   Library Totals
         0          0          0          0          0          0   (incl. Padding)

    ----------------------------------------------------------------------

==============================================================================

The output as seen from the map file when partial is not used is "Library Totals" = 2444.


      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Object Name

        28          6          0          8          0         76   Subsystem.o

    ----------------------------------------------------------------------
        28          6          0          8          0         76   Object Totals
         0          0          0          0          0          0   (incl. Generated)
         0          0          0          0          0          0   (incl. Padding)

    ----------------------------------------------------------------------

      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Library Member Name

        22          0          0          0          0        100   _rserrno.o
         8          4          0          0          4         68   rt_errno_addr.o
        98          4          0          0          0         92   d2f.o
       826         16          0          0          0        356   daddsub_clz.o
        16          4          0          0          0         68   dcheck1.o
        24          0          0          0          0         68   dcmpi.o
       688        140          0          0          0        212   ddiv.o
        94          4          0          0          0         92   dfix.o
        46          0          0          0          0         68   dflt_clz.o
       120          4          0          0          0         92   dleqf.o
       340         12          0          0          0        104   dmul.o
       156          4          0          0          0         92   dnaninf.o
        12          0          0          0          0         68   dretinf.o
       108          0          0          0          0         80   drleqf.o
        86          4          0          0          0         84   f2d.o
       140          4          0          0          0         84   fnaninf.o
        10          0          0          0          0         68   fretinf.o
       100          0          0          0          0         68   retnan.o
        92          0          0          0          0         68   scalbn.o
        48          0          0          0          0         68   trapv.o
         0          0          0          0          0          0   usenofp.o
        16          6          0          0          0         68   dunder.o
       656         90         88          0          0        212   exp.o
        40          0          0          0          0         68   fpclassify.o
       170          0          0          0          0         96   poly.o

    ----------------------------------------------------------------------
      3924        296         88          0          4       2444   Library Totals
         8          0          0          0          0          0   (incl. Padding)


    ----------------------------------------------------------------------

Please let me know how we can get a linked map file with the library files included( ie without removing --partial).

Thanks in advance,

With Best Regards,
Renjith

  • The obvious answer is to generate the map file with --partial omitted, then generate the actual object file with --partial.
    The question is, why do you need 'library totals'?
    Apparently, the linker does not pull library code when doing partial linking. Hence, libray totals is zero. I think it makes a lot of sense.

  • Dear Mike,

    Thanks for your response.

    Sorry for not explaining my requirement in detail.

    I have a sequence of automated test cases for measuring the code size in various cases.

    1st test case needs the "library totals" for some verifications whereas the 2nd test case has some functions whose definitions are not included.

    I checked it separately, 1st test case passed when I did not use "--partial" whereas the second test case passed when I used "--partial"

    Our requirement is to use the same make file(linker options) in both cases.

    As you said," the linker is not pulling out library code when doing partial linking". My doubt is whether it is possible(using some other mechanisms/options) to force the linker to do so ?

    Thanks in advance.

    With Best Regards,
    Renjith George