From owner-freebsd-ppc@FreeBSD.ORG Tue Jul 15 17:30:07 2003 Return-Path: Delivered-To: freebsd-ppc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAD8237B401 for ; Tue, 15 Jul 2003 17:30:07 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23B2D43FBF for ; Tue, 15 Jul 2003 17:30:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6G0U4Up022337 for ; Tue, 15 Jul 2003 17:30:05 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6G0U4od022336; Tue, 15 Jul 2003 17:30:04 -0700 (PDT) Resent-Date: Tue, 15 Jul 2003 17:30:04 -0700 (PDT) Resent-Message-Id: <200307160030.h6G0U4od022336@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ppc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan Farfeleder Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60A9037B404 for ; Tue, 15 Jul 2003 17:26:14 -0700 (PDT) Received: from fafoe.narf.at (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 544DF43F85 for ; Tue, 15 Jul 2003 17:26:13 -0700 (PDT) (envelope-from stefan@fafoe.dyndns.org) Received: from frog.fafoe.narf.at (frog.fafoe.narf.at [192.168.2.101]) by fafoe.narf.at (Postfix) with ESMTP id F25113FC4; Wed, 16 Jul 2003 02:26:08 +0200 (CEST) Received: by frog.fafoe.narf.at (Postfix, from userid 1001) id B4FE5324; Wed, 16 Jul 2003 02:26:06 +0200 (CEST) Message-Id: <20030716002606.B4FE5324@frog.fafoe.narf.at> Date: Wed, 16 Jul 2003 02:26:06 +0200 (CEST) From: Stefan Farfeleder To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: stefan@fafoe.narf.at Subject: powerpc/54526: [patch] Teach crunchide(1) about PowerPC ELF X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Stefan Farfeleder List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 00:30:08 -0000 >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: