From owner-freebsd-hackers Mon Jan 25 00:47:01 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA12655 for freebsd-hackers-outgoing; Mon, 25 Jan 1999 00:47:01 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mail2.clarityconnect.com (mail2.clarityconnect.com [206.64.143.8]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA12642 for ; Mon, 25 Jan 1999 00:46:55 -0800 (PST) (envelope-from wilson@ensim.com) Received: from ensim.com (209.150.239.146) by mail2.clarityconnect.com with ESMTP (Eudora Internet Mail Server 2.2); Mon, 25 Jan 1999 03:46:47 -0500 Message-ID: <36AC3072.E5EEF339@ensim.com> Date: Mon, 25 Jan 1999 03:50:58 -0500 From: Xun Wilson Huang Organization: Ensim Corp. X-Mailer: Mozilla 4.05 [en] (WinNT; I) MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.ORG Subject: need help with linker_set Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I have been reading codes from the FreeBSD kernel and discover this neat thing "linker_set". As I understand, linker_set allows different modules/subsystems/files to put data into a "set" by inserting an assembly directive .stabs in the c code. At the linking stage, the linker puts all these set elements into an array, and one can write code to enumerate this array of set elements. ( Am I getting this right?) SYSCTL, SYSINIT, DOMAINSET, etc. all use this trick. I tried similar things in user space on FreeBSD and it also works. I have been digging for something similar to this on other platform and sadly, I can't find anything. I am wondering if any BSD guru here can point me to something that leads to a more system independent version of this trick? thanks a million. Xun Wilson Huang To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message