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
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
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 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
-----
Hi Jason
I use the command <stripppc --remove-section=.comment --strip-unneeded
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.
On Jun 24, 11:43 pm, Andi <aander...@hamilton-medical.ch> 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
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
On Jun 30, 12:17 am, Andi <aander...@hamilton-medical.ch> 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
Thanks for all your information, now I can understand the VXE files
better.
Andy