public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Subject: [PATCH]  Binutils: Readelf testcase failing with clang
@ 2022-09-14  6:45 Potharla, Rupesh
  2022-09-14  6:55 ` Jan Beulich
  2022-09-14  9:28 ` Nick Clifton
  0 siblings, 2 replies; 5+ messages in thread
From: Potharla, Rupesh @ 2022-09-14  6:45 UTC (permalink / raw)
  To: Potharla, Rupesh via Binutils, Nick Clifton
  Cc: George, Jini Susan, Parasuraman, Hariharan, Kumar N, Bhuvanendra


[-- Attachment #1.1: Type: text/plain, Size: 2201 bytes --]

[Public]


Hi,

Can you review the code changes and send in your comments or suggestions?



Patch Inlined:

---------------
The latest clang is emitting strx forms for strings earlier it was
emitting strp form. Due to this change, the readelf test case is failing,
fixing the regular expression in the test case fixes the issue. Similar
behavior is seen with addresses and fixed that as well.

Latest clang
------------
[1] DW_TAG_compile_unit DW_CHILDREN_yes
        DW_AT_producer  DW_FORM_strx1
        DW_AT_language  DW_FORM_data2

<0><c>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indexed string: 0x0): AMD clang version 15.0.0
    <e>   DW_AT_language    : 12        (ANSI C99)
    <10>   DW_AT_name        : (indexed string: 0x1): testprog.c

Old clang and Gcc
-----------------
[1] DW_TAG_variable     DW_CHILDREN_no
         DW_AT_name      DW_FORM_strp

<0><c>: Abbrev Number: 5 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indirect string, offset: 0x18): GNU C17 12.0.0 20211122
    <11>   DW_AT_language    : 29       (C11)
---
binutils/testsuite/binutils-all/readelf.exp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 0f7a1f3b5a0..23cefab41a4 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -188,12 +188,12 @@ proc readelf_wi_test {} {
     ".*DW_TAG_compile_unit.*"
     ".*DW_TAG_subprogram.*"
     ".*DW_TAG_base_type.*"
-     ".*DW_AT_producer.*(GNU C|indirect string).*"
+     ".*DW_AT_producer.*(GNU C|indirect string|indexed string).*"
     ".*DW_AT_language.*(ANSI C|C11).*"
-     ".*DW_AT_name.*(testprog.c|indirect string).*"
+     ".*DW_AT_name.*(testprog.c|indirect string|indexed string).*"
     ".*DW_AT_name.*fn.*"
-     ".*DW_AT_name.*(main|indirect string).*"
-     ".*\(DW_OP_addr: 0\).*"
+     ".*DW_AT_name.*(main|indirect string|indexed string).*"
+     ".*(DW_OP_addr: 0|DW_OP_addrx <0>).*"
     }

     # The MSP430 in LARGE mode does not generate a DW_OP_addr.
--
2.25.1




[-- Attachment #2: 0001-Binutils-Readelf-testcase-failing-with-clang.patch --]
[-- Type: application/octet-stream, Size: 2168 bytes --]

From 31a0ab4d145fd6bcf5391a739b401efabb4c437f Mon Sep 17 00:00:00 2001
From: rupothar <rupesh.potharla@amd.com>
Date: Wed, 7 Sep 2022 12:07:09 +0530
Subject: [PATCH]  Binutils: Readelf testcase failing with clang

 The latest clang is emitting strx forms for strings earlier it was
 emitting strp form. Due to this change, the readelf test case is failing,
 fixing the regular expression in the test case fixes the issue. Similar
 behavior is seen with addresses.

 Latest clang
 ------------
 [1] DW_TAG_compile_unit DW_CHILDREN_yes
        DW_AT_producer  DW_FORM_strx1
        DW_AT_language  DW_FORM_data2

 <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indexed string: 0x0): AMD clang version 15.0.0
    <e>   DW_AT_language    : 12        (ANSI C99)
    <10>   DW_AT_name        : (indexed string: 0x1): testprog.c

 Old clang and Gcc
 -----------------
 [1] DW_TAG_variable     DW_CHILDREN_no
         DW_AT_name      DW_FORM_strp

 <0><c>: Abbrev Number: 5 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indirect string, offset: 0x18): GNU C17 12.0.0 20211122
    <11>   DW_AT_language    : 29       (C11)
