This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: work around pr17618 testcase failure
- From: Alan Modra <amodra at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Jan Beulich <JBeulich at suse dot com>, binutils at sourceware dot org
- Date: Wed, 22 Feb 2017 14:38:29 +1030
- Subject: Re: [PATCH] ld: work around pr17618 testcase failure
- Authentication-results: sourceware.org; auth=none
- References: <58AC212A020000780013C304@prv-mh.provo.novell.com> <87zihfj06q.fsf@linux-m68k.org>
On Tue, Feb 21, 2017 at 11:41:17AM +0100, Andreas Schwab wrote:
> On Feb 21 2017, "Jan Beulich" <JBeulich@suse.com> wrote:
>
> > Some change from 2.26.1 to 2.27 causes the ld-x86-64/pr17618 test to
> > exhaust memory on a 32-bit host.
>
> Isn't that a bug that should be fixed?
The testcase is stupidly large
$ size tmpdir/pr17618.o
text data bss dec hex filename
2145386275 0 0 2145386275 7fdfff23 tmpdir/pr17618.o
So we will have an almost 2G input buffer for this object file,
and another 2G of output buffer. No hope to link that on a 32 bit
system..
Hmm, this code in elf64-x86-64.c:
/* Get the section contents. */
if (elf_section_data (sec)->this_hdr.contents != NULL)
contents = elf_section_data (sec)->this_hdr.contents;
else if (!bfd_malloc_and_get_section (abfd, sec, &contents))
{
sec->check_relocs_failed = 1;
return FALSE;
}
ought to instead read section contents only when they are needed.
That would help cut down memory usage early in the linking process,
and speed up the linker a little.
--
Alan Modra
Australia Development Lab, IBM