[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Loadable module support for Petalinux w/MMU?



Hi John,

You were exactly right....the R_MICROBLAZE_32 case
was causing the string problem.   I changed the code as you
suggested, and the module works correctly when compiled
with the normal (glibc) compiler.     (I was thinking that I
had tried to change this earlier, but I think I had ended up
removing the "*location =" statement altogether...which
obviously didn't work!).

Given that this change makes the R_MICROBLAZE_32
and R_MICROBLAZE_64 reloc cases consistent, it
seems that it would be good to get the R_MICROBLAZE_32
change into the SVN trunk so that both are consistent:

               case R_MICROBLAZE_32:
#if __GNUC__ < 4
                       old_value = *location;
                       *location = value + old_value;
#else
                       *location = value;
#endif
                       DBPRINTK("R_MICROBLAZE_32 (%08lx->%08lx)\n",
                               old_value, value);


Thanks for help!      (As I reviewed all of the emails on this,
it seems that all of this has been stated before....so I apologize
for the rehash!     Hopefully summarizing both the 32 and
64-bit reloc issues together helps some other folks......).

Steve



John Williams wrote:
Hi Steve,

Thanks for your detailed notes, please see my comments below:

Steven Hein wrote:

* Using petalinux-mmu-v0.10 without any mods, the printk's
in my loadable modules failed, as previously documented.

* Using petalinux-mmu-v0.10 with John's fix (to #ifdef out
the split relocs fix), the printk's worked, but the strings
initialized within a structure (i.e. in my test code below) failed.

* Using the latest SVN kernel code (currently rev. 4469), which
contains the split relocs fix, it failed as above (printk's worked,
strings in structures were garbled).

One more thing to try, in the R_MICROBLAZE_32 reloc we also have the "old_value=...; value+=" construct.

Please try changing that to just "*location = value;" and see if it fixes the strings issue.

* When I remove the split relocs fix, and build the kernel module
with the uclinux compiler (microblaze-uclinux-gcc), it works
correctly (printk's and strings work) when loaded into the
MMU kernel (glibc built).

So I have a solution that works: build the modules with
the microblaze-uclinux-gcc compiler.     Is there a better solution
at this point?    Am I doing something to cause this?

It's certainly not your fault, it's an interaction between the toolchain/linker and the module loader.


Cheers,

John
___________________________
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/


___________________________
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/