Patch: Switch Linux/mips to stabs
Ian Lance Taylor
ian@zembu.com
Wed Jun 13 10:40:00 GMT 2001
"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
More information about the Binutils
mailing list