This is the mail archive of the
binutils@sourceware.org
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)
On Thu, Jul 13, 2017 at 1:43 PM, Maciej W. Rozycki <macro@imgtec.com> wrote:
> 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.
>
The patch is fine with me.
--
H.J.