This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: pr17512 cause linking failure when cross linking libgfortran on arm-none-linux-gnueabihf
- From: Nicholas Clifton <nickc at redhat dot com>
- To: Jiong Wang <jiong dot wang at arm dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 04 Nov 2014 15:49:07 +0000
- Subject: Re: pr17512 cause linking failure when cross linking libgfortran on arm-none-linux-gnueabihf
- Authentication-results: sourceware.org; auth=none
- References: <5458AAB8 dot 7050302 at arm dot com> <5458BDBC dot 8080007 at redhat dot com> <5458DB83 dot 9010903 at arm dot com>
Hi Joing,
I am testing out this patch to fix the problem...
Cheers
Nick
diff --git a/bfd/compress.c b/bfd/compress.c
index 083a7df..6831562 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -179,8 +179,9 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
case COMPRESS_SECTION_NONE:
/* PR binutils/17512: Avoid malloc or file reading errors due to
ridiculous section sizes. But ignore linker created objects
- with no contents (yet). */
+ and bfds with no contents (yet). */
if (bfd_get_size (abfd) > 0
+ && (sec->flags & SEC_LINKER_CREATED) == 0
&& sz > (bfd_size_type) bfd_get_size (abfd))
return FALSE;