as_bad_subtract

Alan Modra amodra@gmail.com
Thu Jul 22 12:47:21 GMT 2021


On Wed, Jul 21, 2021 at 12:17:52PM +0200, Jan Beulich wrote:
> On 21.07.2021 12:08, Alan Modra via Binutils wrote:
> > Many places report errors of the nature "can't resolve a - b".
> > This provides a utility function to report such errors consistently.
> > I removed the section reporting and quotes around symbol names while I
> > was at it.  Compare
> > ifunc-2.s:4: Error: can't resolve `bar1' {.text.1 section} - `foo1' {.text.1 section}
> > with
> > ifunc-2.s:4: Error: can't resolve bar1 - foo1
> > 
> > In many cases the section names don't help the user very much in
> > figuring out what went wrong,
> 
> To be honest, I find the mentioning of the sections quite useful
> when they're different, because this then is an immediate hint at
> why the expression cannot be resolved.

I don't deny that the section might help a little in some cases, but
in many I think it's just a distraction.  Something like 28 places in
the gas sources now using as_bad_subtract didn't report the section
compared to 5 places that did.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list