This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: work around pr17618 testcase failure
On Wed, Feb 22, 2017 at 9:15 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 22.02.17 at 17:34, <hjl.tools@gmail.com> wrote:
>> On Wed, Feb 22, 2017 at 12:07 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>>> On 22.02.17 at 05:08, <amodra@gmail.com> wrote:
>>>> 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.
>>>
>>> H.J.,
>>>
>>> you did contribute that test (and then excluded it for x32 targets,
>>> although oddly enough only Linux ones) - any thoughts here?
>>
>> Are you cross compiling binutils to x86-64 from ia32? I never tried
>> it myself and I don't see how it can work in general, given that the
>> address is limited to 32-bit.
>
> I am, and I don't think addresses are limited to 32 bits in that case.
> Everything except this test works fine.
>
I exclude this test for x32 since it will fail, just like on ia32. We can
add a test for 32-bit host and exclude this test for 32-bit hosts, not
just x32.
--
H.J.