This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: Switch Linux/mips to stabs


"Maciej W. Rozycki" <macro@ds2.pg.gda.pl> writes:

> > Now, if the linker were to not align the loadable part of the ELF
> > image at 0x1000 offset into the file, then D_PAGED would not be set
> > by the ELF backend, but I haven't been able to figure out why it's
> > even doing so, considering I'm using ld -N.
> 
>  I consider it a bug in the ELF backend.  I'll look into it when my time
> permits.  Don't hold your breath, though.

In these lines in assign_file_positions_except_relocs in bfd/elf.c:

	      if ((abfd->flags & D_PAGED) != 0)
		off += (hdr->sh_addr - off) % bed->maxpagesize;
	      else
		off += (hdr->sh_addr - off) % hdr->sh_addralign;

it's not clear to me why we use hdr->sh_addralign when figuring out
the file offset.  I think I wrote that, but I don't remember why.  If
we didn't do that, I expect that Jason's case would work.

Another approach would be to add an option to objcopy to control the
file level flags.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]