public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: alpha-linux gas testsuite failure
       [not found] <20100917051307.GB16874@bubble.grove.modra.org>
@ 2010-09-17 19:45 ` Richard Henderson
  2010-09-18  0:13   ` Alan Modra
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2010-09-17 19:45 UTC (permalink / raw)
  To: Alan Modra, Binutils

On 09/16/2010 10:13 PM, Alan Modra wrote:
> Hi Richard,
>   In case you haven't noticed, alpha-linux is failing one gas test.
> 
> ../as-new   -o dump.o /src/binutils-current/gas/testsuite/gas/elf/dwarf2-2.s
> Executing on host: sh -c {../as-new   -o dump.o /src/binutils-current/gas/testsuite/gas/elf/dwarf2-2.s 2>&1}  /dev/null gas.out (tim
> spawn [open ...]
> /home/alan/build/gas/alpha-linux/gas/testsuite/../../binutils/readelf  -w dump.o
> Executing on host: sh -c {/home/alan/build/gas/alpha-linux/gas/testsuite/../../binutils/readelf  -w dump.o >dump.out 2>gas.stderr}  
> spawn [open ...]
> regexp_diff match failure
> regexp "^    <10>   DW_AT_high_pc     : 0x.     $"
> line   "    <10>   DW_AT_high_pc     : 0x10     "
> regexp_diff match failure
> regexp "^    <44>   DW_AT_high_pc     : 0x.     $"
> line   "    <44>   DW_AT_high_pc     : 0x10     "
> FAIL: DWARF2 2
> 
> It's not just a testsuite oddity.  Relocs are being generated against
> a local symbol and the value of the sym is also appearing in the
> addend.  Since you don't use bfd_elf_generic_reloc on alpha, you get
> to write lots of horrible stuff in tc_gen_reloc and/or md_apply_fix to
> work around bfd_install_relocation brain damage..
> 

I don't see this failure.  I'm not even sure I'm getting that far.

First off, --nocompress-debug-sections doesn't work.  I still get

  [ 8] .zdebug_abbrev    PROGBITS         0000000000000000  000000dc
       000000000000004d  0000000000000000           0     0     1

At present all I can get is

$ ../../binutils/readelf -wi dump.o
Contents of the .debug_info section:

  Compilation Unit @ offset 0x0:
   Length:        0x4e (32-bit)
   Version:       2
   Abbrev Offset: 0
   Pointer Size:  4
 <0><b>: Abbrev Number: 1
readelf: Warning: DIE at offset b refers to abbreviation number 1 which does not exist

But the relocations themselves appear sane:

Relocation section '.rela.debug_info' at offset 0x878 contains 6 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000000006  000e00000001 R_ALPHA_REFLONG   0000000000000000 .Labbrev1_begin + 0
00000000000c  000f00000001 R_ALPHA_REFLONG   0000000000000000 .Lline1_begin + 0
000000000010  000900000001 R_ALPHA_REFLONG   0000000000000008 .Lend_text1 + 8
000000000014  000600000001 R_ALPHA_REFLONG   0000000000000004 .Lbegin_text1 + 4
000000000040  000700000001 R_ALPHA_REFLONG   0000000000000004 .Lbegin_func_cu1 + 4
000000000044  000800000001 R_ALPHA_REFLONG   0000000000000008 .Lend_func_cu1 + 8

So I'm not sure what problem you're seeing.

Do note that ".L" is *not* a local symbol prefix on Alpha.
For that you have to use "$".  So it's quite expected that
these aren't reduced to ".text + offset".  But that should
not really affect anything; readelf ought to be able to 
cope, I should think.


r~

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

* Re: alpha-linux gas testsuite failure
  2010-09-17 19:45 ` alpha-linux gas testsuite failure Richard Henderson
@ 2010-09-18  0:13   ` Alan Modra
  2010-09-19 22:33     ` Richard Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2010-09-18  0:13 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Binutils

On Fri, Sep 17, 2010 at 12:45:29PM -0700, Richard Henderson wrote:
> 000000000010  000900000001 R_ALPHA_REFLONG   0000000000000008 .Lend_text1 + 8

This one is sourced from
	.4byte	.Lend_text1			/* DW_AT_high_pc */

Seems to me the "+ 8" addend is wrong.

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: alpha-linux gas testsuite failure
  2010-09-18  0:13   ` Alan Modra
@ 2010-09-19 22:33     ` Richard Henderson
  2010-09-19 22:48       ` Richard Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2010-09-19 22:33 UTC (permalink / raw)
  To: Binutils

On 09/17/2010 05:12 PM, Alan Modra wrote:
> On Fri, Sep 17, 2010 at 12:45:29PM -0700, Richard Henderson wrote:
>> 000000000010  000900000001 R_ALPHA_REFLONG   0000000000000008 .Lend_text1 + 8
> 
> This one is sourced from
> 	.4byte	.Lend_text1			/* DW_AT_high_pc */
> 
> Seems to me the "+ 8" addend is wrong.

Too right.

I seemed like we were already taking care of this disgustingness:

#ifdef OBJ_ELF
      /* Ohhh, this is ugly.  The problem is that if this is a local global
         symbol, the relocation will entirely be performed at link time, not
         at assembly time.  bfd_perform_reloc doesn't know about this sort
         of thing, and as a result we need to fake it out here.  */
      if ((S_IS_EXTERNAL (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)
           || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE)
           || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_THREAD_LOCAL))
          && !S_IS_COMMON (fixp->fx_addsy))
        reloc->addend -= symbol_get_bfdsym (fixp->fx_addsy)->value;
