[PATCH 1/5] gas: Add md_cons_worker

Michael Matz matz@suse.de
Wed Nov 13 11:55:00 GMT 2019


Hello,

On Tue, 12 Nov 2019, H.J. Lu wrote:

> Add md_cons_worker to allow backend to track hard-coded opcodes in
> instruction stream.
> 
> @@ -3977,6 +3977,10 @@ cons_worker (int nbytes,	/* 1=.byte, 2=.word, 4=.long.  */
>    md_cons_align (nbytes);
>  #endif
>  
> +#ifdef md_cons_worker
> +  md_cons_worker (nbytes);
> +#endif

Why can't you simply implement the md_cons_align hook, instead of adding a 
new one?  I realize there are other calls to that hook, but they all won't 
be in the code segment, and if they happen to be and the emitted constants 
happen to be byte sequence matching jump instructions, then you probably 
want to do the alignments as well (in other words aren't you missing to 
patch the other places that currently call md_cons_align for constructed 
corner cases?).

If you decide to really need a new hook then you still need to document it 
in doc/internals.texi.


Ciao,
Michael.



More information about the Binutils mailing list