trouble with Dynamic load application
Chris Johns
chrisj at rtems.org
Thu Aug 3 02:04:51 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.
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.
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?
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'.
Chris
More information about the users
mailing list