From 1b6aeedbb8e8f6c65d228f0dab3dab522d2517bb Mon Sep 17 00:00:00 2001 From: Maria Guseva Date: Thu, 3 Apr 2014 11:42:05 +0100 Subject: [PATCH] This fixes a problem building large (> 2Gb) binaries on 32-bit hosts. Using a long type instead of long long meant that bfd_seek (SET) could be called with a negative offset. PR ld/16803 * elf.c (_bfd_elf_set_section_contents): Use correct type to hold file position. --- bfd/ChangeLog | 6 ++++++ bfd/elf.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2e9a9fb60dd..86ac6d7d534 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2014-04-03 Maria Guseva + + PR ld/16803 + * elf.c (_bfd_elf_set_section_contents): Use correct type to hold + file position. + 2014-04-03 Tristan Gingold * mach-o.c (bfd_mach_o_mangle_symbols): Use index from diff --git a/bfd/elf.c b/bfd/elf.c index 9e46f7c7caa..3f377d1e9d0 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -7800,7 +7800,7 @@ _bfd_elf_set_section_contents (bfd *abfd, bfd_size_type count) { Elf_Internal_Shdr *hdr; - bfd_signed_vma pos; + file_ptr pos; if (! abfd->output_has_begun && ! _bfd_elf_compute_section_file_positions (abfd, NULL)) -- 2.30.2