/SECTION Linker Option

Syntax: Default:
/SEC[TION]:name,attributes Depends on section type

/SECTION specifies the following memory-protection attributes for the name section (name is case sensitive):

Letter Sets Attribute
E or X EXECUTE 2
R READ
S SHARED
W WRITE 1
A 16:16 ALIAS
C CONFORMING 2
D DISCARDABLE
I I/O PRIVILEGE
G RESIDENT and CONTIGUOUS 1
H RESIDENT and LONG-LOCKABLE
L RESIDENT
  1. This attribute is not recommended for code segments.
  2. This attribute is not recommended for data segments.

For example,

/SEC:dseg1,RS

sets the READ and SHARED attributes, but not the EXECUTE, or WRITE attributes, for the section dseg1 in an .exe file.

Sections are assigned attributes by default, as follows:

Segment Default Attributes
Code sections READ, EXECUTE (RX)
Data sections READ, WRITE (RW), not shared
CONST32_RO section READ, SHARED (RS)


Summary of Linker Options