This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] PR ld/21529: Use a linker script to limit output with the test case (was: Re: PR21529, internal error in linker.c)
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Alan Modra <amodra at gmail dot com>, Tristan Gingold <gingold at adacore dot com>, Binutils <binutils at sourceware dot org>
- Date: Thu, 13 Jul 2017 21:43:10 +0100
- Subject: Re: [PATCH] PR ld/21529: Use a linker script to limit output with the test case (was: Re: PR21529, internal error in linker.c)
- Authentication-results: sourceware.org; auth=none
- References: <20170605082534.GV8842@bubble.grove.modra.org> <CAMe9rOq9sAeH9h-mzR3Hphmfjr-osYYs90Ds5qjnCQY86BpC6Q@mail.gmail.com> <20170607083948.GY8842@bubble.grove.modra.org> <alpine.DEB.email@example.com> <CAMe9rOq1cMYMhf049NLbm49QC8aSpEeDpvERNtez4CChd83iSw@mail.gmail.com>
On Thu, 13 Jul 2017, H.J. Lu wrote:
> > At least the `rx-elf' failure is not a bug of any kind, but rather
> > resource exhaustion and the dump requested eventually completes. The raw
> > binary produced corresponds to what would be:
> > Elf file type is EXEC (Executable file)
> > Entry point 0x10000004
> > There are 2 program headers, starting at offset 52
> > Program Headers:
> > Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
> > LOAD 0x001000 0x10000000 0x10000000 0x00008 0x00008 R E 0x1000
> > LOAD 0x001ffc 0xbffffffc 0xbffffffc 0x00004 0x00004 RW 0x1000
> > Section to Segment mapping:
> > Segment Sections...
> > 00 .text
> > 01 .stack
> > if linked with the ELF output format. Of course what LD produces with the
> > binary output format is a sparse file:
> > $ stat tmpdir/dump
> > File: `tmpdir/dump'
> > Size: 2952790016 Blocks: 16 IO Block: 65536 regular file
> > [...]
> > $
> Why does rx-elf generate such a big file for a simple program?
See the addresses above in the program header dump. Unlike ELF the raw
binary format cannot express address space gaps other than by padding.
NB depending on the version of the software components involved this
causes `expect' either to hang or to crash with:
Tcl_SetObjLength: negative length requested: -2147483638 (integer overflow?)
Aborted (core dumped)
on my system in the next test case, with the core file produced reaching a
massive 4GiB size. Of course that is a bug in TCL, however I don't think
we need to get it triggered here.