summaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-03-07 23:27:53 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-03-07 23:27:53 +0000
commit4a8ac447d8600f9a1d659ef651fdf45b3d971fe6 (patch)
tree19999c4beeda71e980b6b11237b015e56b108b63 /gold
parentf67de119a9e55db67a182877d909fa0455fa0c56 (diff)
downloadbinutils-redhat-4a8ac447d8600f9a1d659ef651fdf45b3d971fe6.tar.gz
* ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
pointer to Post_fde. (struct Post_fde): Move definition to here.. * ehframe.cc (struct Post_fde): ..from here. (Cie::write): Don't alloc Post_fde. (Eh_frame::do_sized_write): Update. Don't free Post_fde.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog9
-rw-r--r--gold/ehframe.cc26
-rw-r--r--gold/ehframe.h16
3 files changed, 27 insertions, 24 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index c3d1b5af13..0b5e99e066 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-08 Alan Modra <amodra@gmail.com>
+
+ * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
+ pointer to Post_fde.
+ (struct Post_fde): Move definition to here..
+ * ehframe.cc (struct Post_fde): ..from here.
+ (Cie::write): Don't alloc Post_fde.
+ (Eh_frame::do_sized_write): Update. Don't free Post_fde.
+
2013-03-07 Alan Modra <amodra@gmail.com>
* testsuite/discard_locals_relocatable_test.c: Add a powerpc
diff --git a/gold/ehframe.cc b/gold/ehframe.cc
index 82a6d6e898..08a9ec6bd1 100644
--- a/gold/ehframe.cc
+++ b/gold/ehframe.cc
@@ -441,19 +441,6 @@ Cie::set_output_offset(section_offset_type output_offset,
return output_offset + length;
}
-// A FDE plus some info from a CIE to allow later writing of the FDE.
-
-struct Post_fde
-{
- Post_fde(Fde* f, section_offset_type cie_off, unsigned char encoding)
- : fde(f), cie_offset(cie_off), fde_encoding(encoding)
- { }
-
- Fde* fde;
- section_offset_type cie_offset;
- unsigned char fde_encoding;
-};
-
// Write the CIE to OVIEW starting at OFFSET. Round up the bytes to
// ADDRALIGN. ADDRESS is the virtual address of OVIEW.
// EH_FRAME_HDR is the exception frame header for FDE recording.
@@ -499,7 +486,7 @@ Cie::write(unsigned char* oview, section_offset_type offset,
++p)
{
if ((*p)->post_map())
- post_fdes->push_back(new Post_fde(*p, cie_offset, fde_encoding));
+ post_fdes->push_back(Post_fde(*p, cie_offset, fde_encoding));
else
offset = (*p)->write<size, big_endian>(oview, offset, address,
addralign, cie_offset,
@@ -1211,13 +1198,10 @@ Eh_frame::do_sized_write(unsigned char* oview)
for (Post_fdes::iterator p = post_fdes.begin();
p != post_fdes.end();
++p)
- {
- o = (*p)->fde->write<size, big_endian>(oview, o, address, addralign,
- (*p)->cie_offset,
- (*p)->fde_encoding,
- this->eh_frame_hdr_);
- delete *p;
- }
+ o = (*p).fde->write<size, big_endian>(oview, o, address, addralign,
+ (*p).cie_offset,
+ (*p).fde_encoding,
+ this->eh_frame_hdr_);
}
#ifdef HAVE_TARGET_32_LITTLE
diff --git a/gold/ehframe.h b/gold/ehframe.h
index de7c1092eb..8aab8b8168 100644
--- a/gold/ehframe.h
+++ b/gold/ehframe.h
@@ -246,10 +246,20 @@ class Fde
std::string contents_;
};
-// FDEs stashed for later processing.
+// A FDE plus some info from a CIE to allow later writing of the FDE.
-struct Post_fde;
-typedef std::vector<Post_fde*> Post_fdes;
+struct Post_fde
+{
+ Post_fde(Fde* f, section_offset_type cie_off, unsigned char encoding)
+ : fde(f), cie_offset(cie_off), fde_encoding(encoding)
+ { }
+
+ Fde* fde;
+ section_offset_type cie_offset;
+ unsigned char fde_encoding;
+};
+
+typedef std::vector<Post_fde> Post_fdes;
// This class holds a CIE.