diff options
Diffstat (limited to 'gold/target.h')
-rw-r--r-- | gold/target.h | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/gold/target.h b/gold/target.h index ac59fb2..68d89dc 100644 --- a/gold/target.h +++ b/gold/target.h @@ -43,11 +43,13 @@ namespace gold class General_options; class Object; +class Relobj; template<int size, bool big_endian> class Sized_relobj; class Relocatable_relocs; template<int size, bool big_endian> class Relocate_info; +class Reloc_symbol_changes; class Symbol; template<int size> class Sized_symbol; @@ -217,6 +219,22 @@ class Target is_local_label_name(const char* name) const { return this->do_is_local_label_name(name); } + // A function starts at OFFSET in section SHNDX in OBJECT. That + // function was compiled with -fsplit-stack, but it refers to a + // function which was compiled without -fsplit-stack. VIEW is a + // modifiable view of the section; VIEW_SIZE is the size of the + // view. The target has to adjust the function so that it allocates + // enough stack. + void + calls_non_split(Relobj* object, unsigned int shndx, + section_offset_type fnoffset, section_size_type fnsize, + unsigned char* view, section_size_type view_size, + std::string* from, std::string* to) const + { + this->do_calls_non_split(object, shndx, fnoffset, fnsize, view, view_size, + from, to); + } + // Make an ELF object. template<int size, bool big_endian> Object* @@ -244,7 +262,7 @@ class Target return pass < 2; return this->do_relax(pass); - } + } protected: // This struct holds the constant information for a child class. We @@ -331,9 +349,15 @@ class Target virtual bool do_is_local_label_name(const char*) const; + // Virtual function which may be overridden by the child class. + virtual void + do_calls_non_split(Relobj* object, unsigned int, section_offset_type, + section_size_type, unsigned char*, section_size_type, + std::string*, std::string*) const; + // make_elf_object hooks. There are four versions of these for // different address sizes and endianities. - + #ifdef HAVE_TARGET_32_LITTLE // Virtual functions which may be overriden by the child class. virtual Object* @@ -372,6 +396,18 @@ class Target do_relax(int) { return false; } + // A function for targets to call. Return whether BYTES/LEN matches + // VIEW/VIEW_SIZE at OFFSET. + bool + match_view(const unsigned char* view, section_size_type view_size, + section_offset_type offset, const char* bytes, size_t len) const; + + // Set the contents of a VIEW/VIEW_SIZE to nops starting at OFFSET + // for LEN bytes. + void + set_view_to_nop(unsigned char* view, section_size_type view_size, + section_offset_type offset, size_t len) const; + private: // The implementations of the four do_make_elf_object virtual functions are // almost identical except for their sizes and endianity. We use a template. @@ -478,7 +514,8 @@ class Sized_target : public Target bool needs_special_offset_handling, unsigned char* view, typename elfcpp::Elf_types<size>::Elf_Addr view_address, - section_size_type view_size) = 0; + section_size_type view_size, + const Reloc_symbol_changes*) = 0; // Scan the relocs during a relocatable link. The parameters are // like scan_relocs, with an additional Relocatable_relocs |