PRB: L4001 Warning May Be Caused by Using Incorrect Linker

Last reviewed: July 17, 1997
Article ID: Q74169
5.0x 5.1x 5.2x 5.3x 5.50 | 5.0x 5.10 5.11 5.13 5.15
MS-DOS                   | OS/2
kbtool kbcode kberrmsg kberrmgs kbprb

The information in this article applies to:

  • Microsoft LINK for MS-DOS, versions 5.0x, 5.1x, 5.2x, 5.3x, and 5.5
  • Microsoft LINK for OS/2, versions 5.0x, 5.1, 5.11, 5.13, and 5.15
  • Microsoft Macro Assembler for MS-DOS and OS/2, versions 6.0, 6.0a, 6.0b, and 6.1

SYMPTOMS

During the process of linking an application, Microsoft LINK generates the following message:

   warning L4001: frame-relative fix-up,
           frame ignored near xxx in segment yyy

In most cases, LINK ignores the initial frame and performs a far address calculation.

CAUSE

This error can occur incorrectly when the incorrect linker is used. For example, the error occurs if an assembly module is assembled with USE32 segments in Microsoft Macro Assembler (MASM) and LINK version 5.x attempts to create the .EXE file. The same error occurs if MASM version 6.0, 6.0a, 6.0b, or 6.1 creates code for the FLAT memory model.

RESOLUTION

The resolution depends on the target operating system. When Windows NT is the target, use the CVTOMF utility provided with the Windows NT Software Development Kit (SDK) to convert the generated object file from OMF format to COFF format. Then use the LINK utility provided with the Windows NT SDK to build the application. If OS/2 version 2.0 is the target, use LINK386 from the IBM OS/2 2.0 development kit.

MORE INFORMATION

The following code sample demonstrates both the error message discussed above and the methods to avoid it. Assemble the code below with MASM version 6.0, 6.0a, 6.0b, or 6.1. To reproduce the error message above, link with a segmented-executable linker, such as LINK version 5.x. To create a correct executable file, link the code with LINK386 from IBM.

Sample Code

; Assemble options needed: /c ; Link options needed: Link with LINK 5.x to see errors

;                          Link with LINK386 for correct results

INCLUDELIB DOSCALLS.LIB ; OS/2 systems call library

.386 .MODEL flat, syscall

Dos32Write PROTO NEAR32 syscall,

    hf:WORD, pvBuf:NEAR32, cbBuf:WORD, pcbBytesWritten:NEAR32

Dos32Exit PROTO NEAR32 syscall,
    fTerminate:WORD, ulExitCode:WORD

.STACK 4096

.DATA

msg DB "Hello, world.", 13, 10 written DW 0

.CODE _start:

    INVOKE  Dos32Write,        ; OS/2 system call
        1,                     ; File handle for screen
        NEAR32 PTR msg,        ; Address of string
        LENGTHOF msg,          ; Length of string
        NEAR32 PTR written     ; Bytes written

    INVOKE  Dos32Exit,         ; OS/2 system call
        0,                     ; Terminate all treads
        0                      ; Result code for parent process

END _start


Additional reference words: 5.01.20 5.01.21 5.02 5.03 5.05 5.10 5.11
5.13 5.15 5.20 5.30 5.31.009 5.50 6.00 6.00a 6.00b 6.10
KBCategory: kbtool kbcode kberrmsg kberrmsg kbprb
KBSubcategory: LinkIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.