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

* Re: sym->sy_value is not valid for struct local_symbol
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Oliva @ 2019-05-06  7:29 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On May  6, 2019, Alan Modra <amodra@gmail.com> wrote:

> Alex, your latest patch resulted in:
> mep-elf  +FAIL: DWARF2 18
> mep-elf  +FAIL: DWARF2 19

Thanks, I'll have a look.

-- 
Alexandre Oliva, freedom fighter  he/him   https://FSFLA.org/blogs/lxo
Be the change, be Free!                 FSF Latin America board member
GNU Toolchain Engineer                        Free Software Evangelist
Hay que enGNUrecerse, pero sin perder la terGNUra jamás - Che GNUevara

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

* Re: sym->sy_value is not valid for struct local_symbol
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Oliva @ 2019-05-06 10:49 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On May  6, 2019, Alan Modra <amodra@gmail.com> wrote:

> mep-elf  +FAIL: DWARF2 18
> mep-elf  +FAIL: DWARF2 19

The problem is that the location views are being turned into complex
relocations rather than simplified to constants.  Ugh.

Any suggestion of how to arrange for location view expressions to be
recognized in use_complex_relocs_for so as to return zero for them?
Perhaps we could use a separate section or frag or something for them
that could be immediately identified, instead of attempting to match the
structure of the expression to the expected patterns?

-- 
Alexandre Oliva, freedom fighter  he/him   https://FSFLA.org/blogs/lxo
Be the change, be Free!                 FSF Latin America board member
GNU Toolchain Engineer                        Free Software Evangelist
Hay que enGNUrecerse, pero sin perder la terGNUra jamás - Che GNUevara

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

* Re: sym->sy_value is not valid for struct local_symbol
  2019-05-06 10:49 ` Alexandre Oliva
@ 2019-05-06 11:31   ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2019-05-06 11:31 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Mon, May 06, 2019 at 07:48:10AM -0300, Alexandre Oliva wrote:
> On May  6, 2019, Alan Modra <amodra@gmail.com> wrote:
> 
> > mep-elf  +FAIL: DWARF2 18
> > mep-elf  +FAIL: DWARF2 19
> 
> The problem is that the location views are being turned into complex
> relocations rather than simplified to constants.  Ugh.

I'd be inclined to just xfail the tests, with a comment in the .d
file saying why.

-- 
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).