}
// Create an FDE associated with a PLT.
- Fde(Output_data* plt, const unsigned char* contents, size_t length)
+ Fde(Output_data* plt, const unsigned char* contents, size_t length,
+ bool post_map)
: object_(NULL),
contents_(reinterpret_cast<const char*>(contents), length)
- { this->u_.from_linker.plt = plt; }
+ {
+ this->u_.from_linker.plt = plt;
+ this->u_.from_linker.post_map = post_map;
+ }
// Return the length of this FDE. Add 4 for the length and 4 for
// the offset to the CIE.
output_offset);
}
+ // Return whether this FDE was added after merge mapping.
+ bool
+ post_map()
+ { return this->object_ == NULL && this->u_.from_linker.post_map; }
+
// Write the FDE to OVIEW starting at OFFSET. FDE_ENCODING is the
// encoding, from the CIE. Round up the bytes to ADDRALIGN if
// necessary. ADDRESS is the virtual address of OVIEW. Record the
// The only linker generated FDEs are for PLT sections, and this
// points to the PLT section.
Output_data* plt;
+ // Set if the FDE was added after merge mapping.
+ bool post_map;
} from_linker;
} u_;
// FDE data.
std::string contents_;
};
+// FDEs stashed for later processing.
+
+struct Post_fde;
+typedef std::vector<Post_fde*> Post_fdes;
+
// This class holds a CIE.
class Cie
set_output_offset(section_offset_type output_offset, unsigned int addralign,
Merge_map*);
- // Write the CIE to OVIEW starting at OFFSET. EH_FRAME_HDR is the
- // exception frame header for FDE recording. Round up the bytes to
- // ADDRALIGN. ADDRESS is the virtual address of OVIEW. Return the
- // new offset.
+ // 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.
+ // POST_FDES stashes FDEs created after mappings were done, for later
+ // writing. Return the new offset.
template<int size, bool big_endian>
section_offset_type
write(unsigned char* oview, section_offset_type offset, uint64_t address,
- unsigned int addralign, Eh_frame_hdr* eh_frame_hdr);
+ unsigned int addralign, Eh_frame_hdr* eh_frame_hdr,
+ Post_fdes* post_fdes);
friend bool operator<(const Cie&, const Cie&);
friend bool operator==(const Cie&, const Cie&);