toolchain/binutils: backport stable patches
[openwrt/staging/dedeckeh.git] / toolchain / binutils / patches / 2.40 / 046-gas-correct-symbol-name-comparison-in-.startof.-.siz.patch
1 From b2bc62b7b4e7638c3a249d2d2728ceb4d5f2b22c Mon Sep 17 00:00:00 2001
2 From: Jan Beulich <jbeulich@suse.com>
3 Date: Tue, 14 Feb 2023 08:35:02 +0100
4 Subject: [PATCH 46/50] gas: correct symbol name comparison in
5 .startof./.sizeof. handling
6
7 In 162c6aef1f3a ("gas: fold symbol table entries generated for
8 .startof.() / .sizeof.()") I screwed up quite badly, inverting the case
9 sensitive and case insensitive comparison functions.
10 ---
11 gas/expr.c | 4 ++--
12 gas/testsuite/gas/elf/startof.d | 2 ++
13 gas/testsuite/gas/elf/startof.s | 3 +++
14 3 files changed, 7 insertions(+), 2 deletions(-)
15
16 --- a/gas/expr.c
17 +++ b/gas/expr.c
18 @@ -149,8 +149,8 @@ symbol_lookup_or_make (const char *name,
19
20 name = S_GET_NAME (symbolP);
21 if ((symbols_case_sensitive
22 - ? strcasecmp (buf, name)
23 - : strcmp (buf, name)) == 0)
24 + ? strcmp (buf, name)
25 + : strcasecmp (buf, name)) == 0)
26 {
27 free (buf);
28 return symbolP;
29 --- a/gas/testsuite/gas/elf/startof.d
30 +++ b/gas/testsuite/gas/elf/startof.d
31 @@ -7,4 +7,6 @@ Symbol table .*
32 #...
33 [1-8]: 0+ .* UND \.startof\.\.text
34 [2-9]: 0+ .* UND \.sizeof\.\.text
35 + +[1-9][0-9]*: 0+ .* UND \.startof\.\.Text
36 + +[1-9][0-9]*: 0+ .* UND \.sizeof\.\.TEXT
37 #pass
38 --- a/gas/testsuite/gas/elf/startof.s
39 +++ b/gas/testsuite/gas/elf/startof.s
40 @@ -4,3 +4,6 @@
41 .dc.a 0
42 .dc.a .sizeof.(.text)
43 .dc.a .startof.(.text)
44 + .dc.a 0
45 + .dc.a .startof.(.Text)
46 + .dc.a .sizeof.(.TEXT)