Subject: Re: kern/exec_elf.c VS arch/mips/mips/elf.c
To: None <port-pmax@NetBSD.ORG>
From: Christos Zoulas <christos@deshaw.com>
List: port-pmax
Date: 06/14/1996 18:11:49
In article <199606141530.IAA16670@lestat.nas.nasa.gov> Jason Thorpe <thorpej@nas.nasa.gov> writes:
>On Fri, 14 Jun 1996 15:18:44 +0200 (MET DST) 
> Manuel Bouyer <bouyer@ensta.fr> wrote:
>
> > I've a question about elf stuffs in the kernel.
> > I'm running for 2 weeks Per Fogelstrom's shared libraries, and
> > a full set of dynamically linked binaries (including X clients) on
> > my decstation 5000/200 (pmax-port). This required some changes to
> > mips/mips/elf.c. Basically, I took OpenBSD's pica/pica/exec_elf.c, and cp'ed
> > it to mips/mips/elf.c with very fiew changes. This allow my to run old
> > binaries as weel as the new, dynamic binaries. As the system seems really
> > stable now, I'm about to send a PR for this.
>
>Cool ..
>
> > Now the OpenBSD team merged pica/pica/exec_elf.c into kern/exec_elf.c, and
> > removed the first. What should I do ? send a PR for my current changes,
> > or try to use the MI exec_elf.c before sending it to NetBSD ? Note that
> > I can do the first monday, but I may not be able to do the last before
> > a 2 or 3 weeks.
>
>Well, an incremental change is OK, IMO.  Since we already have a MIPS ELF 
>exec module, enchancing it is acceptable, in my book, as long as it can 
>eventually be merged into MI code.

I just merged the OpenBSD kern/exec_elf.c with ours. There is one change
I did not make: changing the entry point address from: 

	*entry = addr + eh.e_entry;
to:
	*entry = addr + eh.e_entry - ph[i].p_vaddr;

because this breaks the linux binaries. Why was that change made in the
OpenBSD sources?

I'd really like to see our elf binaries to have a "NetBSD <version> <date>" 
comment in the .comment elf section, like all other OS's except Linux have.
This will help to differentiate our binaries from other OS's. Can someone
change ld to do that? I offer to write the probe function...

I think that with a little work, you can get the mips port to use the MI
elf code. 

I'll commit the change in a few minutes.

christos