This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pr17512 cause linking failure when cross linking libgfortran on arm-none-linux-gnueabihf


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;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]