- struct symtab *s = allocate_symtab (name, objfile);
-
- LINETABLE (s) = new_linetable (maxlines);
-
- /* All symtabs must have at least two blocks */
- BLOCKVECTOR (s) = new_bvect (2);
- BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK)
- = new_block (NON_FUNCTION_BLOCK);
- BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)
- = new_block (NON_FUNCTION_BLOCK);
- BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)) =
- BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
-
- s->free_code = free_linetable;
- s->debugformat = "ECOFF";
- return (s);
+ struct compunit_symtab *cust = allocate_compunit_symtab (objfile, name);
+ struct symtab *symtab;
+ struct blockvector *bv;
+
+ add_compunit_symtab_to_objfile (cust);
+ symtab = allocate_symtab (cust, name);
+
+ SYMTAB_LINETABLE (symtab) = new_linetable (maxlines);
+
+ /* All symtabs must have at least two blocks. */
+ bv = new_bvect (2);
+ BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK);
+ BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK);
+ BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
+ BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ COMPUNIT_BLOCKVECTOR (cust) = bv;
+
+ COMPUNIT_DEBUGFORMAT (cust) = "ECOFF";
+ return cust;