Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: ehframe.patch

Issue 27594002: Linux: Upgrade to gold 2.23.2. Include a patch to fix a race in the ehframe code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/gold/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « README.chromium ('k') | gold32 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/gold/ehframe.cc b/gold/ehframe.cc
2 index 08a9ec6..be262bf 100644
3 --- a/gold/ehframe.cc
4 +++ b/gold/ehframe.cc
5 @@ -84,7 +84,8 @@ Eh_frame_hdr::Eh_frame_hdr(Output_section* eh_frame_section,
6 eh_frame_section_(eh_frame_section),
7 eh_frame_data_(eh_frame_data),
8 fde_offsets_(),
9 - any_unrecognized_eh_frame_sections_(false)
10 + any_unrecognized_eh_frame_sections_(false),
11 + lock_(NULL)
12 {
13 }
14
15 @@ -102,6 +103,9 @@ Eh_frame_hdr::set_final_data_size()
16 this->fde_offsets_.reserve(fde_count);
17 }
18 this->set_data_size(data_size);
19 + // We need a lock for updating the fde_offsets_ vector while writing
20 + // the FDEs.
21 + this->lock_ = new Lock();
22 }
23
24 // Write the data to the file.
25 diff --git a/gold/ehframe.h b/gold/ehframe.h
26 index 8aab8b8..d5ac668 100644
27 --- a/gold/ehframe.h
28 +++ b/gold/ehframe.h
29 @@ -60,7 +60,10 @@ class Eh_frame_hdr : public Output_section_data
30 record_fde(section_offset_type fde_offset, unsigned char fde_encoding)
31 {
32 if (!this->any_unrecognized_eh_frame_sections_)
33 - this->fde_offsets_.push_back(std::make_pair(fde_offset, fde_encoding));
34 + {
35 + Hold_lock(*this->lock_);
36 + this->fde_offsets_.push_back(std::make_pair(fde_offset, fde_encoding));
37 + }
38 }
39
40 protected:
41 @@ -157,6 +160,8 @@ class Eh_frame_hdr : public Output_section_data
42 // Whether we found any .eh_frame sections which we could not
43 // process.
44 bool any_unrecognized_eh_frame_sections_;
45 + // Lock held while updating fde_offsets_.
46 + Lock* lock_;
47 };
48
49 // This class holds an FDE.
OLDNEW
« no previous file with comments | « README.chromium ('k') | gold32 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698