[Icc-mot] BSS in reverse order?
Edward Karpicz
ekarpicz at freemail.lt
Tue Nov 13 23:03:58 PST 2007
Jim Fiocca wrote:
> ICC12-V7 questions:
>
> 1) In the generated map file (.mp), why are the memory addresses in the
> BSS section (area) in the reverse order that they were allocated in the
> program?
Does ANSI C specify the order static vars are allocated? I don't think so.
For portability and compatibility with future ICC versions, I think you
shouldn't assume any order of allocation.
Maybe tell us what are you trying to do? Even structs get not portable as
soon as someone starts assuming that char is 8 bits or assuming any struct
packing etc
struct {
char a;
short b;
} ...
^^ there can be a unused memory space between a and b fields, just enable
word alignment and see. The same way there can be a unused space between
statically allocated vars... So are you sure you need specific order of
allocation?
>
> 2) Is there some sort of data alignment pragma? Or other mechanism to
> align data on a specific boundary?
>
There's a word alignment option. If you need specific address then you
should use abs_address pragma or your custom memory area with specific start
and end addresses. To get some every >2bytes alignment, I would use structs
and unions of specific size and custom area to allocate only such structs.
I think you should tell us more about what you are trying to achive.
Edward
> Thanks,
> Jim
>
>
>
> _______________________________________________
> Icc-mot mailing list
> Icc-mot at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-mot
>
More information about the Icc-mot
mailing list