This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Support unordered .debug_info references to .debug_ranges


On Thu, Jul 16, 2009 at 11:18 AM, H.J. Lu<hjl.tools@gmail.com> wrote:
> On Thu, Jul 16, 2009 at 1:45 AM, Jan
> Kratochvil<jan.kratochvil@redhat.com> wrote:
>> On Thu, 16 Jul 2009 04:39:53 +0200, Dave Korn wrote:
>>> binutils/testsuite/ChangeLog:
>>>
>>> ? ? ? * binutils-all/objcopy.exp: ?Only run testranges if is_elf_format.
>>>
>>> ? Tested on i686-pc-cygwin; Jan, would you mind verifying it still runs (and
>>> passes) the test on your linux target?
>>
>> Yes, it works (x86_64-fedora-linux-gnu). ?I agree it is right this way, please
>> check it in.
>>
>> BTW is there some list of currently supported targets to check both for
>> failing new tests and for regressions? ?Found out once the one below
>> ? ? ? ?Cross-host testing patch
>> ? ? ? ?http://sourceware.org/ml/binutils/2007-08/msg00382.html
>> but I guess it may be too large for testing of "normal" patches.
>>
>>
>
> This testcase doesn't work on Linux/ia64 where '#' is a special char.
> You can use a cross binutils to make sure that it works on Linux/ia64.
>
> H.J.
>

Hi,

I am checking in this patch as an obvious fix.

Thanks.

-- 
H.J.
Index: binutils-all/objcopy.exp
===================================================================
--- binutils-all/objcopy.exp    (revision 6408)
+++ binutils-all/objcopy.exp    (working copy)
@@ -875,3 +875,4 @@ if [is_elf_format] {
 }
 run_dump_test "localize-hidden-2"
 run_dump_test "testranges"
+run_dump_test "testranges-ia64"
Index: binutils-all/testranges.d
===================================================================
--- binutils-all/testranges.d   (revision 6408)
+++ binutils-all/testranges.d   (working copy)
@@ -2,6 +2,7 @@
 #source: testranges.s
 #readelf: -wR --wide
 #name: unordered .debug_info references to .debug_ranges
+#not-target: ia64-*-*

 Contents of the .debug_ranges section:

Index: binutils-all/testranges-ia64.d
===================================================================
--- binutils-all/testranges-ia64.d      (revision 0)
+++ binutils-all/testranges-ia64.d      (revision 0)
@@ -0,0 +1,15 @@
+#PROG: objcopy
+#source: testranges-ia64.s
+#readelf: -wR --wide
+#name: unordered .debug_info references to .debug_ranges
+#target: ia64-*-*
+
+Contents of the .debug_ranges section:
+
+    Offset   Begin    End
+    00000000 00000001 00000002
+    00000000 <End of list>
+    00000010 00000000 00000002
+    00000010 <End of list>
+
+#pass
Index: binutils-all/testranges-ia64.s
===================================================================
--- binutils-all/testranges-ia64.s      (revision 0)
+++ binutils-all/testranges-ia64.s      (revision 0)
@@ -0,0 +1,57 @@
+# Test .debug_info can reference .debug_ranges entries without ordering the
+# offsets strictly as increasing.
+
+       .text
+start:
+       .byte   1
+sub:
+       .byte   2
+end:
+
+       .section        .debug_ranges,"",@progbits
+range:
+
+range_sub:
+       data4.ua        @secrel(sub), @secrel(end)
+       data4.ua        0, 0    /* range terminator  */
+
+range_cu:
+       data4.ua        @secrel(start), @secrel(end)
+       data4.ua        0, 0    /* range terminator  */
+
+       .section        .debug_info,"",@progbits
+       data4.ua        debugE - debugS /* Length of Compilation Unit Info  */
+debugS:
+       .short  0x2     /* DWARF version number  */
+       data4.ua        @secrel(abbrev0) /* Offset Into Abbrev. Section  */
+       .byte   0x4     /* Pointer Size (in bytes)  */
+
+       .uleb128 0x1    /* (DIE (0xb) DW_TAG_compile_unit)  */
+       data4.ua        range_cu - range        /* DW_AT_ranges  */
+
+       .uleb128 0x2    /* (DIE (0x6d) DW_TAG_subprogram)  */
+       .ascii "A\0"    /* DW_AT_name */
+       data4.ua        range_sub - range       /* DW_AT_ranges  */
+debugE:
+
+       .section        .debug_abbrev,"",@progbits
+abbrev0:
+       .uleb128 0x1    /* (abbrev code)  */
+       .uleb128 0x11   /* (TAG: DW_TAG_compile_unit)  */
+       .byte   0x0     /* DW_children_no  */
+       .uleb128 0x55   /* (DW_AT_ranges)  */
+       .uleb128 0x6    /* (DW_FORM_data4)  */
+       .byte   0x0
+       .byte   0x0
+
+       .uleb128 0x2    /* (abbrev code)  */
+       .uleb128 0x2e   /* (TAG: DW_TAG_subprogram)  */
+       .byte   0x0     /* DW_children_no  */
+       .uleb128 0x3    /* (DW_AT_name)  */
+       .uleb128 0x8    /* (DW_FORM_string)  */
+       .uleb128 0x55   /* (DW_AT_ranges)  */
+       .uleb128 0x6    /* (DW_FORM_data4) */
+       .byte   0x0
+       .byte   0x0
+
+       .byte   0x0     /* abbrevs terminator  */
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 6408)
+++ ChangeLog   (working copy)
@@ -1,3 +1,12 @@
+2009-07-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * binutils-all/objcopy.exp; Run testranges-ia64.
+
+       * binutils-all/testranges.d: Don't run for ia64.
+
+       * binutils-all/testranges-ia64.d: New.
+       * binutils-all/testranges-ia64.s: Likewise.
+
 2009-07-14  Jan Kratochvil  <jan.kratochvil@redhat.com>

        * binutils-all/objcopy.exp (testranges): New test.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]