aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-20 21:21:24 +0000
committerIan Lance Taylor <iant@google.com>2007-12-20 21:21:24 +0000
commitfe8718a4637d92b3cd991a8f1a22d6d0a09bc6dd (patch)
tree1d8c345aa0b876471ab9e73e4f22c04d65aa61bf /gold
parent1f7efbae406ff9f2e8967d508bfae665501dc8ae (diff)
downloadfsf-binutils-gdb-fe8718a4637d92b3cd991a8f1a22d6d0a09bc6dd.zip
fsf-binutils-gdb-fe8718a4637d92b3cd991a8f1a22d6d0a09bc6dd.tar.gz
fsf-binutils-gdb-fe8718a4637d92b3cd991a8f1a22d6d0a09bc6dd.tar.bz2
Convert more instances of off_t to be 32-bit types.
Diffstat (limited to 'gold')
-rw-r--r--gold/fileread.cc20
-rw-r--r--gold/fileread.h4
-rw-r--r--gold/i386.cc56
-rw-r--r--gold/output.h16
-rw-r--r--gold/reloc.cc6
-rw-r--r--gold/symtab.cc24
-rw-r--r--gold/symtab.h3
-rw-r--r--gold/target-reloc.h7
-rw-r--r--gold/target.h6
-rw-r--r--gold/testsuite/testfile.cc2
-rw-r--r--gold/tls.h7
-rw-r--r--gold/x86_64.cc51
12 files changed, 109 insertions, 93 deletions
diff --git a/gold/fileread.cc b/gold/fileread.cc
index 3050154..31f48a4 100644
--- a/gold/fileread.cc
+++ b/gold/fileread.cc
@@ -206,9 +206,9 @@ File_read::find_view(off_t start, section_size_type size) const
// the buffer at P.
void
-File_read::do_read(off_t start, off_t size, void* p) const
+File_read::do_read(off_t start, section_size_type size, void* p) const
{
- off_t bytes;
+ section_size_type bytes;
if (this->contents_ != NULL)
{
bytes = this->size_ - start;
@@ -220,16 +220,16 @@ File_read::do_read(off_t start, off_t size, void* p) const
}
else
{
- bytes = ::pread(this->descriptor_, p, size, start);
- if (bytes == size)
- return;
-
- if (bytes < 0)
+ ssize_t got = ::pread(this->descriptor_, p, size, start);
+ if (got < 0)
{
gold_fatal(_("%s: pread failed: %s"),
this->filename().c_str(), strerror(errno));
return;
}
+
+ if (static_cast<section_size_type>(got) == size)
+ return;
}
gold_fatal(_("%s: file too short: read only %lld of %lld bytes at %lld"),
@@ -242,7 +242,7 @@ File_read::do_read(off_t start, off_t size, void* p) const
// Read data from the file.
void
-File_read::read(off_t start, off_t size, void* p) const
+File_read::read(off_t start, section_size_type size, void* p) const
{
File_read::View* pv = this->find_view(start, size);
if (pv != NULL)
@@ -286,12 +286,12 @@ File_read::find_or_make_view(off_t start, section_size_type size, bool cache)
// We need to read data from the file. We read full pages for
// greater efficiency on small files.
- off_t psize = File_read::pages(size + (start - poff));
+ section_size_type psize = File_read::pages(size + (start - poff));
if (poff + psize >= this->size_)
{
psize = this->size_ - poff;
- gold_assert(psize >= static_cast<off_t>(size));
+ gold_assert(psize >= size);
}
File_read::View* v;
diff --git a/gold/fileread.h b/gold/fileread.h
index 088a76b..1c47f24 100644
--- a/gold/fileread.h
+++ b/gold/fileread.h
@@ -115,7 +115,7 @@ class File_read
// Read data from the file into the buffer P starting at file offset
// START for SIZE bytes.
void
- read(off_t start, off_t size, void* p) const;
+ read(off_t start, section_size_type size, void* p) const;
// Return a lasting view into the file starting at file offset START
// for SIZE bytes. This is allocated with new, and the caller is
@@ -209,7 +209,7 @@ class File_read
// Read data from the file into a buffer.
void
- do_read(off_t start, off_t size, void* p) const;
+ do_read(off_t start, section_size_type size, void* p) const;
// Find or make a view into the file.
View*
diff --git a/gold/i386.cc b/gold/i386.cc
index 7671910..0858e6d 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -94,11 +94,11 @@ class Target_i386 : public Sized_target<32, false>
bool needs_special_offset_handling,
unsigned char* view,
elfcpp::Elf_types<32>::Elf_Addr view_address,
- off_t view_size);
+ section_size_type view_size);
// Return a string used to fill a code section with nops.
std::string
- do_code_fill(off_t length);
+ do_code_fill(section_size_type length);
// Return whether SYM is defined by the ABI.
bool
@@ -106,7 +106,7 @@ class Target_i386 : public Sized_target<32, false>
{ return strcmp(sym->name(), "___tls_get_addr") == 0; }
// Return the size of the GOT section.
- off_t
+ section_size_type
got_size()
{
gold_assert(this->got_ != NULL);
@@ -176,7 +176,7 @@ class Target_i386 : public Sized_target<32, false>
unsigned int r_type, const Sized_symbol<32>*,
const Symbol_value<32>*,
unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
- off_t);
+ section_size_type);
private:
// Do a TLS relocation.
@@ -185,7 +185,8 @@ class Target_i386 : public Sized_target<32, false>
size_t relnum, const elfcpp::Rel<32, false>&,
unsigned int r_type, const Sized_symbol<32>*,
const Symbol_value<32>*,
- unsigned char*, elfcpp::Elf_types<32>::Elf_Addr, off_t);
+ unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
+ section_size_type);
// Do a TLS General-Dynamic to Initial-Exec transition.
inline void
@@ -194,7 +195,7 @@ class Target_i386 : public Sized_target<32, false>
const elfcpp::Rel<32, false>&, unsigned int r_type,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// Do a TLS General-Dynamic to Local-Exec transition.
inline void
@@ -203,7 +204,7 @@ class Target_i386 : public Sized_target<32, false>
const elfcpp::Rel<32, false>&, unsigned int r_type,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// Do a TLS Local-Dynamic to Local-Exec transition.
inline void
@@ -212,7 +213,7 @@ class Target_i386 : public Sized_target<32, false>
const elfcpp::Rel<32, false>&, unsigned int r_type,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// Do a TLS Initial-Exec to Local-Exec transition.
static inline void
@@ -221,7 +222,7 @@ class Target_i386 : public Sized_target<32, false>
const elfcpp::Rel<32, false>&, unsigned int r_type,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// We need to keep track of which type of local dynamic relocation
// we have seen, so that we can optimize R_386_TLS_LDO_32 correctly.
@@ -473,7 +474,7 @@ Output_data_plt_i386::add_entry(Symbol* gsym)
++this->count_;
- off_t got_offset = this->got_plt_->current_data_size();
+ section_offset_type got_offset = this->got_plt_->current_data_size();
// Every PLT entry needs a GOT entry which points back to the PLT
// entry (this will be changed by the dynamic linker, normally
@@ -542,11 +543,13 @@ void
Output_data_plt_i386::do_write(Output_file* of)
{
const off_t offset = this->offset();
- const off_t oview_size = this->data_size();
+ const section_size_type oview_size =
+ convert_to_section_size_type(this->data_size());
unsigned char* const oview = of->get_output_view(offset, oview_size);
const off_t got_file_offset = this->got_plt_->offset();
- const off_t got_size = this->got_plt_->data_size();
+ const section_size_type got_size =
+ convert_to_section_size_type(this->got_plt_->data_size());
unsigned char* const got_view = of->get_output_view(got_file_offset,
got_size);
@@ -608,8 +611,8 @@ Output_data_plt_i386::do_write(Output_file* of)
elfcpp::Swap<32, false>::writeval(got_pov, plt_address + plt_offset + 6);
}
- gold_assert(pov - oview == oview_size);
- gold_assert(got_pov - got_view == got_size);
+ gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
+ gold_assert(static_cast<section_size_type>(got_pov - got_view) == got_size);
of->write_output_view(offset, oview_size, oview);
of->write_output_view(got_file_offset, got_size, got_view);
@@ -727,9 +730,10 @@ Target_i386::copy_reloc(const General_options* options,
if (align > dynbss->addralign())
dynbss->set_space_alignment(align);
- off_t dynbss_size = dynbss->current_data_size();
+ section_size_type dynbss_size =
+ convert_to_section_size_type(dynbss->current_data_size());
dynbss_size = align_address(dynbss_size, align);
- off_t offset = dynbss_size;
+ section_size_type offset = dynbss_size;
dynbss->set_current_data_size(dynbss_size + symsize);
symtab->define_with_copy_reloc(this, ssym, dynbss, offset);
@@ -1469,7 +1473,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo,
const Symbol_value<32>* psymval,
unsigned char* view,
elfcpp::Elf_types<32>::Elf_Addr address,
- off_t view_size)
+ section_size_type view_size)
{
if (this->skip_call_tls_get_addr_)
{
@@ -1669,7 +1673,7 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo,
const Symbol_value<32>* psymval,
unsigned char* view,
elfcpp::Elf_types<32>::Elf_Addr,
- off_t view_size)
+ section_size_type view_size)
{
Output_segment* tls_segment = relinfo->layout->tls_segment();
@@ -1854,7 +1858,7 @@ Target_i386::Relocate::tls_gd_to_le(const Relocate_info<32, false>* relinfo,
unsigned int,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// leal foo(,%reg,1),%eax; call ___tls_get_addr
// ==> movl %gs:0,%eax; subl $foo@tpoff,%eax
@@ -1885,7 +1889,7 @@ Target_i386::Relocate::tls_gd_to_le(const Relocate_info<32, false>* relinfo,
{
tls::check_tls(relinfo, relnum, rel.get_r_offset(),
(op1 & 0xf8) == 0x80 && (op1 & 7) != 4);
- if (static_cast<off_t>(rel.get_r_offset() + 9) < view_size
+ if (rel.get_r_offset() + 9 < view_size
&& view[9] == 0x90)
{
// There is a trailing nop. Use the size byte subl.
@@ -1918,7 +1922,7 @@ Target_i386::Relocate::tls_gd_to_ie(const Relocate_info<32, false>* relinfo,
unsigned int,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// leal foo(,%ebx,1),%eax; call ___tls_get_addr
// ==> movl %gs:0,%eax; addl foo@gotntpoff(%ebx),%eax
@@ -1951,7 +1955,7 @@ Target_i386::Relocate::tls_gd_to_ie(const Relocate_info<32, false>* relinfo,
{
tls::check_tls(relinfo, relnum, rel.get_r_offset(),
(op1 & 0xf8) == 0x80 && (op1 & 7) != 4);
- if (static_cast<off_t>(rel.get_r_offset() + 9) < view_size
+ if (rel.get_r_offset() + 9 < view_size
&& view[9] == 0x90)
{
// FIXME: This is not the right instruction sequence.
@@ -1986,7 +1990,7 @@ Target_i386::Relocate::tls_ld_to_le(const Relocate_info<32, false>* relinfo,
unsigned int,
elfcpp::Elf_types<32>::Elf_Addr,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// leal foo(%reg), %eax; call ___tls_get_addr
// ==> movl %gs:0,%eax; nop; leal 0(%esi,1),%esi
@@ -2018,7 +2022,7 @@ Target_i386::Relocate::tls_ie_to_le(const Relocate_info<32, false>* relinfo,
unsigned int r_type,
elfcpp::Elf_types<32>::Elf_Addr value,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// We have to actually change the instructions, which means that we
// need to examine the opcodes to figure out which instruction we
@@ -2114,7 +2118,7 @@ Target_i386::relocate_section(const Relocate_info<32, false>* relinfo,
bool needs_special_offset_handling,
unsigned char* view,
elfcpp::Elf_types<32>::Elf_Addr address,
- off_t view_size)
+ section_size_type view_size)
{
gold_assert(sh_type == elfcpp::SHT_REL);
@@ -2147,7 +2151,7 @@ Target_i386::do_dynsym_value(const Symbol* gsym) const
// the specified length.
std::string
-Target_i386::do_code_fill(off_t length)
+Target_i386::do_code_fill(section_size_type length)
{
if (length >= 16)
{
diff --git a/gold/output.h b/gold/output.h
index a244fa5..895d703 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -2291,44 +2291,44 @@ class Output_file
// Write data to the output file.
void
- write(off_t offset, const void* data, off_t len)
+ write(off_t offset, const void* data, size_t len)
{ memcpy(this->base_ + offset, data, len); }
// Get a buffer to use to write to the file, given the offset into
// the file and the size.
unsigned char*
- get_output_view(off_t start, off_t size)
+ get_output_view(off_t start, size_t size)
{
- gold_assert(start >= 0 && size >= 0 && start + size <= this->file_size_);
+ gold_assert(start >= 0 && start + size <= this->file_size_);
return this->base_ + start;
}
// VIEW must have been returned by get_output_view. Write the
// buffer to the file, passing in the offset and the size.
void
- write_output_view(off_t, off_t, unsigned char*)
+ write_output_view(off_t, size_t, unsigned char*)
{ }
// Get a read/write buffer. This is used when we want to write part
// of the file, read it in, and write it again.
unsigned char*
- get_input_output_view(off_t start, off_t size)
+ get_input_output_view(off_t start, size_t size)
{ return this->get_output_view(start, size); }
// Write a read/write buffer back to the file.
void
- write_input_output_view(off_t, off_t, unsigned char*)
+ write_input_output_view(off_t, size_t, unsigned char*)
{ }
// Get a read buffer. This is used when we just want to read part
// of the file back it in.
const unsigned char*
- get_input_view(off_t start, off_t size)
+ get_input_view(off_t start, size_t size)
{ return this->get_output_view(start, size); }
// Release a read bfufer.
void
- free_input_view(off_t, off_t, const unsigned char*)
+ free_input_view(off_t, size_t, const unsigned char*)
{ }
private:
diff --git a/gold/reloc.cc b/gold/reloc.cc
index a91c354..37a9a85 100644
--- a/gold/reloc.cc
+++ b/gold/reloc.cc
@@ -433,16 +433,16 @@ Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
}
off_t view_start;
- off_t view_size;
+ section_size_type view_size;
if (output_offset != -1)
{
view_start = output_section_offset + output_offset;
- view_size = shdr.get_sh_size();
+ view_size = convert_to_section_size_type(shdr.get_sh_size());
}
else
{
view_start = output_section_offset;
- view_size = output_section_size;
+ view_size = convert_to_section_size_type(output_section_size);
}
if (view_size == 0)
diff --git a/gold/symtab.cc b/gold/symtab.cc
index afe47da..d39d739 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1286,9 +1286,11 @@ Symbol_table::define_symbols(const Layout* layout, const Target* target,
template<int size>
void
-Symbol_table::define_with_copy_reloc(const Target* target,
- Sized_symbol<size>* csym,
- Output_data* posd, uint64_t value)
+Symbol_table::define_with_copy_reloc(
+ const Target* target,
+ Sized_symbol<size>* csym,
+ Output_data* posd,
+ typename elfcpp::Elf_types<size>::Elf_Addr value)
{
gold_assert(csym->is_from_dynobj());
gold_assert(!csym->is_copied_from_dynobj());
@@ -2175,17 +2177,21 @@ Symbol_table::add_from_dynobj<64, true>(
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
template
void
-Symbol_table::define_with_copy_reloc<32>(const Target* target,
- Sized_symbol<32>* sym,
- Output_data* posd, uint64_t value);
+Symbol_table::define_with_copy_reloc<32>(
+ const Target* target,
+ Sized_symbol<32>* sym,
+ Output_data* posd,
+ elfcpp::Elf_types<32>::Elf_Addr value);
#endif
#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
template
void
-Symbol_table::define_with_copy_reloc<64>(const Target* target,
- Sized_symbol<64>* sym,
- Output_data* posd, uint64_t value);
+Symbol_table::define_with_copy_reloc<64>(
+ const Target* target,
+ Sized_symbol<64>* sym,
+ Output_data* posd,
+ elfcpp::Elf_types<64>::Elf_Addr value);
#endif
#ifdef HAVE_TARGET_32_LITTLE
diff --git a/gold/symtab.h b/gold/symtab.h
index 9613f2e..786e5cb 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -1028,7 +1028,8 @@ class Symbol_table
template<int size>
void
define_with_copy_reloc(const Target*, Sized_symbol<size>* sym,
- Output_data* posd, uint64_t value);
+ Output_data* posd,
+ typename elfcpp::Elf_types<size>::Elf_Addr);
// Look up a symbol.
Symbol*
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index 7c1d327..7718691 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -148,7 +148,7 @@ relocate_section(
bool needs_special_offset_handling,
unsigned char* view,
typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- off_t view_size)
+ section_size_type view_size)
{
typedef typename Reloc_types<sh_type, size, big_endian>::Reloc Reltype;
const int reloc_size = Reloc_types<sh_type, size, big_endian>::reloc_size;
@@ -161,7 +161,8 @@ relocate_section(
{
Reltype reloc(prelocs);
- off_t offset = reloc.get_r_offset();
+ section_offset_type offset =
+ convert_to_section_size_type(reloc.get_r_offset());
if (needs_special_offset_handling)
{
@@ -205,7 +206,7 @@ relocate_section(
view + offset, view_address + offset, view_size))
continue;
- if (offset < 0 || offset >= view_size)
+ if (offset < 0 || static_cast<section_size_type>(offset) >= view_size)
{
gold_error_at_location(relinfo, i, offset,
_("reloc has bad offset %zu"),
diff --git a/gold/target.h b/gold/target.h
index e385c55..218d9f7 100644
--- a/gold/target.h
+++ b/gold/target.h
@@ -134,7 +134,7 @@ class Target
// basically one or more NOPS which must fill out the specified
// length in bytes.
std::string
- code_fill(off_t length)
+ code_fill(section_size_type length)
{ return this->do_code_fill(length); }
// Return whether SYM is known to be defined by the ABI. This is
@@ -191,7 +191,7 @@ class Target
// Virtual function which must be implemented by the child class if
// needed.
virtual std::string
- do_code_fill(off_t)
+ do_code_fill(section_size_type)
{ gold_unreachable(); }
// Virtual function which may be implemented by the child class.
@@ -279,7 +279,7 @@ class Sized_target : public Target
bool needs_special_offset_handling,
unsigned char* view,
typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- off_t view_size) = 0;
+ section_size_type view_size) = 0;
protected:
Sized_target(const Target::Target_info* pti)
diff --git a/gold/testsuite/testfile.cc b/gold/testsuite/testfile.cc
index 89bad1d..75029ad 100644
--- a/gold/testsuite/testfile.cc
+++ b/gold/testsuite/testfile.cc
@@ -54,7 +54,7 @@ class Target_test : public Sized_target<size, big_endian>
relocate_section(const Relocate_info<size, big_endian>*, unsigned int,
const unsigned char*, size_t, Output_section*, bool,
unsigned char*, typename elfcpp::Elf_types<size>::Elf_Addr,
- off_t)
+ section_size_type)
{ ERROR("call to Target_test::relocate_section"); }
static const Target::Target_info test_target_info;
diff --git a/gold/tls.h b/gold/tls.h
index 7103d3f..ab20e74 100644
--- a/gold/tls.h
+++ b/gold/tls.h
@@ -50,10 +50,11 @@ inline void
check_range(const Relocate_info<size, big_endian>* relinfo,
size_t relnum,
typename elfcpp::Elf_types<size>::Elf_Addr rel_offset,
- off_t view_size, off_t off)
+ section_size_type view_size, int off)
{
- off_t offset = rel_offset + off;
- if (offset < 0 || offset > view_size)
+ typename elfcpp::Elf_types<size>::Elf_Addr offset = rel_offset + off;
+ // Elf_Addr is unsigned, so this also tests for signed offset < 0.
+ if (offset > view_size)
gold_error_at_location(relinfo, relnum, rel_offset,
_("TLS relocation out of range"));
}
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 6df501d..ddd125d 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -107,11 +107,11 @@ class Target_x86_64 : public Sized_target<64, false>
bool needs_special_offset_handling,
unsigned char* view,
elfcpp::Elf_types<64>::Elf_Addr view_address,
- off_t view_size);
+ section_size_type view_size);
// Return a string used to fill a code section with nops.
std::string
- do_code_fill(off_t length);
+ do_code_fill(section_size_type length);
// Return whether SYM is defined by the ABI.
bool
@@ -119,7 +119,7 @@ class Target_x86_64 : public Sized_target<64, false>
{ return strcmp(sym->name(), "__tls_get_addr") == 0; }
// Return the size of the GOT section.
- off_t
+ section_size_type
got_size()
{
gold_assert(this->got_ != NULL);
@@ -181,7 +181,7 @@ class Target_x86_64 : public Sized_target<64, false>
unsigned int r_type, const Sized_symbol<64>*,
const Symbol_value<64>*,
unsigned char*, elfcpp::Elf_types<64>::Elf_Addr,
- off_t);
+ section_size_type);
private:
// Do a TLS relocation.
@@ -190,7 +190,8 @@ class Target_x86_64 : public Sized_target<64, false>
size_t relnum, const elfcpp::Rela<64, false>&,
unsigned int r_type, const Sized_symbol<64>*,
const Symbol_value<64>*,
- unsigned char*, elfcpp::Elf_types<64>::Elf_Addr, off_t);
+ unsigned char*, elfcpp::Elf_types<64>::Elf_Addr,
+ section_size_type);
// Do a TLS General-Dynamic to Local-Exec transition.
inline void
@@ -199,7 +200,7 @@ class Target_x86_64 : public Sized_target<64, false>
const elfcpp::Rela<64, false>&, unsigned int r_type,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// Do a TLS General-Dynamic to Local-Exec transition.
inline void
@@ -208,7 +209,7 @@ class Target_x86_64 : public Sized_target<64, false>
const elfcpp::Rela<64, false>&, unsigned int r_type,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// Do a TLS Local-Dynamic to Local-Exec transition.
inline void
@@ -217,7 +218,7 @@ class Target_x86_64 : public Sized_target<64, false>
const elfcpp::Rela<64, false>&, unsigned int r_type,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// Do a TLS Initial-Exec to Local-Exec transition.
static inline void
@@ -226,7 +227,7 @@ class Target_x86_64 : public Sized_target<64, false>
const elfcpp::Rela<64, false>&, unsigned int r_type,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size);
+ section_size_type view_size);
// This is set if we should skip the next reloc, which should be a
// PLT32 reloc against ___tls_get_addr.
@@ -462,7 +463,7 @@ Output_data_plt_x86_64::add_entry(Symbol* gsym)
++this->count_;
- off_t got_offset = this->got_plt_->current_data_size();
+ section_offset_type got_offset = this->got_plt_->current_data_size();
// Every PLT entry needs a GOT entry which points back to the PLT
// entry (this will be changed by the dynamic linker, normally
@@ -511,11 +512,13 @@ void
Output_data_plt_x86_64::do_write(Output_file* of)
{
const off_t offset = this->offset();
- const off_t oview_size = this->data_size();
+ const section_size_type oview_size =
+ convert_to_section_size_type(this->data_size());
unsigned char* const oview = of->get_output_view(offset, oview_size);
const off_t got_file_offset = this->got_plt_->offset();
- const off_t got_size = this->got_plt_->data_size();
+ const section_size_type got_size =
+ convert_to_section_size_type(this->got_plt_->data_size());
unsigned char* const got_view = of->get_output_view(got_file_offset,
got_size);
@@ -563,8 +566,8 @@ Output_data_plt_x86_64::do_write(Output_file* of)
elfcpp::Swap<64, false>::writeval(got_pov, plt_address + plt_offset + 6);
}
- gold_assert(pov - oview == oview_size);
- gold_assert(got_pov - got_view == got_size);
+ gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
+ gold_assert(static_cast<section_size_type>(got_pov - got_view) == got_size);
of->write_output_view(offset, oview_size, oview);
of->write_output_view(got_file_offset, got_size, got_view);
@@ -683,9 +686,9 @@ Target_x86_64::copy_reloc(const General_options* options,
if (align > dynbss->addralign())
dynbss->set_space_alignment(align);
- off_t dynbss_size = dynbss->current_data_size();
+ section_size_type dynbss_size = dynbss->current_data_size();
dynbss_size = align_address(dynbss_size, align);
- off_t offset = dynbss_size;
+ section_size_type offset = dynbss_size;
dynbss->set_current_data_size(dynbss_size + symsize);
symtab->define_with_copy_reloc(this, ssym, dynbss, offset);
@@ -1358,7 +1361,7 @@ Target_x86_64::Relocate::relocate(const Relocate_info<64, false>* relinfo,
const Symbol_value<64>* psymval,
unsigned char* view,
elfcpp::Elf_types<64>::Elf_Addr address,
- off_t view_size)
+ section_size_type view_size)
{
if (this->skip_call_tls_get_addr_)
{
@@ -1607,7 +1610,7 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
const Symbol_value<64>* psymval,
unsigned char* view,
elfcpp::Elf_types<64>::Elf_Addr address,
- off_t view_size)
+ section_size_type view_size)
{
Output_segment* tls_segment = relinfo->layout->tls_segment();
@@ -1761,7 +1764,7 @@ Target_x86_64::Relocate::tls_gd_to_ie(const Relocate_info<64, false>* relinfo,
unsigned int,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// .byte 0x66; leaq foo@tlsgd(%rip),%rdi;
// .word 0x6666; rex64; call __tls_get_addr
@@ -1796,7 +1799,7 @@ Target_x86_64::Relocate::tls_gd_to_le(const Relocate_info<64, false>* relinfo,
unsigned int,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// .byte 0x66; leaq foo@tlsgd(%rip),%rdi;
// .word 0x6666; rex64; call __tls_get_addr
@@ -1828,7 +1831,7 @@ Target_x86_64::Relocate::tls_ld_to_le(const Relocate_info<64, false>* relinfo,
unsigned int,
elfcpp::Elf_types<64>::Elf_Addr,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// leaq foo@tlsld(%rip),%rdi; call __tls_get_addr@plt;
// ... leq foo@dtpoff(%rax),%reg
@@ -1860,7 +1863,7 @@ Target_x86_64::Relocate::tls_ie_to_le(const Relocate_info<64, false>* relinfo,
unsigned int,
elfcpp::Elf_types<64>::Elf_Addr value,
unsigned char* view,
- off_t view_size)
+ section_size_type view_size)
{
// We need to examine the opcodes to figure out which instruction we
// are looking at.
@@ -1916,7 +1919,7 @@ Target_x86_64::relocate_section(const Relocate_info<64, false>* relinfo,
bool needs_special_offset_handling,
unsigned char* view,
elfcpp::Elf_types<64>::Elf_Addr address,
- off_t view_size)
+ section_size_type view_size)
{
gold_assert(sh_type == elfcpp::SHT_RELA);
@@ -1949,7 +1952,7 @@ Target_x86_64::do_dynsym_value(const Symbol* gsym) const
// the specified length.
std::string
-Target_x86_64::do_code_fill(off_t length)
+Target_x86_64::do_code_fill(section_size_type length)
{
if (length >= 16)
{