]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sym->sy_value is not valid for struct local_symbol
authorAlan Modra <amodra@gmail.com>
Mon, 6 May 2019 05:08:24 +0000 (14:38 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 6 May 2019 06:53:33 +0000 (16:23 +0930)
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

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

gas/ChangeLog
gas/symbols.c

index 640fee13c8e4292b7c9deb2800b8025016acb5f4..ec211534c9e0d6b49cf5a5b1dc6e49fee752e2e7 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-06  Alan Modra  <amodra@gmail.com>
+
+       * symbols.c (symbol_relc_make_sym): Do not access sym->sy_value
+       directly.
+
 2019-05-06  Alan Modra  <amodra@gmail.com>
 
        * config/tc-ppc.c (ppc_fix_adjustable): Exclude all GOT and PLT
index 97867954fdd309cd5085320ed7b66d359bf88e86..10d7b1c273e711ad662aa93d4e5150e9bddf73bb 100644 (file)
@@ -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.  */