[Info-vax] Possible C compiler static variable initialization problem.
hb
end.of at inter.net
Wed Feb 26 15:40:33 EST 2014
On 02/26/2014 08:17 PM, johnwallace4 at yahoo.co.uk wrote:
> PSECT attributes (OVR/CON? [NO]SHR?) also come into this, in some
> circumstances.
It depends on the extern model. For DECC there are several extern
models, in the range from common to strict: With common you get OVR
PSECTs for the variables, as long as you do not explicitly initialize.
The linker will happily overlay these sections. With the strict_refdef
extern model, a definition will end up in a CON PSECT and a declaration
will not have any PSECT assigned at all. And then there is
relaxed_refdef ...
For writable variables, the assigned PSECT has NOSHR, no matter where it
came from and what the extern model is. For non-writable variables,
const, the SHR is set to the assigned PSECT (typically $LITERAL$).
Off the top of my head, but I may not have all the details in my head.
More information about the Info-vax
mailing list