Delay allocation of dbx_symfile_info
authorTom Tromey <tromey@adacore.com>
Fri, 7 Jun 2019 21:01:50 +0000 (15:01 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 10 Jun 2019 13:23:33 +0000 (07:23 -0600)
commitcaa429d81a9999699a40b6394c9fb7b258669d54
treed187635e25600efbb6e97f688ac500daed5f7907
parent2e02f29632218fc24d71fbbefc368d551d0528a7
Delay allocation of dbx_symfile_info

I noticed that elfread.c always allocates a dbx_symfile_info, even
though this is only ever needed in the unusual case of reading stabs
in ELF.

This patch moves the allocation into dbxread.c, and applies the same
treatment to similar code in coffread.c.

Regression tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-06-10  Tom Tromey  <tromey@adacore.com>

* elfread.c (elf_read_minimal_symbols): Don't set the dbx objfile
data.
(elf_new_init): Don't call stabsread_new_init.
* dbxread.c (coffstab_build_psymtabs): Set dbx objfile data.
(elfstab_build_psymtabs): Likewise.  Call stabsread_new_init.
* coffread.c (coff_symfile_init): Don't set the dbx objfile data.
gdb/ChangeLog
gdb/coffread.c
gdb/dbxread.c
gdb/elfread.c