gas: correct symbol name comparison in .startof./.sizeof. handling

Message ID 2096ddec-287a-de42-a2f6-58293af2fd48@suse.com
State Accepted
Headers
Series gas: correct symbol name comparison in .startof./.sizeof. handling |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jan Beulich Feb. 13, 2023, 2:54 p.m. UTC
  In 162c6aef1f3a ("gas: fold symbol table entries generated for
.startof.() / .sizeof.()") I screwed up quite badly, inverting the case
sensitive and case insensitive comparison functions.
---
While there were no reports of this breakage, I'm still inclined to also
put this on the 2.40 branch.
  

Comments

Nick Clifton Feb. 14, 2023, 8:33 a.m. UTC | #1
Hi Jan,

> While there were no reports of this breakage, I'm still inclined to also
> put this on the 2.40 branch.

Please do.

Cheers
   Nick
  

Patch

--- a/gas/expr.c
+++ b/gas/expr.c
@@ -149,8 +149,8 @@  symbol_lookup_or_make (const char *name,
 
     name = S_GET_NAME (symbolP);
     if ((symbols_case_sensitive
-	 ? strcasecmp (buf, name)
-	 : strcmp (buf, name)) == 0)
+	 ? strcmp (buf, name)
+	 : strcasecmp (buf, name)) == 0)
       {
 	free (buf);
 	return symbolP;
--- a/gas/testsuite/gas/elf/startof.d
+++ b/gas/testsuite/gas/elf/startof.d
@@ -7,4 +7,6 @@  Symbol table .*
 #...
      [1-8]: 0+ .* UND \.startof\.\.text
      [2-9]: 0+ .* UND \.sizeof\.\.text
+ +[1-9][0-9]*: 0+ .* UND \.startof\.\.Text
+ +[1-9][0-9]*: 0+ .* UND \.sizeof\.\.TEXT
 #pass
--- a/gas/testsuite/gas/elf/startof.s
+++ b/gas/testsuite/gas/elf/startof.s
@@ -4,3 +4,6 @@ 
 	.dc.a	0
 	.dc.a	.sizeof.(.text)
 	.dc.a	.startof.(.text)
+	.dc.a	0
+	.dc.a	.startof.(.Text)
+	.dc.a	.sizeof.(.TEXT)