[PATCH] macro hooks

Timothy Wall twall@domesolutions.com
Thu Feb 24 07:20:00 GMT 2000

I agree that the sb does not necessarily need to contain a flag.  I'm trying to get a
better understanding of where I might stick the hooks to do the symbol replacement (it
is for a compatibility target and not general GAS functionality).

>From the point of view of "start_line_hook()", the input stream consists of sbs.  The
input stream could potentially be processed in other places, but those places would be
out of the context of the substitution directives.  So the substitution needs to happen
in start_line_hook.

Thanks for your input.


Ian Lance Taylor wrote:

>    Date: Wed, 23 Feb 2000 19:16:45 -0500
>    From: Timothy Wall <twall@domesolutions.com>
>    What I want to do is replace "ABC" in the input stream with "DEF".  The input
>    stream consists entirely of data within sbs.   In order to do a replacement, it
>    makes sense to either 1) replace one sb with another or 2) change the contents of
>    an sb.
>    Ideally, this would be done at the preprocessor level; however, the substitutions
>    to be done are based on the results of assembler directives.
> We are talking at cross purposes, because I don't understand why what
> you are saying is relevant to what I am saying.
> I am saying: don't add a new field no_macro_check to the sb struct.
> It seems clear to me that you do not need it.  I have not yet
> understood an explanation why you do need it.  The fact that you are
> replacing a line is irrelevant.  Macro expansions already replace
> lines, so that is nothing new.
> I must admit that I don't know why the input stream consists entirely
> of data within sbs.  That is not true when reading from a file, and
> don't you want to replace the string in that case?
> Adding a pseudo-op to replace ABC in the input stream with DEF is OK
> with me, provided it does not make gas any harder to maintain in the
> normal case.  Note that this pseudo-op is not generally useful,
> because people already can and do perform this operation using the C
> preprocessor or m4.  I assume you want to introduce this pseudo-op to
> retain compatibility with some existing assembler.
> Ian

More information about the Binutils mailing list