Hi Wolfgang,

----- Wolfgang Mües <[email protected]> a écrit :
> How are you sure that both compiler agree about the exact layout of these 
> structs?
> 
> Remember that a compiler is free to do padding and reordering of structure 
> elements. And this may change from compiler version to compiler version.
> 
> Most people do not code this crazy way. Structs are not made for 
> communication 
> across different compilers and/or CPUs.

Well, this may be true in theory, but most of the compilers pack
structures the same may, unless special attributes are used. For
instance, check <netinet/ip.h> which define the same IP header 
structure for all compilers. 

However, it is true that the order of each global variable in the 
memory may not be the same. Currently I just assume that it works 
and, fortunately, it does. I guess I would have to pack my different
structs in a big struct, or use separate linker region in the other
case.


> By the way: are your structure elements all declared volatile?

Yes, but you remind me I do not flush the microblaze cache... 
I guess I am waiting some big trouble before thinking to do it ;).


> > My first problem is that I tried hundreds of different syntaxes,
> > instructions, whatever; I also tried to merge this declaration is the
> > default gcc linker script; nothing to do, the linking step always fails:
> 
> Flat binaries are a "hack", and I would it EXPECT to fail.

Actually, the failure first occurs at the ELF step. What is strange
is that the gcc ARM linker can handle this step, while the gcc 
Microblaze linker cannot. I cannot understand if the problem is due 
to the gcc version, to the linker script, or to specific cpu code 
in gcc.


Regards,

Antoine
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to