[binutils-gdb] tic54x fixes

Alan Modra amodra@sourceware.org
Mon Aug 24 12:18:52 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=12c4b9aad5e45fa38e31801e13f50b730925c913

commit 12c4b9aad5e45fa38e31801e13f50b730925c913
Author: Alan Modra <amodra@gmail.com>
Date:   Sun Aug 23 21:05:34 2020 +0930

    tic54x fixes
    
    A number of the tic54x tests were failing, and I thought it worth
    investigating since the target makes use of a lot of hash tables, and
    we've just changed gas hash tables.  It turns out none of the gas
    failures were due to hashing.
    
            * config/tc-tic54x.c (stag_add_field_symbols): Don't free "name"
            in case where it isn't copied.
            * config/tc-tic54x.h (LOCAL_LABELS_FB): Undef.
            * testsuite/gas/tic54x/field.d: Dump section contents and symbols
            rather than disassembling.
            * testsuite/gas/tic54x/set.d: Adjust for newer disassembly.

Diff:
---
 gas/ChangeLog                    |  9 ++++++++
 gas/config/tc-tic54x.c           |  4 +++-
 gas/config/tc-tic54x.h           |  2 ++
 gas/testsuite/gas/tic54x/field.d | 45 +++++++++++++++-------------------------
 gas/testsuite/gas/tic54x/set.d   |  2 ++
 5 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6b634a0f360..60114ed2226 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2020-08-24  Alan Modra  <amodra@gmail.com>
+
+	* config/tc-tic54x.c (stag_add_field_symbols): Don't free "name"
+	in case where it isn't copied.
+	* config/tc-tic54x.h (LOCAL_LABELS_FB): Undef.
+	* testsuite/gas/tic54x/field.d: Dump section contents and symbols
+	rather than disassembling.
+	* testsuite/gas/tic54x/set.d: Adjust for newer disassembly.
+
 2020-08-24  Alan Modra  <amodra@gmail.com>
 
 	* config/tc-aarch64.c (md_begin): Don't bother checking for
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
index 62d49d9bc8b..5fe1b2f92ea 100644
--- a/gas/config/tc-tic54x.c
+++ b/gas/config/tc-tic54x.c
@@ -551,6 +551,7 @@ stag_add_field_symbols (struct stag *stag,
   while (field != NULL)
     {
       char *name = concat (prefix, field->name, NULL);
+      char *freename = name;
 
       if (rootsym == NULL)
 	{
@@ -568,6 +569,7 @@ stag_add_field_symbols (struct stag *stag,
 	  replacement = concat (S_GET_NAME (rootsym), "+", root_stag_name,
 				name + strlen (S_GET_NAME (rootsym)), NULL);
 	  str_hash_insert (subsym_hash[0], name, replacement, 0);
+	  freename = NULL;
 	}
 
       /* Recurse if the field is a structure.
@@ -577,7 +579,7 @@ stag_add_field_symbols (struct stag *stag,
 				field->offset,
 				rootsym, root_stag_name);
       field = field->next;
-      free (name);
+      free (freename);
     }
   free (prefix);
 }
diff --git a/gas/config/tc-tic54x.h b/gas/config/tc-tic54x.h
index 8d0d0f195d6..5ba4a6ad5e8 100644
--- a/gas/config/tc-tic54x.h
+++ b/gas/config/tc-tic54x.h
@@ -35,6 +35,8 @@
 #define MAX_OPERANDS 4
 #define PARALLEL_SEPARATOR '|'
 #define LABELS_WITHOUT_COLONS 1
+#undef LOCAL_LABELS_FB
+
 /* accept 0FFFFh, 1010b, etc.  */
 #define NUMBERS_WITH_SUFFIX 1
 /* $ is section program counter */
diff --git a/gas/testsuite/gas/tic54x/field.d b/gas/testsuite/gas/tic54x/field.d
index 60a4868904c..941d36b28a6 100644
--- a/gas/testsuite/gas/tic54x/field.d
+++ b/gas/testsuite/gas/tic54x/field.d
@@ -1,30 +1,19 @@
-#objdump: -d
+#objdump: -s -t
 #name: c54x field directive
 
-.*: +file format .*c54x.*
-
-Disassembly of section .text:
-
-0+000 <f1>:
-   0:	2af0.*
-   1:	5600.*
-
-0+001 <f2>:
-   1:	5600.*
-
-0+002 <f4>:
-   2:	0001.*
-
-0+003 <f5>:
-   3:	0000.*
-   4:	4321.*
-
-0+005 <f6>:
-   5:	000f.*
-
-0+006 <f7>:
-   6:	6000.*
-   7:	008a.*
-
-0+007 <f8>:
-   7:	008a.*
+.*:     file format .*
+
+SYMBOL TABLE:
+#...
+.* 0x0+0 f1
+.* 0x0+1 f2
+.* 0x0+1 f3
+.* 0x0+2 f4
+.* 0x0+3 f5
+.* 0x0+5 f6
+.* 0x0+6 f7
+.* 0x0+7 f8
+#...
+
+Contents of section \.text:
+ 0000 f02a0056 01000000 21430f00 00608a00 .*
diff --git a/gas/testsuite/gas/tic54x/set.d b/gas/testsuite/gas/tic54x/set.d
index 8f661884d43..1fd69bfa4fd 100644
--- a/gas/testsuite/gas/tic54x/set.d
+++ b/gas/testsuite/gas/tic54x/set.d
@@ -13,4 +13,6 @@ Disassembly of section .text:
 
 0+004 <LABEL>:
    4:	000a.*
+
+0+005 <SYMTAB>:
    5:	0035.*


More information about the Binutils-cvs mailing list