trouble with Dynamic load application

jameszxj jameszxj at gmail.com
Thu Aug 3 03:22:31 UTC 2017


> 
> On 03/08/2017 11:48, jameszxj wrote:
> > Hi
> >   I run RTEMS on my xilinx z7k board and dynamic load application from shell.
> > when the app just has 1 source file,
> > dynamic is ok. when the app have more than 1 files, for example a.c b.c,
> > function a() in file a.c function b() in b.c
> > and function a() call b(), dynamic failed.
> >
> > compiler command line
> > 1 file: a.c
> >    arm-rtems4.12-gcc -c -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard
> > -mtune=cortex-a9 -mlong-calls a.c
> >
> > more than 1 file: a.c b.c
> >    arm-rtems4.12-gcc -r -nostdlib -march=armv7-a -mthumb -mfpu=neon
> > -mfloat-abi=hard -mtune=cortex-a9 -mlong-calls a.c b.c -o app.elf
> >
> 
> I have never tested the loading of incrementally linked ELF files. This is new
> ground.

  my previous project, we work in this way. OS is vxworks, complier is gcc.
  
  I just notice that tornado link every .o file with a linkscript file. so i analyzed the
  object file use objdump, i found that link with a linkscript has the uniform text section, 
  for example *.text *.bss ...  But my app.elf has many sections, *.text.a *.text.b ... 
  every function has a text section.
  
  I am trying to write a linkscript file to test if it is the problem.
  
> 
> Did you build RTEMS with '-mlong-calls'? I am not sure if adding this option
> changes the ABI and if it safe with just the dynamically loaded object files. It
> would be nice if it was.

if no '-mlong-call' option, function call only in +-24M address range, my board have 512M ram, dynamic do not work.
I reduce ram to 32M in linkscript file, '-mlong-call' is not need.

> 
> Why not do:
> 
>  arm-rtems4.12-gcc -march=armv7-a -mthumb -mfpu=neon \
>      -mfloat-abi=hard -mtune=cortex-a9 a.c -o a.o
>  arm-rtems4.12-gcc -march=armv7-a -mthumb -mfpu=neon \
>      -mfloat-abi=hard -mtune=cortex-a9 b.c -o b.o
> 
> And then load both files?

application has many c files, load every file is troublesome.

> 
> The RTEMS dynamic loader can load from archives using 'archive:file' so you only
> need to manage a single file on the target, for example 'my.a:a.o' and 'my.a:b.o'.

It is a way to solve my problem, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170803/21c2f5ae/attachment.html>


More information about the users mailing list