From owner-freebsd-arch Tue Dec 19 23: 5:58 2000 From owner-freebsd-arch@FreeBSD.ORG Tue Dec 19 23:05:52 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from palrel1.hp.com (palrel1.hp.com [156.153.255.242]) by hub.freebsd.org (Postfix) with ESMTP id E7C0A37B402 for ; Tue, 19 Dec 2000 23:05:51 -0800 (PST) Received: from adlmail.cup.hp.com (adlmail.cup.hp.com [15.0.100.30]) by palrel1.hp.com (Postfix) with ESMTP id 9A879709 for ; Tue, 19 Dec 2000 23:05:45 -0800 (PST) Received: from cup.hp.com (p1000180.nsr.hp.com [15.109.0.180]) by adlmail.cup.hp.com (8.9.3 (PHNE_18546)/8.9.3 SMKit7.02) with ESMTP id XAA11563 for ; Tue, 19 Dec 2000 23:05:39 -0800 (PST) Sender: marcel@cup.hp.com Message-ID: <3A405A43.5C10697C@cup.hp.com> Date: Tue, 19 Dec 2000 23:05:39 -0800 From: Marcel Moolenaar Organization: Hewlett-Packard X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: arch@FreeBSD.org Subject: gensetdefs using sh(1),sed(1),grep(1) and awk(1) Content-Type: multipart/mixed; boundary="------------7F3A09E70C2BA0794B40E0DC" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------7F3A09E70C2BA0794B40E0DC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Read and weep :-) It takes roughly 11 seconds on a 750 Athlon for this script to process all the object files. Not exactly quick... I think it can do better if we can avoid the "system()" calls... -- Marcel Moolenaar mail: marcel@cup.hp.com / marcel@FreeBSD.org tel: (408) 447-4222 --------------7F3A09E70C2BA0794B40E0DC Content-Type: application/x-sh; name="gensetdefs.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gensetdefs.sh" #!/bin/sh # # Generate setdefs.h # (for obj in $*; do ${OBJDUMP:=objdump} -h $obj | fgrep '.set.' | sed -e 's/2\*\*/1< setdefs.h # # generate setdef0.c # cat < setdef0.c /* THIS FILE IS GENERATED, DO NOT EDIT. */ #define DEFINE_SET(set, count) \\ __asm__(".section .set." #set ",\"aw\""); \\ __asm__(".globl " #set); \\ __asm__(".type " #set ",@object"); \\ __asm__(".p2align 3"); \\ __asm__(#set ":"); \\ __asm__(".quad " #count); \\ __asm__(".previous") #include "setdefs.h" EOF # # generate setdef1.c # cat < setdef1.c /* THIS FILE IS GENERATED, DO NOT EDIT. */ #define DEFINE_SET(set, count) \\ __asm__(".section .set." #set ",\"aw\""); \\ __asm__(".quad 0"); \\ __asm__(".previous") #include "setdefs.h" EOF --------------7F3A09E70C2BA0794B40E0DC-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message