Gas: Clarify documentation about @ and % usage in .section
The documentation for the .section assembler directive is clarified regarding the use of @ and % to avoid confusion related to comment characters.
This patch clarifies the documentation for the .section assembler directive in the GNU assembler (gas). It explains when to use @ or % characters, especially on targets like ARM where @ signifies the start of a comment. On such platform, % is used instead. It aims to prevent confusion about how to specify section attributes.
- proposer
Proposes clarifying the documentation for the .section directive regarding the use of @ and %.
“In the documentation for the .section Assembler Directive for the ELF format, clarify the instances where @ and % can be used.”
- reviewer
Acknowledges the patch and asks if it needs committing on his behalf.
“Okay, and thanks. I take that this will need committing on your behalf?”
- other
Confirms that Jan will be committing the documentation patch.
Technical Tradeoffs
- The change is purely documentation and does not affect the functionality of the assembler.
- Correct documentation is crucial for usability.
In Details
The .section directive in gas is used to define custom sections in the output object file. Assembler directives provide control over the assembly process. The ARM assembler uses @ as the comment character, which necessitates a different character for other purposes in specific contexts, such as the .section directive.
For Context
An assembler translates human-readable assembly code into machine code. Assembly code often uses directives, which are special instructions to the assembler itself, rather than instructions that will be executed by the processor. The .section directive allows developers to define custom sections in the output file to organize code and data. Different architectures and assemblers might use different symbols for comments and other special purposes, requiring careful attention to syntax.