[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] microblaze-uclinux-elf2flt mistranslation
Hi Steve,
On Wed, May 27, 2009 at 7:53 AM, Steven J. Magnani
<steve@xxxxxxxxxxxxxxx> wrote:
> Has anyone run into problems with microblaze-uclinux-elf2flt?
>
> We have a program that contains a constant global array something like
> this:
>
> const struct
> {
> const char* source;
> const char* target;
> unsigned long flags;
> const char* options;
> unsigned int channel;
> unsigned long devnum;
> } myGlobalStruct[9] = { blah blah blah };
>
> What we are seeing is for certain sequences of executable code, one of
> the .target fields in the array gets mis-translated, so instead of
> pointing to the constant string associated with array element [3], it
> points to the constant string associated with array element [0]. It's
> definitely a translation problem because I can use
> microblaze-uclinux-objcopy to extract the .data segment from the .gdb
> file and the structure is correct there.
>
What you are seeing is an artifact of a bug/design fault in the rather
old mb-ld that is part of the current noMMU toolchain, relating to
inconsistent behaviour in embedded relative offsets in the object
code, in addition to standard ELF RELOC entries.
The microblaze code in elf2flt attempts to detect these situations and
implements a workaround, but I suspect it may not be 100% perfect.
In the latest toolchain work I am doing, I have had to remove these
workarounds in elf2flt, because the mb-ld bug was evidently fixed in
the revup to 2.16.
> Any suggestions? Is there a more recent version of microblaze-uclinux
> tools available anywhere, or in the works? Tool problems like this make
> us very nervous because there's no telling what else is being corrupted.
I understand. Rod's suggested workaround is probably a good start for
now, until the tool situations settles in the next month or two.
Initially I am focussing the tool rework on the upstream kernel, but
with an improved toolchain build flow in place it should be much more
feasible to rebuild the tools against the older 2.6.20 petalinux
kernel tree as well.
Regards,
John
--
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663 f: +61-7-30090663
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/