diff options
Diffstat (limited to 'gold/object.h')
-rw-r--r-- | gold/object.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gold/object.h b/gold/object.h index 26e85f5..d006856 100644 --- a/gold/object.h +++ b/gold/object.h @@ -2050,6 +2050,31 @@ struct Relocate_info location(size_t relnum, off_t reloffset) const; }; +// This is used to represent a section in an object and is used as the +// key type for various section maps. +typedef std::pair<Object*, unsigned int> Section_id; + +// This is similar to Section_id but is used when the section +// pointers are const. +typedef std::pair<const Object*, unsigned int> Const_section_id; + +// The hash value is based on the address of an object in memory during +// linking. It is okay to use this for looking up sections but never use +// this in an unordered container that we want to traverse in a repeatable +// manner. + +struct Section_id_hash +{ + size_t operator()(const Section_id& loc) const + { return reinterpret_cast<uintptr_t>(loc.first) ^ loc.second; } +}; + +struct Const_section_id_hash +{ + size_t operator()(const Const_section_id& loc) const + { return reinterpret_cast<uintptr_t>(loc.first) ^ loc.second; } +}; + // Return whether INPUT_FILE contains an ELF object start at file // offset OFFSET. This sets *START to point to a view of the start of // the file. It sets *READ_SIZE to the number of bytes in the view. |