public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* sym->sy_value is not valid for struct local_symbol
@ 2019-05-06  6:52 Alan Modra
  2019-05-06  7:29 ` Alexandre Oliva
  2019-05-06 10:49 ` Alexandre Oliva
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Modra @ 2019-05-06  6:52 UTC (permalink / raw)
  To: binutils; +Cc: Alexandre Oliva

Fixes this mep-elf error:
gas/elf/dwarf2-19.s: Error: Unknown expression operator (enum 0)
gas/elf/dwarf2-19.s: Error: cannot convert expression symbol .L2 to complex relocation

Doesn't fix the test itself from failing though.  Alex, your latest
patch resulted in:
mep-elf  +FAIL: DWARF2 18
mep-elf  +FAIL: DWARF2 19

	* symbols.c (symbol_relc_make_sym): Do not access sym->sy_value
	directly.

diff --git a/gas/symbols.c b/gas/symbols.c
index 97867954fd..10d7b1c273 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -3288,7 +3288,7 @@ symbol_relc_make_sym (symbolS * sym)
      is defined as an expression or a plain value.  */
   if (   S_GET_SEGMENT (sym) == expr_section
       || S_GET_SEGMENT (sym) == absolute_section)
-    return symbol_relc_make_expr (& sym->sy_value);
+    return symbol_relc_make_expr (symbol_get_value_expression (sym));
 
   /* This may be a "fake symbol", referring to ".".
      Write out a special null symbol to refer to this position.  */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-06 11:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06  6:52 sym->sy_value is not valid for struct local_symbol Alan Modra
2019-05-06  7:29 ` Alexandre Oliva
2019-05-06 10:49 ` Alexandre Oliva
2019-05-06 11:31   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).