From 93f8221c643088fab039a4934623f0be0762d777 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 16 Aug 2013 18:12:05 +0000 Subject: 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. --- gold/ChangeLog | 5 +++++ gold/i386.cc | 12 ++++++++++++ gold/x86_64.cc | 13 +++++++++++++ 3 files changed, 30 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index cec8581..08db459 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2013-08-16 Roland McGrath + + * 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-08-07 Cary Coutant Revert support for v2 DWP files: diff --git a/gold/i386.cc b/gold/i386.cc index b2279e7..6dceca5 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -3939,6 +3939,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; }; @@ -4139,6 +4142,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(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 4f4d612..dca6022 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -4572,6 +4572,9 @@ class Target_x86_64_nacl : public Target_x86_64 plt_count); } + virtual std::string + do_code_fill(section_size_type length) const; + private: static const Target::Target_info x86_64_nacl_info; }; @@ -4798,6 +4801,16 @@ Output_data_plt_x86_64_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. +template +std::string +Target_x86_64_nacl::do_code_fill(section_size_type length) const +{ + return std::string(length, static_cast(0x90)); +} + // The selector for x86_64-nacl object files. template -- cgit v1.1