---
 binutils/testsuite/binutils-all/readelf.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 0f7a1f3b5a0..23cefab41a4 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -188,12 +188,12 @@ proc readelf_wi_test {} {
 	".*DW_TAG_compile_unit.*"
 	".*DW_TAG_subprogram.*"
 	".*DW_TAG_base_type.*"
-	".*DW_AT_producer.*(GNU C|indirect string).*"
+	".*DW_AT_producer.*(GNU C|indirect string|indexed string).*"
 	".*DW_AT_language.*(ANSI C|C11).*"
-	".*DW_AT_name.*(testprog.c|indirect string).*"
+	".*DW_AT_name.*(testprog.c|indirect string|indexed string).*"
 	".*DW_AT_name.*fn.*"
-	".*DW_AT_name.*(main|indirect string).*"
-	".*\(DW_OP_addr: 0\).*"
+	".*DW_AT_name.*(main|indirect string|indexed string).*"
+	".*(DW_OP_addr: 0|DW_OP_addrx <0>).*"
     }
 
     # The MSP430 in LARGE mode does not generate a DW_OP_addr.
-- 
2.25.1


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

* Re: Subject: [PATCH] Binutils: Readelf testcase failing with clang
  2022-09-14  6:45 Subject: [PATCH] Binutils: Readelf testcase failing with clang Potharla, Rupesh
@ 2022-09-14  6:55 ` Jan Beulich
  2022-09-14  7:24   ` Potharla, Rupesh
  2022-09-14  9:28 ` Nick Clifton
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2022-09-14  6:55 UTC (permalink / raw)
  To: Potharla, Rupesh
  Cc: George, Jini Susan, Parasuraman, Hariharan, Kumar N, Bhuvanendra,
	Nick Clifton, Potharla, Rupesh via Binutils

On 14.09.2022 08:45, Potharla, Rupesh via Binutils wrote:
> The latest clang is emitting strx forms for strings earlier it was
> emitting strp form. Due to this change, the readelf test case is failing,
> fixing the regular expression in the test case fixes the issue. Similar
> behavior is seen with addresses and fixed that as well.

The adjustments are okay, but please make at least one of title or
subject say which specific testcase it is that is failing. Feel
free to apply with the text adjustment.

Jan

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

* RE: Subject: [PATCH] Binutils: Readelf testcase failing with clang
  2022-09-14  6:55 ` Jan Beulich
