This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/4007: Linker failed to issue an error on bad section in segment
On Tue, Mar 27, 2007 at 06:30:12AM -0700, H. J. Lu wrote:
> On Tue, Mar 27, 2007 at 06:43:16PM +0930, Alan Modra wrote:
> > On Thu, Mar 22, 2007 at 08:47:41AM -0700, H. J. Lu wrote:
> > > * ld-elf/note-1.d: New file.
> > > * ld-elf/note-1.s: Likewise.
> > > * ld-elf/note-1.t: Likewise.
> >
> > This fails on spu, due to that target rounding up the data segment
> > p_filesz and p_memsz. readelf then thinks that the note is also
> > in the data segment. Do you have any objection to modifying the
> > test as follows?
> >
>
> Isn't it a bug in readelf?
Well, readelf is just using ELF_IS_SECTION_IN_SEGMENT, so you could
argue that the macro has a bug. I though about changing it but
decided I didn't want to risk introducing a problem in BFD. Really,
the spu modification of p_filesz and p_memsz is at fault here, as
it is creating overlapping headers (which won't happen if using the
standard spu linker scripts).
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000080 0x01000000 0x01000000 0x00010 0x00010 RWE 0x80
NOTE 0x000081 0x02000000 0x02000000 0x00001 0x00000 R 0x1
Section to Segment mapping:
Segment Sections...
00 .foo .note
01 .note
> How can I reproduce it?
Build --target=spu-elf and run the ld testsuite.
--
Alan Modra
IBM OzLabs - Linux Technology Centre