aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-19 12:18:05 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-19 12:18:36 -0400
commit9005fbbb0023f212fcd797227b839f21cb8bf0a1 (patch)
tree12437fdcf47ab41839ad4e9a76430a826698b853 /gdb/elfread.c
parent68b888fff3164b5e8e347d9c1ca351c366f0aac4 (diff)
downloadgdb-9005fbbb0023f212fcd797227b839f21cb8bf0a1.zip
gdb-9005fbbb0023f212fcd797227b839f21cb8bf0a1.tar.gz
gdb-9005fbbb0023f212fcd797227b839f21cb8bf0a1.tar.bz2
gdb: make symfile_segment_data::segment_info an std::vector
Change the symfile_segment_data::segment_info array to be an std::vector. No functional changes are expected. gdb/ChangeLog: * symfile.h (struct symfile_segment_data) <~symfile_segment_data>: Remove. <segment_info>: Change to std::vector. * symfile.c (default_symfile_segments): Update. * elfread.c (elf_symfile_segments): Update.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 4318ebf..75bdd75 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -118,7 +118,9 @@ elf_symfile_segments (bfd *abfd)
data->segments.emplace_back (segments[i]->p_vaddr, segments[i]->p_memsz);
num_sections = bfd_count_sections (abfd);
- data->segment_info = XCNEWVEC (int, num_sections);
+
+ /* All elements are initialized to 0 (map to no segment). */
+ data->segment_info.resize (num_sections);
for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
{