@ 2022-09-14  7:24   ` Potharla, Rupesh
  0 siblings, 0 replies; 5+ messages in thread
From: Potharla, Rupesh @ 2022-09-14  7:24 UTC (permalink / raw)
  To: Jan Beulich
  Cc: George, Jini Susan, Parasuraman, Hariharan, Kumar N, Bhuvanendra,
	Nick Clifton, Potharla, Rupesh via Binutils

[-- Attachment #1: Type: text/plain, Size: 3461 bytes --]

[Public]

Thanks Jan,

I made the changes you have suggested. Can I go ahead and merge the code changes ?

Patch Inlined:
-----------------

 The latest clang is emitting strx forms for strings earlier it was
 emitting strp form. Due to this change, the readelf test case is failing,
 fixing the regular expression in the test case fixes the issue. Similar
 behavior is seen with addresses.

 Failing testcase:
 FAIL: readelf -wi: missing: .*DW_AT_producer.*(GNU C|indirect string).*

 Latest clang
 ------------
 [1] DW_TAG_compile_unit DW_CHILDREN_yes
        DW_AT_producer  DW_FORM_strx1
        DW_AT_language  DW_FORM_data2

 <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indexed string: 0x0): AMD clang version 15.0.0
    <e>   DW_AT_language    : 12        (ANSI C99)
    <10>  DW_AT_name        : (indexed string: 0x1): testprog.c

 Old clang and Gcc
 -----------------
 [1] DW_TAG_variable     DW_CHILDREN_no
         DW_AT_name      DW_FORM_strp

 <0><c>: Abbrev Number: 5 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indirect string, offset: 0x18): GNU C17 12.0.0 20211122
    <11>  DW_AT_language    : 29       (C11)
---
 binutils/testsuite/binutils-all/readelf.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 0f7a1f3b5a0..23cefab41a4 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -188,12 +188,12 @@ proc readelf_wi_test {} {
 	".*DW_TAG_compile_unit.*"
 	".*DW_TAG_subprogram.*"
 	".*DW_TAG_base_type.*"
-	".*DW_AT_producer.*(GNU C|indirect string).*"
+	".*DW_AT_producer.*(GNU C|indirect string|indexed string).*"
 	".*DW_AT_language.*(ANSI C|C11).*"
-	".*DW_AT_name.*(testprog.c|indirect string).*"
+	".*DW_AT_name.*(testprog.c|indirect string|indexed string).*"
 	".*DW_AT_name.*fn.*"
-	".*DW_AT_name.*(main|indirect string).*"
-	".*\(DW_OP_addr: 0\).*"
+	".*DW_AT_name.*(main|indirect string|indexed string).*"
+	".*(DW_OP_addr: 0|DW_OP_addrx <0>).*"
     }
 
     # The MSP430 in LARGE mode does not generate a DW_OP_addr.
-- 
2.25.1






Regards,
Rupesh P

>-----Original Message-----
>From: Jan Beulich <jbeulich@suse.com>
>Sent: Wednesday, September 14, 2022 12:25 PM
>To: Potharla, Rupesh <Rupesh.Potharla@amd.com>
>Cc: George, Jini Susan <JiniSusan.George@amd.com>; Parasuraman,
>Hariharan <Hariharan.Parasuraman@amd.com>; Kumar N, Bhuvanendra
><Bhuvanendra.KumarN@amd.com>; Nick Clifton <nickc@redhat.com>;
>Potharla, Rupesh via Binutils <binutils@sourceware.org>
>Subject: Re: Subject: [PATCH] Binutils: Readelf testcase failing with clang
>
>Caution: This message originated from an External Source. Use proper caution
>when opening attachments, clicking links, or responding.
>
>
>On 14.09.2022 08:45, Potharla, Rupesh via Binutils wrote:
>> The latest clang is emitting strx forms for strings earlier it was
>> emitting strp form. Due to this change, the readelf test case is
>> failing, fixing the regular expression in the test case fixes the
>> issue. Similar behavior is seen with addresses and fixed that as well.
>
>The adjustments are okay, but please make at least one of title or subject say
>which specific testcase it is that is failing. Feel free to apply with the text
>adjustment.
>
>Jan

[-- Attachment #2: 0001-Binutils-Readelf-wi-testcase-failing-with-clang.patch --]
[-- Type: application/octet-stream, Size: 2263 bytes --]

From 480eccdac217b927930905aca4c600f47a51468d Mon Sep 17 00:00:00 2001
From: rupothar <rupesh.potharla@amd.com>
Date: Wed, 7 Sep 2022 12:07:09 +0530
Subject: [PATCH]  Binutils: Readelf -wi testcase failing with clang

 The latest clang is emitting strx forms for strings earlier it was
 emitting strp form. Due to this change, the readelf test case is failing,
 fixing the regular expression in the test case fixes the issue. Similar
 behavior is seen with addresses.

 Failing testcase:
 FAIL: readelf -wi: missing: .*DW_AT_producer.*(GNU C|indirect string).*

 Latest clang
 ------------
 [1] DW_TAG_compile_unit DW_CHILDREN_yes
        DW_AT_producer  DW_FORM_strx1
        DW_AT_language  DW_FORM_data2

 <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indexed string: 0x0): AMD clang version 15.0.0
    <e>   DW_AT_language    : 12        (ANSI C99)
    <10>  DW_AT_name        : (indexed string: 0x1): testprog.c

 Old clang and Gcc
 -----------------
 [1] DW_TAG_variable     DW_CHILDREN_no
         DW_AT_name      DW_FORM_strp

 <0><c>: Abbrev Number: 5 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indirect string, offset: 0x18): GNU C17 12.0.0 20211122
    <11>  DW_AT_language    : 29       (C11)
---
 binutils/testsuite/binutils-all/readelf.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 0f7a1f3b5a0..23cefab41a4 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -188,12 +188,12 @@ proc readelf_wi_test {} {
 	".*DW_TAG_compile_unit.*"
 	".*DW_TAG_subprogram.*"
 	".*DW_TAG_base_type.*"
-	".*DW_AT_producer.*(GNU C|indirect string).*"
+	".*DW_AT_producer.*(GNU C|indirect string|indexed string).*"
 	".*DW_AT_language.*(ANSI C|C11).*"
-	".*DW_AT_name.*(testprog.c|indirect string).*"
+	".*DW_AT_name.*(testprog.c|indirect string|indexed string).*"
 	".*DW_AT_name.*fn.*"
-	".*DW_AT_name.*(main|indirect string).*"
-	".*\(DW_OP_addr: 0\).*"
+	".*DW_AT_name.*(main|indirect string|indexed string).*"
+	".*(DW_OP_addr: 0|DW_OP_addrx <0>).*"
     }
 
     # The MSP430 in LARGE mode does not generate a DW_OP_addr.
-- 
2.25.1


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

* Re: Subject: [PATCH] Binutils: Readelf testcase failing with clang
  2022-09-14  6:45 Subject: [PATCH] Binutils: Readelf testcase failing with clang Potharla, Rupesh
  2022-09-14  6:55 ` Jan Beulich
