RTP file without symbols, smaller files - VxWorks

This is a discussion on RTP file without symbols, smaller files - VxWorks ; Hi all I want do make the vxe files smaller, they are to big now. So I used the strip tool and removed debug info and comments. When I remove more, for example the symbols, the RTP can not be ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: RTP file without symbols, smaller files

  1. RTP file without symbols, smaller files

    Hi all

    I want do make the vxe files smaller, they are to big now.

    So I used the strip tool and removed debug info and comments. When I
    remove more, for example the symbols, the RTP can not be started. Can
    somebody tell me which parts are really used by the loader. Which
    sections can be removed?

    Thanks
    Andi

  2. Re: RTP file without symbols, smaller files

    Hello Andy,

    RTP executables are relocatable. It is therefore required to keep the
    relocation sections and symbol table (which imposes to keep the string
    table as well). Essentially removing the debug information is about
    all you can do.

    Out of curiosity, are you using static RTP executables or dynamic RTP
    executables (i.e. using shared libraries)?

    Cheers,

    --
    PAD

  3. Re: RTP file without symbols, smaller files

    Hello PAD,
    thanks for your information.

    Till now we work with static executables, we don't use shared
    libraries yet.
    But it's planned to make some libraries shared, to save memory space.

    If we have statically linked RTPs, for what is the relocation needed?
    Is there any possibility to remove at least the internal symbols?

    Thanks
    Andy

  4. Re: RTP file without symbols, smaller files

    On Jun 24, 11:43*pm, Andi wrote:
    > Hello PAD,
    > thanks for your information.
    >
    > Till now we work with static executables, we don't use shared
    > libraries yet.
    > But it's planned to make some libraries shared, to save memory space.
    >
    > If we have statically linked RTPs, for what is the relocation needed?
    > Is there any possibility to remove at least the internal symbols?
    >
    > Thanks
    > Andy


    Try

    strip --strip-unneeded myrtp.vxe

    That should remove everything you don't need, but keep stuff you need
    for relocating. Note you can still point Workbench at the original
    unstripped
    file in order to get all the debugging symbols, which is super cool

    Jason

  5. Re: RTP file without symbols, smaller files

    On 25 juin, 00:36, PAD wrote:
    > Hello Andy,
    >
    > RTP executables are relocatable. It is therefore required to keep the
    > relocation sections and symbol table (which imposes to keep the string
    > table as well). Essentially removing the debug information is about
    > all you can do.
    >
    > Out of curiosity, are you using static RTP executables or dynamic RTP
    > executables (i.e. using shared libraries)?
    >
    > Cheers,


    Hi PAD,

    Thank you for your answer, unfortunately vxworks uses ELF (Executable
    and Linkable Format) for its files (kernel module and RTPs)
    Reading the OMF (Object and Module Format) also know as relocatable,
    you will notice that:
    [cite]
    Note that this specification is not applicable for vendors choosing to
    build products with the
    Executable and Linkable Format (ELF), because ELF is both a linkable
    and loadable
    specification.
    [\cite]

    source: http://www.x86.org/ftp/manuals/tools/omf.pdf

    Regards

    --
    Eric

  6. Re: RTP file without symbols, smaller files

    On 25 Jun., 09:30, Jason wrote:
    > On Jun 24, 11:43*pm, Andi wrote:
    >
    > > Hello PAD,
    > > thanks for your information.

    >
    > > Till now we work with static executables, we don't use shared
    > > libraries yet.
    > > But it's planned to make some libraries shared, to save memory space.

    >
    > > If we have statically linked RTPs, for what is the relocation needed?
    > > Is there any possibility to remove at least the internal symbols?

    >
    > > Thanks
    > > Andy

    >
    > Try
    >
    > strip --strip-unneeded myrtp.vxe
    >
    > That should remove everything you don't need, but keep stuff you need
    > for relocating. Note you can still point Workbench at the original
    > unstripped
    > file in order to get all the debugging symbols, which is super cool
    >
    > Jason


    -----
    Hi Jason
    I use the command myrtp.vxe>.
    It's surprising that still so many relocations are neccessary.
    I thought that in a statically linked RTP all libraries are statically
    linked.
    In a really simple C++ sample are many relocations to strlen, strcpy,
    malloc, semGive, semTake, ...
    Why is this so?
    Andy

    ----
    What happens if you don't use "--remove-section=.comment",
    i.e. just do --strip-unneeded.

    That's what I do, and it reduces a 60MB RTP (with -g) to ~ 5MB,
    so something of that order; I don't have the details in front of me.

    You can use objdumpppc -t myrtp.vxe after that to see what's left
    in the file.

    I wouldn't expect there to be very much needed for relocation

    Jason

    ---
    Hi Jason
    I have tried --strip-unneeded. It gives the same result as --remove-
    section=.comment --strip-unneeded, except that the comments are still
    present.

    With which tool chain do you work? Also gcc version 3.4.4 (Wind River
    vxworks-6.5) (built 20070108)?

    Andy

    p.s. Sorry that I have sent you an email directly. I pushed the wrong
    button.


  7. Re: RTP file without symbols, smaller files

    Hello Andy,

    On Jun 24, 11:43 pm, Andi wrote:
    >
    > Till now we work with static executables, we don't use shared
    > libraries yet.
    > But it's planned to make some libraries shared, to save memory space.


    Ok. Are you storing the .vxe files on ROMFS? Are you starting your
    user-side application via the shell or programmatically (this makes a
    difference because the default for RTPs spawned via the kernel shell
    is to create a on-system symbol table for each of those RTPs, hence
    adding to the RAM consumption).

    > If we have statically linked RTPs, for what is the relocation needed?


    This is the way RTPs are designed and implemented : the executable
    files are meant to be relocated. The underlying reason is the very
    varied memory maps on VxWorks systems due to the hardware
    characteristics as well as the highly configurable and tunable nature
    of VxWorks. This is not to say that it is impossible to statically
    link RTP executables for their execution address and therefore skip
    the relocation phase but the way VxWorks 6.x currently handles the
    virtual address space does not make this easy.

    > Is there any possibility to remove at least the internal symbols?


    Even local symbols are needed for the relocation process.

    --
    PAD

  8. Re: RTP file without symbols, smaller files

    > Even local symbols are needed for the relocation process.
    >


    Hi PAD

    Are local symbols called by relative jumps so these jumps could be
    relocated by the linker?
    Is it possible to run some kind of relocater, store the result in a
    file and start the application from this file?
    This way many symbols wouldn't be neccassary at start time.

    Andy

  9. Re: RTP file without symbols, smaller files

    Hello Andy,

    On Jun 30, 12:17 am, Andi wrote:
    >
    > Are local symbols called by relative jumps so these jumps could be
    > relocated by the linker?


    Local symbols are indeed used for calls within the application code
    but are also used to get access to the content of local variables. The
    instructions referring to those symbols are subjected to the
    relocation process done by, in this case, the RTP loader. The details
    vary from processor architecture to processor architecture and vary as
    well depending on the way the relocation information is encoded, and I
    would not pretend to know/remember all of it.

    > Is it possible to run some kind of relocater, store the result in a
    > file and start the application from this file?
    > This way many symbols wouldn't be neccassary at start time.


    Possibly but I think that, due to the nature of the relocation
    information, you'd have to know where in virtual memory the text and
    data/bss segments are going to be installed. Unfortunately you don't
    know this ahead of time.

    --
    PAD


  10. Re: RTP file without symbols, smaller files

    Hi all

    Thanks for all your information, now I can understand the VXE files
    better.

    Andy

+ Reply to Thread