aboutsummaryrefslogtreecommitdiff
path: root/gold/ehframe.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-02-27 23:11:56 +0000
committerAlan Modra <amodra@gmail.com>2013-02-27 23:11:56 +0000
commit9d5781f8a245086dcdd3cd8fcddcd5b19c3a1e49 (patch)
treee53d7aa78570b4f92a31db6d49bb0e0a31374b61 /gold/ehframe.h
parent71091f23fd90c0f1d04a0471ec561f07120b702c (diff)
downloadfsf-binutils-gdb-9d5781f8a245086dcdd3cd8fcddcd5b19c3a1e49.zip
fsf-binutils-gdb-9d5781f8a245086dcdd3cd8fcddcd5b19c3a1e49.tar.gz
fsf-binutils-gdb-9d5781f8a245086dcdd3cd8fcddcd5b19c3a1e49.tar.bz2
* target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
* target.cc (Target::do_plt_fde_location): New function. * ehframe.h (class FDE): Add post_map field to u_.from_linker, accessor function, and constructor param. (struct Post_fde, Post_fdes): Declare. (Cie::write): Add post_fdes param. * ehframe.cc (Fde::write): Use plt_fde_location. (struct Post_fde): Define. (Cie::write): Stash FDEs added post merge mapping. (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping. Adjust Fde constructor call. Bump final_data_size_ for post map FDEs. (Eh_frame::do_sized_write): Arrange to write post map FDES after other FDEs. * powerpc.cc (Target_powerpc::do_plt_fde_location): New function. (Target_powerpc::has_glink): New function. (Target_powerpc::do_relax): Add eh_frame info for stubs. (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64, glink_eh_frame_fde_32, default_fde): New data. (Stub_table::eh_frame_added_): New var. (Stub_table::find_long_branch_entry, stub_address, stub_offset): Make const. (Stub_table::add_eh_frame): New function. (Output_data_glink::add_eh_frame): New function. (Target_powerpc::make_glink_section): Call add_eh_frame.
Diffstat (limited to 'gold/ehframe.h')
-rw-r--r--gold/ehframe.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/gold/ehframe.h b/gold/ehframe.h
index c3f82e9..de7c109 100644
--- a/gold/ehframe.h
+++ b/gold/ehframe.h
@@ -174,10 +174,14 @@ class Fde
}
// 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.
@@ -196,6 +200,11 @@ class Fde
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
@@ -229,12 +238,19 @@ class Fde
// 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
@@ -284,14 +300,16 @@ 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&);