[PATCH] macro hooks

Ian Lance Taylor ian@zembu.com
Thu Feb 24 08:06:00 GMT 2000


   Date: Thu, 24 Feb 2000 10:17:57 -0500
   From: Timothy Wall <twall@domesolutions.com>

   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.

start_line_hook doesn't look at an sb, so I assume you don't mean
that.

But, yes, I agree that start_line_hook is a natural place to do this
substitution.  In fact, I don't see anything wrong with the general
approach you appeared to be taking: start_line_hook creates an sb with
the appropriate substituted line, calls input_scrub_include_sb, sets
input_line_pointer to the end of the line being replaced, and
continues the read loop.

If these pseudo-ops are general purpose, you could just add that to
the read loop, probably just before start_line_hook.
    if (doing_substitutions
        && substitute_line (new_sb))
      {
	discard_rest_of_line ();
	input_scrub_include_sb (new_sb, no_cond_check);
	buffer_limit = input_scrub_include_next_buffer (&input_line_pointer);
	continue;
      }

You just need to tell input_scrub_include_sb to not check for a
complete conditional.  That is easy enough.  Just give it a new
parameter, arrange for that parameter to be saved by input_scrub_push,
and check it in input_scrub_next_buffer.

Ian


More information about the Binutils mailing list