I cannot seem to find anything clear in NASM’s documentation regarding the difference between using Section or [SECTION ] (with the brackets) in your code. I am aware these are macros, but I see them used almost interchangeably. Is this the case? In other words is
[SECTION .text]
Equivalent to
Section .text
?
Do brackets maybe imply some arcane side effect?
Thanks
[SECTION .xyz]is the primitive form of the section directive which simply sets the current output section,SECTION .xyzdiffers slightly because it works like a macro:expands to the two lines
which can be used in conjunction with a macro to temporarily switch the output section, and switch it back to its original value. Example from the NASM manual:
When you use this macro, the output section is set to
.datatemporarily by the primitive form ofSECTION, and set back to its original value with__?SECT?__