This is the mail archive of the 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: [PATCH] ld: work around pr17618 testcase failure

On Tue, Feb 21, 2017 at 11:41:17AM +0100, Andreas Schwab wrote:
> On Feb 21 2017, "Jan Beulich" <> 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

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

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