This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: Switch Linux/mips to stabs
- To: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- Subject: Re: Patch: Switch Linux/mips to stabs
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 13 Jun 2001 10:40:19 -0700
- Cc: Jason R Thorpe <thorpej at zembu dot com>, "Aaron J. Grier" <aaron at frye dot com>, binutils at sourceware dot cygnus dot com
- References: <Pine.GSO.3.96.1010613124014.9854E-100000@delta.ds2.pg.gda.pl>
"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