Hi Jan,
> ----- Jan Ringoš <[email protected]> a écrit :
> if I understand it right, the bFLT binaries (see:
> http://www.beyondlogic.org/uClinux/bflt.htm) cannot contain other
> sections
> than .text and .data (and .bss, though this is not actually there
> either).
> There is nowhere to write settings for your 'shared_ram' section in the
> binary, so the linker returns error.
Actually, the linker process fails before generating the ELF file.
There was also a case (which a specific linker script) where the linker
produced an ELF file that was not accepted by elf2flt (which crashed
silently). The problem was that the accesses at 0x8800xxxx were seen
as normal accesses to the .data section and elf2flt was trying to relocate
them (it was actually the BFD library that provided wrong data to
elf2flt).
Well, I am too young to subject of bFLT binaries and uClinux development
that I can't even guess why exactly does it fail to produce ELF files. But
from looking at the bFLT file format, the elf2flt can't possibly work either
(unless I am grossly misunderstanding something). You would probably need to
check its sources to see what it does to your shared section.
But at this point I could not understand why gcc put the structure in
the .data section and not in my custom section (moreover, the structure
is uninitialized!).
Since bFLT does not seem to support custom sections ...the linker may at
least try to do less harm, and appends your section to the .data. Better
than to drop it entirely, or not?
> Wouldn't something like this suffice?
>
> struct shared_struct volatile * my_shared_memory = (struct shared_struct
> volatile *) 0x88000000;
This would have been a simpler choice, the problem is that the code has
already been written without pointers, through direct structures access,
because it is a bit faster and smaller.
In C++ you could use a reference :-) Otherwise, I don't see any other way.
---
Jan Ringoš, www.ringos.cz
software architect, programmer
_______________________________________________
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