This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: VMA section overlap warnings for overlays
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: David Stubbs <stubbs at icerasemi dot com>, binutils at sourceware dot org
- Date: Fri, 27 Aug 2010 18:01:25 -0700
- Subject: Re: VMA section overlap warnings for overlays
- References: <4D60B0700D1DB54A8C0C6E9BE69163700E67DFD1@EXCHANGEVS.IceraSemi.local> <20100421082441.GG3510@bubble.grove.modra.org> <4D60B0700D1DB54A8C0C6E9BE69163700E7815C7@EXCHANGEVS.IceraSemi.local> <20100422011106.GI3510@bubble.grove.modra.org> <20100422015303.GK3510@bubble.grove.modra.org>
On Wed, Apr 21, 2010 at 6:53 PM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Apr 22, 2010 at 10:41:06AM +0930, Alan Modra wrote:
>> Now we have a problem. ?If we put .overlay1 in imem at p_offset+1 then
>> the execution model lma (calculated from p_paddr+p_offset+1) for
>> .overlay1 will be correct, but the vma (from p_vaddr+p_offset+1
>> ie. 0x2001) will be wrong. ?Of course, with multiple overlays packed
>> into one header you can't possibly get the execution model vma correct
>> for all the overlays, so you probably don't care. ?However, the
>> ELF_IS_SECTION_IN_SEGMENT_FILE test in
>> elf.c:assign_file_positions_for_load_sections fails, which is why you
>> get a linker error.
>>
>> Conversely, putting .overlay1 at p_offset+0x2000 will give the correct
>> vma but the wrong lma, and of course insert a whole lot of padding.
>> This is what Jan's patch did, and is quite wrong for overlays..
>
> Committed. ?I didn't see any occurrence of the problem Jan originally
> reported in http://sourceware.org/ml/binutils/2008-05/msg00235.html on
> i386 or powerpc using recent compilers so perhaps some other change
> cured it.
>
> bfd/
> ? ? ? ?* elf.c (assign_file_positions_for_load_sections): Revert 2008-05-29
> ? ? ? ?change. ?Tidy. ?Don't error on sections not allocated in segment.
> ld/testsuite/
> ? ? ? ?* ld-elf/extract-symbol-1sec.d: Update lma.
> ? ? ? ?* ld-i386/alloc.d: Expect a warning, not an error.
>
This patch caused:
http://www.sourceware.org/bugzilla/show_bug.cgi?id=11953
--
H.J.