046-gas-correct-symbol-name-comparison-in-.startof.-.siz.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From b2bc62b7b4e7638c3a249d2d2728ceb4d5f2b22c Mon Sep 17 00:00:00 2001
  2. From: Jan Beulich <[email protected]>
  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. In 162c6aef1f3a ("gas: fold symbol table entries generated for
  7. .startof.() / .sizeof.()") I screwed up quite badly, inverting the case
  8. sensitive and case insensitive comparison functions.
  9. ---
  10. gas/expr.c | 4 ++--
  11. gas/testsuite/gas/elf/startof.d | 2 ++
  12. gas/testsuite/gas/elf/startof.s | 3 +++
  13. 3 files changed, 7 insertions(+), 2 deletions(-)
  14. --- a/gas/expr.c
  15. +++ b/gas/expr.c
  16. @@ -149,8 +149,8 @@ symbol_lookup_or_make (const char *name,
  17. name = S_GET_NAME (symbolP);
  18. if ((symbols_case_sensitive
  19. - ? strcasecmp (buf, name)
  20. - : strcmp (buf, name)) == 0)
  21. + ? strcmp (buf, name)
  22. + : strcasecmp (buf, name)) == 0)
  23. {
  24. free (buf);
  25. return symbolP;
  26. --- a/gas/testsuite/gas/elf/startof.d
  27. +++ b/gas/testsuite/gas/elf/startof.d
  28. @@ -7,4 +7,6 @@ Symbol table .*
  29. #...
  30. [1-8]: 0+ .* UND \.startof\.\.text
  31. [2-9]: 0+ .* UND \.sizeof\.\.text
  32. + +[1-9][0-9]*: 0+ .* UND \.startof\.\.Text
  33. + +[1-9][0-9]*: 0+ .* UND \.sizeof\.\.TEXT
  34. #pass
  35. --- a/gas/testsuite/gas/elf/startof.s
  36. +++ b/gas/testsuite/gas/elf/startof.s
  37. @@ -4,3 +4,6 @@
  38. .dc.a 0
  39. .dc.a .sizeof.(.text)
  40. .dc.a .startof.(.text)
  41. + .dc.a 0
  42. + .dc.a .startof.(.Text)
  43. + .dc.a .sizeof.(.TEXT)