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: Tidy bfdio to consistenly use containing archive


On Wed, Jun 13, 2018 at 01:10:57PM +0100, Maciej W. Rozycki wrote:
>  It might be either the removal of what you call 'an "optimization"' or 

Yes, it appears I need to reinstate the bfd_seek optimization.  I'll
run tests overnight and install a patch tomorrow.

This gas code writing 256 bytes at a time is the culprit.

		  n_per_buf = n_per_buf > count ? count : n_per_buf;
		  x = bfd_set_section_contents
		    (stdoutput, sec, buf, (file_ptr) offset,
		     (bfd_size_type) n_per_buf * fill_size);
		  if (!x)
		    as_fatal (ngettext ("can't fill %ld byte "
					"in section %s of %s: '%s'",
					"can't fill %ld bytes "
					"in section %s of %s: '%s'",
					(long) (n_per_buf * fill_size)),
			      (long) (n_per_buf * fill_size),
			      sec->name, stdoutput->filename,
			      bfd_errmsg (bfd_get_error ()));
		  offset += n_per_buf * fill_size;

If the seek isn't optimized away you get lseek, read, lseek, write...

-- 
Alan Modra
Australia Development Lab, IBM


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