@ 2022-09-14  9:28 ` Nick Clifton
  2022-09-14  9:32   ` Potharla, Rupesh
  1 sibling, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2022-09-14  9:28 UTC (permalink / raw)
  To: Potharla, Rupesh, Potharla, Rupesh via Binutils
  Cc: George, Jini Susan, Parasuraman, Hariharan, Kumar N, Bhuvanendra

Hi Rupesh,

> Can you review the code changes and send in your comments or suggestions?

Looks good to me.  I have applied your patch.

Cheers
   Nick


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

* RE: Subject: [PATCH] Binutils: Readelf testcase failing with clang
  2022-09-14  9:28 ` Nick Clifton
@ 2022-09-14  9:32   ` Potharla, Rupesh
  0 siblings, 0 replies; 5+ messages in thread
From: Potharla, Rupesh @ 2022-09-14  9:32 UTC (permalink / raw)
  To: Nick Clifton, Potharla, Rupesh via Binutils
  Cc: George, Jini Susan, Parasuraman, Hariharan, Kumar N, Bhuvanendra

[Public]

Thanks Nick.

Regards,
Rupesh P

>-----Original Message-----
>From: Nick Clifton <nickc@redhat.com>
>Sent: Wednesday, September 14, 2022 2:59 PM
>To: Potharla, Rupesh <Rupesh.Potharla@amd.com>; Potharla, Rupesh via
>Binutils <binutils@sourceware.org>
>Cc: George, Jini Susan <JiniSusan.George@amd.com>; Parasuraman,
>Hariharan <Hariharan.Parasuraman@amd.com>; Kumar N, Bhuvanendra
><Bhuvanendra.KumarN@amd.com>
>Subject: Re: Subject: [PATCH] Binutils: Readelf testcase failing with clang
>
>Caution: This message originated from an External Source. Use proper caution
>when opening attachments, clicking links, or responding.
>
>
>Hi Rupesh,
>
>> Can you review the code changes and send in your comments or
>suggestions?
>
>Looks good to me.  I have applied your patch.
>
>Cheers
>   Nick

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

end of thread, other threads:[~2022-09-14  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14  6:45 Subject: [PATCH] Binutils: Readelf testcase failing with clang Potharla, Rupesh
2022-09-14  6:55 ` Jan Beulich
2022-09-14  7:24   ` Potharla, Rupesh
2022-09-14  9:28 ` Nick Clifton
2022-09-14  9:32   ` Potharla, Rupesh

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