// output section. An OUTPUT_OFFSET of -1 means that the bytes are
// discarded.
void
- add_mapping(Relobj* object, unsigned int shndx, off_t offset, off_t length,
- off_t output_offset);
+ add_mapping(Relobj* object, unsigned int shndx,
+ section_offset_type offset, section_size_type length,
+ section_offset_type output_offset);
// Return the output offset for an input address. The input address
// is at offset OFFSET in section SHNDX in OBJECT. This sets
// -1 if the bytes are not being copied to the output. This returns
// true if the mapping is known, false otherwise.
bool
- get_output_offset(const Relobj* object, unsigned int shndx, off_t offset,
- off_t *output_offset) const;
+ get_output_offset(const Relobj* object, unsigned int shndx,
+ section_offset_type offset,
+ section_offset_type *output_offset) const;
};
// A general class for SHF_MERGE data, to hold functions shared by
// Return the output offset for an input offset.
bool
- do_output_offset(const Relobj* object, unsigned int shndx, off_t offset,
- off_t* poutput) const;
+ do_output_offset(const Relobj* object, unsigned int shndx,
+ section_offset_type offset,
+ section_offset_type* poutput) const;
protected:
// Return the entry size.
// Add a mapping from an OFFSET in input section SHNDX in object
// OBJECT to an OUTPUT_OFFSET in the output section.
void
- add_mapping(Relobj* object, unsigned int shndx, off_t offset,
- off_t length, off_t output_offset)
+ add_mapping(Relobj* object, unsigned int shndx, section_offset_type offset,
+ section_size_type length, section_offset_type output_offset)
{
this->merge_map_.add_mapping(object, shndx, offset, length, output_offset);
}
// A key in the hash table. This is an offset in the section
// contents we are building.
- typedef off_t Merge_data_key;
+ typedef section_offset_type Merge_data_key;
// Compute the hash code. To do this we need a pointer back to the
// object holding the data.
const unsigned char*
constant(Merge_data_key k) const
{
- gold_assert(k >= 0 && k < this->len_);
+ gold_assert(k >= 0 && k < static_cast<section_offset_type>(this->len_));
return this->p_ + k;
}
// The accumulated data.
unsigned char* p_;
// The length of the accumulated data.
- off_t len_;
+ section_size_type len_;
// The size of the allocated buffer.
- size_t alc_;
+ section_size_type alc_;
// The hash table.
Merge_data_hashtable hashtable_;
};
// Do all the final processing after the input sections are read in.
// Returns the final data size.
- off_t
+ section_size_type
finalize_merged_data();
// Set the final data size.
// Writes the stringpool to a buffer.
void
- stringpool_to_buffer(unsigned char* buffer, size_t buffer_size)
+ stringpool_to_buffer(unsigned char* buffer, section_size_type buffer_size)
{ this->stringpool_.write_to_buffer(buffer, buffer_size); }
// Clears all the data in the stringpool, to save on memory.
// The input section in the input object.
unsigned int shndx;
// The offset in the input section.
- off_t offset;
+ section_offset_type offset;
// The string itself, a pointer into a Stringpool.
const Char_type* string;
// The length of the string in bytes, including the null terminator.
size_t length;
- Merged_string(Relobj *objecta, unsigned int shndxa, off_t offseta,
- const Char_type* stringa, size_t lengtha)
+ Merged_string(Relobj *objecta, unsigned int shndxa,
+ section_offset_type offseta, const Char_type* stringa,
+ size_t lengtha)
: object(objecta), shndx(shndxa), offset(offseta), string(stringa),
length(lengtha)
{ }