resolve_symbol_value vs. .loc view resolution

In most cases we don't want expression symbols, such as that created
for an expression like "symbol + (1f - .)", resolved down to a
constant.  Instead we'd like to leave the expression as "symbol +
constant" once the "1f - ." part has been resolved, and let the
backend decide whether "symbol" can be reduced further.

However, that doesn't work when trying to resolve .loc view symbols
early.  We get expression symbols left as an O_symbol expression
pointing at an absolute symbol, and marked as sy_flags.sy_resolved.
That wouldn't really be a problem, but when one of those expression
symbols is used in further .loc view expressions, its value is taken
as zero.

This patch fixes the symbol value mistake, and stops creation of
O_symbol expression symbols pointing to absolute symbols.  Either of
these fixes would cure the .loc view usage.

	PR 24444
	* symbols.c (resolve_symbol_value): When handling symbols
	marked as sy_flags.resolved, return correct value for the
	case of expression symbols left as an O_symbol expression.
	Merge O_symbol code handling undefined and common symbols with
	code handling special cases of expression symbols.  Use
	seg_left to test for undefined and common symbols.  Don't
	leave an O_symbol expression when X_add_symbol resolves to
	the absolute_section.  Init final_val later.
	* testsuite/gas/mmix/basep-7.d: Adjust expected output.
3 files changed