[Bug debug/14415] DW_AT_high_pc for sh64-elf-gcc with -m5-64media is 0

fnf at ninemoons dot com gcc-bugzilla@gcc.gnu.org
Tue Mar 9 21:53:00 GMT 2004


------- Additional Comments From fnf at ninemoons dot com  2004-03-09 21:53 -------
Subject: Re:  DW_AT_high_pc for sh64-elf-gcc with -m5-64media is 0

On Tuesday 09 March 2004 14:09, drow at false dot org wrote:
> This may be obvious, but what if any relocations are emitted?

Excellent question!  I tried this example:

  $ cat b.c
  int sum (int x, int y)
  {
    return x + y;
  }
  $ cat b2.c
  main ()
  {
    extern int sum (int, int);
    printf ("%d\n", sum (2,3));
  }
  $ /usr/local/sourceware/bin/sh64-elf-gcc -g -c -m5-64media b.c b2.c

and for b.o, the relocations that look like they are for the debug
info are:

  0000000000000010 R_SH_64           .text+0x000000000000004c
  0000000000000018 R_SH_64           .text

so it would appear that the PC values are handled totally by the
relocations, unlike the -m5-32media case where the relocations are:

  00000010 R_SH_DIR32                .text..SHmedia32
  00000014 R_SH_DIR32                .text..SHmedia32

It can be verified (which I should have done, my bad) that the final
executable has properly relocated dwarf info:

  $ /usr/local/sourceware/bin/sh64-elf-gcc -g -m5-64media -o b b.o b2.o

  <1><  110>    DW_TAG_subprogram
                DW_AT_sibling               <170>
                DW_AT_external              yes(1)
                DW_AT_name                  sum
                DW_AT_decl_file             1 /build/sourceware/gdb/T-sh64-elf/gdb/b.c
                DW_AT_decl_line             2
                DW_AT_prototyped            yes(1)
                DW_AT_type                  <170>
                DW_AT_low_pc                0x13a0
                DW_AT_high_pc               0x13ec
                DW_AT_frame_base            DW_OP_reg14

  <1><  111>    DW_TAG_subprogram
                DW_AT_sibling               <200>
                DW_AT_external              yes(1)
                DW_AT_name                  main
                DW_AT_decl_file             1 /build/sourceware/gdb/T-sh64-elf/gdb/b2.c
                DW_AT_decl_line             2
                DW_AT_type                  <200>
                DW_AT_low_pc                0x13ec
                DW_AT_high_pc               0x1468
                DW_AT_frame_base            DW_OP_reg14

So it would appear that this is a non-issue after all, and the bug
report can be closed.  I don't think I have the right info/permissions
to do that directly.

-Fred




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14415



More information about the Gcc-bugs mailing list