Subject: libsa/loadfile* patches
To: None <tech-kern@netbsd.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 02/11/2002 18:22:34
Hiya folks,

i came upon the following patches in my process of building a native 
bootloader for Acorn32 :

Index: sys/lib/libsa/loadfile_aout.c
===================================================================
RCS file: /cvsroot/syssrc/sys/lib/libsa/loadfile_aout.c,v
retrieving revision 1.2
diff -u -p -r1.2 loadfile_aout.c
--- sys/lib/libsa/loadfile_aout.c	2001/10/31 01:51:43	1.2
+++ sys/lib/libsa/loadfile_aout.c	2002/02/11 17:18:59
@@ -110,6 +110,9 @@ loadfile_aout(fd, x, marks, flags)
 	u_long magic = N_GETMAGIC(*x);
 	int sub;
 
+	/* some ports dont use the offset */
+	offset = offset;
+
 	/* In OMAGIC and NMAGIC, exec header isn't part of text segment */
 	if (magic == OMAGIC || magic == NMAGIC)
 		sub = 0;
Index: sys/lib/libsa/loadfile_elf32.c
===================================================================
RCS file: /cvsroot/syssrc/sys/lib/libsa/loadfile_elf32.c,v
retrieving revision 1.6
diff -u -p -r1.6 loadfile_elf32.c
--- sys/lib/libsa/loadfile_elf32.c	2001/11/09 19:27:25	1.6
+++ sys/lib/libsa/loadfile_elf32.c	2002/02/11 17:19:00
@@ -277,6 +277,9 @@ ELFNAMEEND(loadfile)(fd, elf, marks, fla
 	paddr_t minp = ~0, maxp = 0, pos = 0;
 	paddr_t offset = marks[MARK_START], shpp, elfp = NULL;
 
+	/* Some ports dont use the offset */
+	offset = offset;
+
 	internalize_ehdr(elf->e_ident[EI_DATA], elf);
 
 	sz = elf->e_phnum * sizeof(Elf_Phdr);
---------------------------

Is this OK to submit? _OR_ is my Acorn32's loadfile_machdep.h broken and 
should it use the `offset' too ?

Cheers,
Reinoud