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

Re: [MiNT] Stack problems with GCC 4



With GCC 4 any zero initialised data ends up in the BSS section.

sorry for my lameness but what's wrong with this?

Usually, there is nothing wrong: zero initialized variables goes to the the BSS section, so they do not waste unnecessary space in the executable file.

However, the special variable _stksize must explicitly go the the DATA section, in order to make its value patchable with an external tool after the executable has been linked.

GCC has a special syntax in order to specify the section of a variable (as shown by Andreas). Unfortunately, this syntax is not allowed on a.out targets (like MiNT) where arbitrary section names are not supported. It's a pity because it would be perfectly possible and legal for putting a zero-initialized variable in the DATA segment - just what would be useful here.

Vincent Rivière