+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
 
   while (field != NULL)
     {
       char *name = concat (prefix, field->name, NULL);
+      char *freename = name;
 
       if (rootsym == NULL)
        {
          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.
                                field->offset,
                                rootsym, root_stag_name);
       field = field->next;
-      free (name);
+      free (freename);
     }
   free (prefix);
 }
 
 #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 */
 
-#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 .*
 
 
 0+004 <LABEL>:
    4:  000a.*
+
+0+005 <SYMTAB>:
    5:  0035.*