#endif

but clearly that has stopped working.  Do you know off-hand what
the newly correct condition should be?  I can probably dig it out
eventually...



r~

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

* Re: alpha-linux gas testsuite failure
  2010-09-19 22:33     ` Richard Henderson
@ 2010-09-19 22:48       ` Richard Henderson
  2010-09-20  2:25         ` Alan Modra
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2010-09-19 22:48 UTC (permalink / raw)
  To: Binutils

On 09/19/2010 03:33 PM, Richard Henderson wrote:
> I seemed like we were already taking care of this disgustingness:
> 
> #ifdef OBJ_ELF
>       /* Ohhh, this is ugly.  The problem is that if this is a local global
>          symbol, the relocation will entirely be performed at link time, not
>          at assembly time.  bfd_perform_reloc doesn't know about this sort
>          of thing, and as a result we need to fake it out here.  */
>       if ((S_IS_EXTERNAL (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)
>            || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE)
>            || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_THREAD_LOCAL))
>           && !S_IS_COMMON (fixp->fx_addsy))
>         reloc->addend -= symbol_get_bfdsym (fixp->fx_addsy)->value;
> #endif
> 
> but clearly that has stopped working.  Do you know off-hand what
> the newly correct condition should be?  I can probably dig it out
> eventually...

Humph.  Clearly the best solution is to get rid of both hacks
and have the alpha port use bfd_elf_generic_reloc.


r~

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

* Re: alpha-linux gas testsuite failure
  2010-09-19 22:48       ` Richard Henderson
@ 2010-09-20  2:25         ` Alan Modra
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Modra @ 2010-09-20  2:25 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Binutils

On Sun, Sep 19, 2010 at 03:48:05PM -0700, Richard Henderson wrote:
> Humph.  Clearly the best solution is to get rid of both hacks
> and have the alpha port use bfd_elf_generic_reloc.

Yes, that's what I'd do.

-- 
Alan Modra
Australia Development Lab, IBM

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

end of thread, other threads:[~2010-09-20  2:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20100917051307.GB16874@bubble.grove.modra.org>
2010-09-17 19:45 ` alpha-linux gas testsuite failure Richard Henderson
2010-09-18  0:13   ` Alan Modra
2010-09-19 22:33     ` Richard Henderson
2010-09-19 22:48       ` Richard Henderson
2010-09-20  2:25         ` 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).