Problem with rtems5 on mvme2100 - hard-float/soft-float confusion

Joachim Rahn Joachim.Rahn at helmholtz-berlin.de
Tue Apr 2 11:17:36 UTC 2019


first of all thanks for all comments!

On 02.04.19 11:18, Sebastian Huber wrote:
> 
> 
> On 01/04/2019 17:20, Rahn, Joachim wrote:
>> If I do the commands from bsp-post-link without option
>> "--no-warn-mismatch" I get the error:
>> powerpc-rtems5-ld: o-optimize/hello_world.exe uses hard float,
>> /rtems/5/powerpc-rtems5/mvme2100/lib/bootloader.o uses
>> soft float
> 
> I think this mismatch is not an issue.
> 

seems you are right!

But it remains that the ld option "--no-warn-mismatch" suppresses all mismatch warnings,
may be better to use "--noinhibit-exec" here. Then the image wil be produced even
if there are mismatch warnings and one can see what's going on here.

>>
>> At the moment I have no idea what's going on there...
> 
> I don't know what the bootloader needs, from the
> 
> define bsp-post-link
>     $(default-bsp-post-link)
>      $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems
>      gzip -vf9 rtems
>      $(LD) -o $(basename $@)$(DOWNEXT) \
>         $(PROJECT_RELEASE)/lib/bootloader.o \
>         --just-symbols=$(basename $@)$(EXEEXT) \
>         --no-warn-mismatch \
>          -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \
>          -Map $(basename $@).map && chmod 755 $@
>      rm -f rtems.gz
> endef
> 
> it seems it needs an ELF file.
> 

hmmm, when looking into images build with rtems4.9 it seems to me,
that the image is a combination of a simple binary for the bootloader
and a gzip-ed ELF for the real exexutable.
My thought is that the mvme2100 loads the image, jumps to the bootloader
and the bootloader unzips the executable then, but I'm not sure at the moment.

hexdump hello.ralf (rtems4.9) looks like this

[...snip...]
0000700 02 00 41 01 12 4f 00 00 00 00 28 01 00 00 00 00  >..A..O....(.....<
0000720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0000760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa  >..............U.<
0001000 00 04 00 00 a8 4f 02 00 00 00 4c 69 6e 75 78 00  >.....O....Linux.<
0001020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0002000 48 00 00 05 7c 28 02 a6 38 00 00 00 94 01 fd 8c  >H...|(..8.......<
0002020 bf 41 00 08 48 00 00 05 7f c8 02 a6 80 1e 02 e0  >.A..H...........<
[...snip...]

and hexdump hello.ralf (rtems5) looks like this
[...snip...]
0000000 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00  >.ELF............<
0000020 00 02 00 14 00 00 00 01 00 00 04 00 00 00 00 34  >...............4<
0000040 00 06 b5 a8 00 01 00 00 00 34 00 20 00 02 00 28  >.........4. ...(<
0000060 00 77 00 76 00 00 00 01 00 01 00 00 00 00 00 00  >.w.v............<
0000100 00 00 00 00 00 02 43 08 00 02 54 8c 00 00 00 07  >......C...T.....<
0000120 00 01 00 00 64 74 e5 51 00 00 00 00 00 00 00 00  >....dt.Q........<
0000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07  >................<
0000160 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00  >................<
0000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0200000 48 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00  >H...............<
0200020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0200660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00  >................<
0200700 02 00 41 01 12 4f 00 00 00 00 22 01 00 00 00 00  >..A..O....".....<
0200720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0200760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa  >..............U.<
0201000 00 04 00 00 08 43 02 00 00 00 4c 69 6e 75 78 00  >.....C....Linux.<
0201020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0202000 48 00 00 05 7c 28 02 a6 38 00 00 00 94 01 fd 8c  >H...|(..8.......<
[...snip...]


As a test I compiled the bootloader with "-mhard-float" to overcome the hard-float/soft-float warning.

When I now do the build of the hello example, a second mismatch warnig appears:

[...snip...]
owerpc-rtems5-gcc --pipe -B/rtems/5-hard-float/powerpc-rtems5/mvme2100/lib/ -specs bsp_specs -qrtems   -Wall  -O2 -g
-mmultiple -mstring -mstrict-align           -c   -o o-optimize/test.o test.c
powerpc-rtems5-gcc --pipe -B/rtems/5-hard-float/powerpc-rtems5/mvme2100/lib/ -specs bsp_specs -qrtems   -Wall  -O2 -g
-mmultiple -mstring -mstrict-align          -Wl,--gc-sections      -o o-optimize/hello.exe  o-optimize/test.o
powerpc-rtems5-nm -g -n o-optimize/hello.exe > o-optimize/hello.num
powerpc-rtems5-size o-optimize/hello.exe
   text    data     bss     dec     hex filename
 189781   37204   58821  285806   45c6e o-optimize/hello.exe
powerpc-rtems5-objcopy -O binary -R .comment -S o-optimize/hello.exe rtems
gzip -vf9 rtems
rtems:   56.2% -- replaced with rtems.gz
powerpc-rtems5-ld -o o-optimize/hello.ralf /rtems/5-hard-float/powerpc-rtems5/mvme2100/lib/bootloader.o
--just-symbols=o-optimize/hello.exe --noinhibit-exec -b binary rtems.gz -T
/rtems/5-hard-float/powerpc-rtems5/mvme2100/lib/ppcboot.lds -Map o-optimize/hello.map && chmod 755 o-optimize/hello.exe
powerpc-rtems5-ld: o-optimize/hello.exe: compiled normally and linked with modules compiled with -mrelocatable
powerpc-rtems5-ld: failed to merge target specific data of file o-optimize/hello.exe
rm -f rtems.gz
[...snip...]


So my main question for the moment is:

Am I right that the correct produced image for the mvme2100 should be a combination of the bootlader as binary and the
application as gziped ELF?

Cheers, Joachim





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.rtems.org/pipermail/users/attachments/20190402/44b47ca4/attachment-0002.bin>


More information about the users mailing list