This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a little question about gas directive


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]