| Joining the Data and Text Sections

Previous | GNU Assembler Command-Line Options | Next

The '-R' option tells `as` to write the object file as if all data-section data lives in the text section. This is only done at the very last moment: your binary data are the same, but data section parts are relocated differently. The data section part of your object file is zero bytes long because all its bytes are appended to the text section. (see Sections and Relocation).
When you specify '-R', it would be possible to generate shorter address displacements (because we do not have to cross between text and data section). We refrain from doing this simply for compatibility with older versions of `as`. In the future, '-R' may work this way.
When `as` is configured for COFF output (which is the case in TIGCC), this option is only useful if you use sections named `.text` and `.data`.