| Title: | DECC |
| Notice: | General DEC C discussions |
| Moderator: | TLE::D_SMITH N TE |
| Created: | Fri Nov 13 1992 |
| Last Modified: | Fri Jun 06 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 2212 |
| Total number of notes: | 11045 |
I've got some code that was building fine until our machine was
updated a few weeks ago.
old DEC C V4.0-000
new DEC C V5.3-006
the old compile command was
$(CC) /STANDARD=VAXC/noopt/include=(sys$disk:[],
dmq$user:, DECC$LIBRARY_include:,sys$library:) $(MMS$SOURCE)
the new complie command is
$(CC)
/STANDARD=VAXC/noopt/extern_model=strict_refdef/include=(sys$disk:[],
dmq$user:, DECC$LIBRARY_include:,sys$library:) $(MMS$SOURCE)
I started getting a bunch of
psect conflicting attributes warnings
and mulitiply define symbols warnings.
This code I inherited has global vars in 2 modules with the same names
and are referenced in other modules as externs.
I've tried various switches and still can't quite get things linked.
i've tried #pragma __extern_model __common_block __shr
/extern_module=strict_refdef
Can anyone explain why the psect and multi defined warnings appeared?
and what is the best way to correct this situation.
thanks
Dennis
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 2089.1 | See Chap 4 of the User's Guide for detail on extern_model | DECC::VMCCUTCHEON | Tue Feb 11 1997 12:11 | 36 | |
Hi, The command line you show for the old compiler appears to use the default extern model, relaxed_refdef, which tolerates multiple uninitialized definitions for the same object. The second command line you show for upgraded compiler, is specifying stict_refdef which limits you to exactly one definition. So depending on how and where you have placed your extern_model pragma directives, the multiple definition errors could be caused by that. Presumably you are aware that VAX C used the common block model, which is the most lax with regard to multiple definitions. Do track this down, I would suggest that you take a look at the DEC C User's Manual chap 4. I find the tables 4-5 through 4-8 at the end of the chapter to be the most helpful in explaining what psect information will be generated for each type of C declaration under the various extern models. I don't think that this is your problem, but beginning with V5.3, a new compiler-generated psect $READONLY_ADDR$ was added for static-exten const data that is initialized with link-time addresses. This allows $READONLY$ to remain sharable, where formally $READONLY$ would be marked as non-shared when that type of data was used. So possibly $READONLY$ was non-shared in the past. You will also find detailed information on PSECT "stuff" in the linker manual. I hope this helps, if not, you might wanna provide a small code example we can probably provide a more specific answer to your question. --val | |||||