|Internet Business Consultant|
|Home||Blog||Bio||Projects||Contact||Latest Blog (new site): How to Get to Genius|
Use the .section directive to assemble the following code into a section named name.
This directive is only supported for targets that actually support arbitrarily named sections; on a.out targets, for example, it is not accepted, even with a standard a.out section name.
For COFF targets, the .section directive is used in one of the following ways:
If the optional argument is quoted, it is taken as flags to use for the section. Each flag is a single character. The following flags are recognized:
If no flags are specified, the default flags depend upon the section name. If the section name is not recognized, the default will be for the section to be loaded and writable. Note the n and w flags remove attributes from the section, rather than adding them, so if they are used on their own it will be as if no flags had been specified at all.
If the optional argument to the .section directive is not quoted, it is taken as a subsegment number (Section 5.4 Sub-Sections).
This is one of the ELF section stack manipulation directives. The others are .subsection (Section 8.89 .subsection name), .pushsection (Section 8.73 .pushsection name, subsection), .popsection (Section 8.68 .popsection), and .previous (Section 8.67 .previous).
For ELF targets, the .section directive is used like this:
The optional flags argument is a quoted string which may contain any combination of the following characters:
The optional type argument may contain one of the following constants:
Many targets only support the first three section types.
Note on targets where the @ character is the start of a comment (eg ARM) then another character is used instead. For example the ARM port uses the % character.
If flags contains the M symbol then the type argument must be specified as well as an extra argument - entsize - like this:
Sections with the M flag but not S flag must contain fixed size constants, each entsize octets long. Sections with both M and S must contain zero terminated strings where each character is entsize bytes long. The linker may remove duplicates within sections with the same name, same entity size and same flags. entsize must be an absolute expression.
If flags contains the G symbol then the type argument must be present along with an additional field like this:
The GroupName field specifies the name of the section group to which this particular section belongs. The optional linkage field can contain:
Note - if both the M and G flags are present then the fields for the Merge flag should come first, like this:
If no flags are specified, the default flags depend upon the section name. If the section name is not recognized, the default will be for the section to have none of the above flags: it will not be allocated in memory, nor writable, nor executable. The section will contain data.
For ELF targets, the assembler supports another type of .section directive for compatibility with the Solaris assembler:
Note that the section name is quoted. There may be a sequence of comma separated flags:
This directive replaces the current section and subsection. See the contents of the gas testsuite directory gas/testsuite/gas/elf for some examples of how this directive and the other section stack directives work.
Services: Online Marketing
|Electric Speed: Commercial Web Site Developer|