> <br>> On 03/08/2017 11:48, jameszxj wrote:<br>> > Hi<br>> >   I run RTEMS on my xilinx z7k board and dynamic load application from shell.<br>> > when the app just has 1 source file,<br>> > dynamic is ok. when the app have more than 1 files, for example a.c b.c,<br>> > function a() in file a.c function b() in b.c<br>> > and function a() call b(), dynamic failed.<br>> ><br>> > compiler command line<br>> > 1 file: a.c<br>> >    arm-rtems4.12-gcc -c -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard<br>> > -mtune=cortex-a9 -mlong-calls a.c<br>> ><br>> > more than 1 file: a.c b.c<br>> >    arm-rtems4.12-gcc -r -nostdlib -march=armv7-a -mthumb -mfpu=neon<br>> > -mfloat-abi=hard -mtune=cortex-a9 -mlong-calls a.c b.c -o app.elf<br>> ><br>> <br>> I have never tested the loading of incrementally linked ELF files. This is new<br>> ground.<br><br>  my previous project, we work in this way. OS is vxworks, complier is gcc.<br>  <br>  I just notice that tornado link every .o file with a linkscript file. so i analyzed the<br>  object file use objdump, i found that link with a linkscript has the uniform text section, <br>  for example *.text *.bss ...  But my app.elf has many sections, *.text.a *.text.b ... <br>  every function has a text section.<br>  <br>  I am trying to write a linkscript file to test if it is the problem.<br>  <br>> <br>> Did you build RTEMS with '-mlong-calls'? I am not sure if adding this option<br>> changes the ABI and if it safe with just the dynamically loaded object files. It<br>> would be nice if it was.<br><br>if no '-mlong-call' option, function call only in +-24M address range, my board have 512M ram, dynamic do not work.<br>I reduce ram to 32M in linkscript file, '-mlong-call' is not need.<br><br>> <br>> Why not do:<br>> <br>>  arm-rtems4.12-gcc -march=armv7-a -mthumb -mfpu=neon \<br>>      -mfloat-abi=hard -mtune=cortex-a9 a.c -o a.o<br>>  arm-rtems4.12-gcc -march=armv7-a -mthumb -mfpu=neon \<br>>      -mfloat-abi=hard -mtune=cortex-a9 b.c -o b.o<br>> <br>> And then load both files?<br><br>application has many c files, load every file is troublesome.<br><br>> <br>> The RTEMS dynamic loader can load from archives using 'archive:file' so you only<br>> need to manage a single file on the target, for example 'my.a:a.o' and 'my.a:b.o'.<br><br>It is a way to solve my problem, thanks.<br><br>