FIX: Link /SECTION Option Does Not Check for Name Errors (123492)



The information in this article applies to:

  • The Linker (LINK.EXE), when used with:
    • Microsoft Visual C++

This article was previously published under Q123492

SYMPTOMS

The /SECTION option for the linker does not check:
  • The name specified to determine the existence of that section.
  • The case of the name even though the documentation for the /SECTION option states that the name is case sensitive.
  • The attributes following the section name for errors.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ version 4.0.

REFERENCES

The following information is taken from Visual C++ version 2.0 Books Online, Appendix B regarding the /SECTION linker option:
   /SECTION:name,attributes
				

This option changes the attributes of a section, overriding the attributes set when the object file for the section was compiled.

Specify a colon (:) and a section name. The name is case sensitive.

Specify one or more attributes for the section. The attribute characters are E, R, W, and S and are not case sensitive. You must specify all attributes that you want the section to have; an omitted attribute character causes that attribute bit to be turned off. Attribute characters have the following meanings:

   Character       Attribute       Meaning
   E               execute         Allows code to be executed
   R               read            Allows read operations on data
   W               write           Allows write operations on data
   S               shared          Shares the section among all
				

processes that load the image



A section that does not have E, R, or W set is probably invalid.

NOTE: Under Win32s, the DLL data sections are loaded as "shared" even if that attribute is not set, because Windows has this requirement.

Modification Type:MajorLast Reviewed:10/23/2003
Keywords:kbbug kbfix kbVC400fix KB123492