bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/26907] objcopy gives memsiz to segment containing empty SH


From: jozef.l at mittosystems dot com
Subject: [Bug binutils/26907] objcopy gives memsiz to segment containing empty SHT_NOBITS section
Date: Tue, 01 Dec 2020 11:17:54 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26907

--- Comment #11 from Jozef Lawrynowicz <jozef.l at mittosystems dot com> ---
(In reply to Jozef Lawrynowicz from comment #10)
> (In reply to Alan Modra from comment #9)
> > I'm not interested in trying to make every weird user script produce the
> > minimum number of load headers, or even to work with objcopy.
> 
> Fair enough, I agree the linker script is weird. A sensible layout that at
> least groups output sections by LMA region averts the objcopy issues and
> reduces the number of segments required.

Correction: there can still be issues if you group by LMA region but
intersperse LMA != VMA section with LMA == VMA sections.

It seems the "most sensible" layout would follow a few principles:
- Primarily group sections with LMA != VMA, which have matching LMA and VMA
regions
- Secondarily group sections by region. VMA region probably makes the most
sense, when considering the execution view of the program, but I don't think it
matters too much in relation to the segment layout.
- Order these groups of output sections by increasing origin address of the
region they are grouped by.

Of course it appears these issues only manifest with empty .bss sections, so it
is a real edge case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]