diff options
author | Roland McGrath <roland@gnu.org> | 2013-08-16 18:12:30 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2013-08-16 18:12:30 +0000 |
commit | 5d3ad97830372c746a00f1880f3d2d34e2a59bcf (patch) | |
tree | 08745d18d8aaa7ce6d7c31592f9aaef9b5a4ec20 | |
parent | 64cd7832b2a6a6c59f67c845af01a413a5397f26 (diff) | |
download | binutils-gdb-5d3ad97830372c746a00f1880f3d2d34e2a59bcf.tar.gz |
gold/
* i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
* x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
-rw-r--r-- | gold/ChangeLog | 5 | ||||
-rw-r--r-- | gold/i386.cc | 12 | ||||
-rw-r--r-- | gold/x86_64.cc | 13 |
3 files changed, 30 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 0c95dd0683f..69b76456d61 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2013-08-16 Roland McGrath <mcgrathr@google.com> + + * i386.cc (Target_i386_nacl::do_code_fill): New virtual function. + * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function. + 2013-07-19 Roland McGrath <mcgrathr@google.com> * options.h (General_options): Add -Trodata-segment option. diff --git a/gold/i386.cc b/gold/i386.cc index 3f0a0390861..47f2de4ea8f 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -3930,6 +3930,9 @@ class Target_i386_nacl : public Target_i386 return new Output_data_plt_i386_nacl_exec(layout, got_plt, got_irelative); } + virtual std::string + do_code_fill(section_size_type length) const; + private: static const Target::Target_info i386_nacl_info; }; @@ -4129,6 +4132,15 @@ Output_data_plt_i386_nacl::plt_eh_frame_fde[plt_eh_frame_fde_size] = elfcpp::DW_CFA_nop }; +// Return a string used to fill a code section with nops. +// For NaCl, long NOPs are only valid if they do not cross +// bundle alignment boundaries, so keep it simple with one-byte NOPs. +std::string +Target_i386_nacl::do_code_fill(section_size_type length) const +{ + return std::string(length, static_cast<char>(0x90)); +} + // The selector for i386-nacl object files. class Target_selector_i386_nacl diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 8ddf4f2d9bd..592b587e25e 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -4560,6 +4560,9 @@ class Target_x86_64_nacl : public Target_x86_64<size> plt_count); } + virtual std::string + do_code_fill(section_size_type length) const; + private: static const Target::Target_info x86_64_nacl_info; }; @@ -4784,6 +4787,16 @@ Output_data_plt_x86_64_nacl<size>::plt_eh_frame_fde[plt_eh_frame_fde_size] = elfcpp::DW_CFA_nop }; +// Return a string used to fill a code section with nops. +// For NaCl, long NOPs are only valid if they do not cross +// bundle alignment boundaries, so keep it simple with one-byte NOPs. +template<int size> +std::string +Target_x86_64_nacl<size>::do_code_fill(section_size_type length) const +{ + return std::string(length, static_cast<char>(0x90)); +} + // The selector for x86_64-nacl object files. template<int size> |