a little question about gas directive

Paul Koning pkoning@equallogic.com
Thu Sep 13 14:05:00 GMT 2007


>>>>> "Bridge" == Bridge Wu <mingqiao.wu@gmail.com> writes:

 Bridge> I have a few constant data table in one assembly file, and I
 Bridge> use directive .data to mark them. Now if I want to make this
 Bridge> data section readonly, what should I do?

.data simply selects the ".data" section.  

 Bridge> I failed to find it on gas manual.

Look at the ".section" pseudo-op.  The conventional name for the read
only data section is ".rodata".  You can pick a different name; a lot
of this is just a matter of what the linker scripts do with sections.
.rodata is handled as read-only data by the default scripts, so that's
a good choice.

  paul



More information about the Binutils mailing list