This is the mail archive of the
mailing list for the binutils project.
Re: What's the best way to define local labels in an assembler macro?
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: "R. Diez" <rdiezmail-binutils at yahoo dot de>
- Cc: "dvalin at internode dot on dot net" <dvalin at internode dot on dot net>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Sun, 6 May 2012 08:43:30 +0100 (BST)
- Subject: Re: What's the best way to define local labels in an assembler macro?
- References: <1335780492.6491.YahooMailNeo@web171306.mail.ir2.yahoo.com> <20120430115411.GA1925@ratatosk> <1335790394.40554.YahooMailNeo@web171302.mail.ir2.yahoo.com> <20120430134721.GB1925@ratatosk> <1335815353.8252.YahooMailNeo@web171301.mail.ir2.yahoo.com>
On Mon, 30 Apr 2012, R. Diez wrote:
> I don't think you've realised the scale of the problem. Let me put it in
> perspective for you. There are thousands of gas users who try to use the
> assembler as little as possible and need not become masters at it. There
> are millions of lines of code written by developers who don't care if
> you later encounter a label collision. Many people take a quick look at
> the documentation and not surprisingly decide life is too short to play
> with the different local label options. Most people hope for the best.
> Some reserve a number range (less people even document it). Few append $
> to the label names. Nobody uses \@ or .altmacro. Too many write horrible
> multi-line macros for the C pre-processor.
Documentation for the .macro pseudo-op appears reasonable enough to me
for one to be able to infer what the implications of using labels within
macros are. That does not necessarily mean it's presented in the most
comprehensible form possible, however...
> I already said I read the manual, I hope it's not different to the info
> pages (which have a less than ideal user interface). The documentation
> is not clear about the behaviour of the different options I mentioned.
> There's no clear advice and few examples. I've googled around and I'm
> not the only one who found a little time to devote to this question.
> Users shouldn't have to test several things around in order to learn the
> best way to declare local labels. I don't wish to try it myself and miss
> something or make mistakes, I would like an authoritative answer I can
> rely on.
... this project is run by volunteers who do not always have the
resources or skills to write good documentation. You are welcome to
improve it by proposing a change, in the unified diff format, that will
clarify any ambiguities or address any other deficiencies that you may
have found in our manuals while experimenting with GAS or any other piece
of software maintained as a part of this project. I am sure everybody
will appreciate your effort as will myself.