In NetCOBOL V11.0.0, the latest linker provided by Microsoft is used. Following are the noticeable points regarding change in the specification of linker.
Change the code of an external symbol (Unicode from ACP)
The linker (It is called a new linker here after) used with V11.0.0 or later processes the code of an external symbol as Unicode though the linker (It is called an old linker here after) used before V10.5.0 processed the code of an external symbol as ACP.
Change in C runtime library (MSVCRT.LIB from LIBC.LIB)
With new linker MSVCRT.LIB needs to be specified though with old linker LIBC.LIB was specified for C runtime library.
Addition of link option (/DYNAMICBASE)
With new linker, /DYNAMICBASE (*1) option is effective by default.
When /DYNAMICBASE is effective while linking, COBOL application program might terminate abnormally during execution.
*1: Address space randomizing(ASLR)
Deletion of link option (/DEBUGTYPE)
/DEBUGTYPE was deleted from the options that can be specified with the new linker. Therefore, when /DEBUG is specified, /INCREMENTAL becomes effective. When /INCREMENTAL is effective while linking, COBOL application program might terminate abnormally during execution.
Improvements in warning
When the file name that is outside ASCII range is set to the new linker, new linker outputs warning message (LNK4232).
When the runtime code set of DLL is ACP, there is a possibility that if the DLL name includes the character outside ASCII range, it might not be called correctly. Please make sure that characters of COBOL source file name are within the range of ASCII or specify /OUT as an option while linking, and use the characters within the range of ASCII in the characters of the output file name.
Change of default link option /SUBSYSTEM
The default of link option/SUBSYSTEM was changed by new linker.
Changes in NetCOBOL V11.0.0
Due to change in linker, following are the changes in specification of NetCOBOL V11.0.0.
The code of an external symbol is changed.
The compiler changes the code of an external symbol that is output to object program. The compiler in V11.0.0 or later outputs an external symbol of Unicode though the compiler before V10.5.0 output an external symbol of ACP.
The default of the NetCOBOL development environment is changed.
C runtime library
MSVCRT.LIB is specified in NetCOBOL V11.0.0 or later though LIBC.LIB was specified in NetCOBOL before V10.5.0.
Optional default for link
In NetCOBOL V11.0.0 or later, the following options become effective.
/DYNAMICBASE:NO
/INCREMENTAL:NO
NetCOBOL command prompt
NetCOBOL command prompt is used in NetCOBOL V11.0.0 or later though the command prompt of the system is used in NetCOBOL before V10.5.0. The NetCOBOL command prompt sets /DYNAMICBASE:NO and /INCREMENTAL:NO by default.
Impact and Resolution
Please handle the following conditions in the below mentioned ways.
When the program with an external name(*2) includes character outside ASCII range and the program that calls this
Object file made with NetCOBOL before V10.5.0 cannot be linked by a new linker.
In V11.0.0 or later, inter-program communication with existing resource(*3) and newer resource(*4) cannot be used.
*2: An external name is as follows.
program-name / class-name / method-name / property-name / the secondary entry point
*3: made with NetCOBOL before V10.5.0
*4: made with NetCOBOL V11.0.0 or later
[Resolution]
When the program with an external name and the program that calls this include the character outside ASCII range, please rebuild these program with NetCOBOL V11.0.0 or later. Please use ASCIICHK.exe when it is not certain whether the program with an external name includes characters outside ASCII range or not. When not certain about the called program, please rebuild all programs with the possibility of calling it.
When using MAKE file and batch file
The MAKE file and the batch file where the following is described cannot be used in NetCOBOL V11.0.0 or later.
LIBC.LIB
/DEBUGTYPE
[Resolution]
Please correct it the MAKE file and the batch file in the following manner.
Correct "LIBC.LIB" to "MSVCRT.LIB"
Delete /DEBUGTYPE
When about 100 DLL or more is included in the application
A phenomenon where Fiber Local Storage(FLS) gets used up occurs when about 100 DLL or more exists in the application that is built with NetCOBOLV11.0.0 or later and it is likely to fail in loading DLL.
[Resolution]
When DLL is made only in COBOL
Please do not specify "MSVCRT.LIB" when linking, specify option "/NOENTRY" and make DLL.
When DLL is made by COBOL and C
When making single DLL
Please do not specify "MSVCRT.LIB" when linking, specify "MSVCRT.LIB" and make DLL. Please recompile specifying "/MD" when C program is compile by option "/MT" of the compiler.
When making separate DLL
Please do not specify "MSVCRT.LIB" when you make DLL of COBOL, specify option "/NOENTRY" of the link, and make DLL. When create C DLL, please specify compile option "/MD" at the time of compilation.
When development settings other than NetCOBOL are used
When the development settings other than the development setting (NetCOBOL Studio, project manager, and NetCOBOL command prompt) offered with NetCOBOL V11.0.0 are used, the following options of the LINK command becomes effective by default. As a result, COBOL program might terminate abnormally when executed.
[Resolution]
Please specify link option/DYNAMICBASE:NO and /INCREMENTAL:NO. Or, please use the NetCOBOL development environments.
Change default link option /SUBSYSTEM
When the following functions are used, the output character string might not be displayed in the window with this link option.
COBOL Console Window
Screen Function
[Action]
If you use COBOL console window or screen function, please specify following LINK option when you link main programs.
When compile option MAIN(WINMAIN) is specified for the main program, it is WinMain type.
When compile option MAIN(MAIN) is specified for the main program, it is main type.
[WinMain type]
/SUBSYSTEM:WINDOWS and 5.01
[main type]
/SUBSYSTEM:CONSOLE and 5.01
If you use screen function it is possible to display it correctly by specifying environment variable @ScrnSize and changing size of logical screen.