Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jul 2003 02:26:06 +0200 (CEST)
From:      Stefan Farfeleder <stefan@fafoe.narf.at>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        stefan@fafoe.narf.at
Subject:   powerpc/54526: [patch] Teach crunchide(1) about PowerPC ELF
Message-ID:  <20030716002606.B4FE5324@frog.fafoe.narf.at>
Resent-Message-ID: <200307160030.h6G0U4od022336@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         54526
>Category:       powerpc
>Synopsis:       [patch] Teach crunchide(1) about PowerPC ELF
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ppc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 15 17:30:04 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Farfeleder
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD frog.fafoe.narf.at 5.1-CURRENT FreeBSD 5.1-CURRENT #21: Sat Jul 12 15:28:48 CEST 2003 freebsd@frog.fafoe.narf.at:/freebsd/frog/obj/freebsd/frog/src/sys/FROG i386


	
>Description:
The file exec_elf32.c currently doesn't know about the PowerPC ELF format,
for that reason a PowerPC buildworld currently fails with:

%%
cc -O -pipe  -c rescue.c
echo "int _crunched_cat_stub(int argc, char **argv, char **envp){return main(argc,argv,envp);}" >cat_stub.c
cc -O -pipe  -c cat_stub.c
ld -dc -r -o cat.lo cat_stub.o /freebsd/ppc-uchar/obj/powerpc/freebsd/ppc-uchar/src/rescue/rescue//freebsd/ppc-uchar/src/bin/cat/cat.o
crunchide -k _crunched_cat_stub cat.lo
cat.lo: unknown executable format
*** Error code 1
%%
	
>How-To-Repeat:
	
>Fix:
All that is needed is to add case EM_PPC to the switch.  For consistency with
the other "exotic" architectures EM_PPC is defined if it isn't already.
	

--- crunchide.diff begins here ---
Index: src/usr.sbin/crunch/crunchide/exec_elf32.c
===================================================================
RCS file: /usr/home/ncvs/src/usr.sbin/crunch/crunchide/exec_elf32.c,v
retrieving revision 1.11
diff -u -r1.11 exec_elf32.c
--- src/usr.sbin/crunch/crunchide/exec_elf32.c	3 Jun 2003 01:37:32 -0000	1.11
+++ src/usr.sbin/crunch/crunchide/exec_elf32.c	15 Jul 2003 23:46:00 -0000
@@ -160,6 +160,10 @@
 #define	EM_IA_64	50
 #endif
 	case EM_IA_64: break;
+#ifndef EM_PPC
+#define	EM_PPC		20
+#endif
+	case EM_PPC: break;
 #ifndef EM_SPARCV9
 #define	EM_SPARCV9	43
 #endif
--- crunchide.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030716002606.B4FE5324>