This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
sym->sy_value is not valid for struct local_symbol
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Alexandre Oliva <aoliva at redhat dot com>
- Date: Mon, 6 May 2019 16:22:33 +0930
- Subject: sym->sy_value is not valid for struct local_symbol
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