aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2010-04-07 22:58:23 +0000
committerCary Coutant <ccoutant@google.com>2010-04-07 22:58:23 +0000
commit00698fc57c3f25b4a99935bb625aa254c08c6dca (patch)
tree1378fa715297cca3df93545e7e19a2c36fb15803 /gold/object.h
parent7296d9338774c74e5a525f0c8f31c20f367997f5 (diff)
downloadfsf-binutils-gdb-00698fc57c3f25b4a99935bb625aa254c08c6dca.zip
fsf-binutils-gdb-00698fc57c3f25b4a99935bb625aa254c08c6dca.tar.gz
fsf-binutils-gdb-00698fc57c3f25b4a99935bb625aa254c08c6dca.tar.bz2
* archive.cc (include_member): Destroy Read_symbols_data object before
releasing file. * object.cc (Read_symbols_data::~Read_symbols_data) New destructor. * object.h (Read_symbols_data::Read_symbols_data) New constructor. (Read_symbols_data::~Read_symbols_data) New destructor. (Section_relocs::Section_relocs) New constructor. (Section_relocs::~Section_relocs) New destructor. (Read_relocs_data::Read_relocs_data) New constructor. (Read_relocs_data::~Read_relocs_data) New destructor. * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member pointers to NULL after deleting.
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/gold/object.h b/gold/object.h
index dc0cb2d..02747a7 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -55,6 +55,13 @@ class Stringpool_template;
struct Read_symbols_data
{
+ Read_symbols_data()
+ : section_headers(NULL), section_names(NULL), symbols(NULL),
+ symbol_names(NULL), versym(NULL), verdef(NULL), verneed(NULL)
+ { }
+
+ ~Read_symbols_data();
+
// Section headers.
File_view* section_headers;
// Section names.
@@ -102,6 +109,13 @@ struct Symbol_location_info
struct Section_relocs
{
+ Section_relocs()
+ : contents(NULL)
+ { }
+
+ ~Section_relocs()
+ { delete this->contents; }
+
// Index of reloc section.
unsigned int reloc_shndx;
// Index of section that relocs apply to.
@@ -125,6 +139,13 @@ struct Section_relocs
struct Read_relocs_data
{
+ Read_relocs_data()
+ : local_symbols(NULL)
+ { }
+
+ ~Read_relocs_data()
+ { delete this->local_symbols; }
+
typedef std::vector<Section_relocs> Relocs_list;
// The relocations.
Relocs_list relocs;