MicroBlaze Dynamic Loader Test Failures
Alex White
alex.white at oarcorp.com
Tue Aug 1 03:46:22 UTC 2023
Hi,
I am currently working on RTEMS dynamic loader support for MicroBlaze. I got most of the dynamic loader tests working, but for a few of them, I had to modify the test. I believe the failures are because the MicroBlaze RTEMS port uses soft floating point emulation. Tests dl07, dl08, and dl09 fail because the objects being loaded include floating point code that requires an extra routine from GCC, `__extendsfdf2`, that is not included in the base application.
According to GCC documentation (https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html), `__extendsfdf2` is used to extend a float to a double. This is needed in test dl07, for example, to print `dl01_bss2[0]` on line 66:
printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0]));
The modification that I made to get this working was to add the following to init.c in each of the three failing tests:
#ifdef __microblaze__
extern double __extendsfdf2 (float a);
/* This ensures that __extendsfdf2 is included in the compiled output. */
double (*extendsfdf2_fp)(float) = &__extendsfdf2;
#endif /* __microblaze__ */
I'm not sure of any way to check whether or not this code should be included other than `#ifdef __microblaze__`. This doesn't seem like a great solution, though. I searched for a predefined macro that would allow this to be generic across different architectures, maybe something indicating software floating point, but I couldn't find anything suitable.
Does anyone have a suggestion for a better way to solve this?
Thanks,
Alex
More information about the devel
mailing list