From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Dion Newsgroups: gmane.lisp.guile.user Subject: Embedding stuff in ELF section of compiled module Date: Sat, 09 Nov 2024 10:15:10 -0500 Organization: EfficiOS Message-ID: <8734k0tp4x.fsf@laura> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14009"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Nov 09 17:59:00 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t9onb-0003Rx-3Y for guile-user@m.gmane-mx.org; Sat, 09 Nov 2024 17:58:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9onH-0004je-0b; Sat, 09 Nov 2024 11:58:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9nBL-0005wE-Ux for guile-user@gnu.org; Sat, 09 Nov 2024 10:15:24 -0500 Original-Received: from smtpout.efficios.com ([2607:5300:203:b2ee::31e5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9nBK-0001Kh-50 for guile-user@gnu.org; Sat, 09 Nov 2024 10:15:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1731165316; bh=uzmn7b0z5cceC1cz433p4sOsG6uniHujraOUgHB0rp0=; h=From:To:Subject:Date:From; b=vRtB9u2BP2PrCN3k8aoQwRnV+87elUMsjoCwleu7/gT1m7NJwtRsh4qspE6RLpKES upS423NuEezJJSaFzvO8M2Ylh0+QpSqAVEv2i0xL76+sJZa0zuDMXaXZYPe+qqNZwg fEUkRuUtXlU52gE6fCY4++gwCvZmtRuRMss352H8kj+cBUeE6vb7Ynak6AucPWKsiB Tr3FMhP8Fp/d7Cqi+lBVACHTPAPOsr1jIjBiJLCIqutqMH/9zSb0fP8gKopw8j8Emy 2Jh7YOTr2Xk4WUjSp8aScs6HU9ikySB2I8zQzCf4F8UOd1ManJruJFbYJeLGjdsJJS 4lnKeATZAdauA== Original-Received: from localhost (157-208-8-209.mc.derytele.com [157.208.8.209]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Xlzrh0mpkzRg0 for ; Sat, 9 Nov 2024 10:15:16 -0500 (EST) Received-SPF: pass client-ip=2607:5300:203:b2ee::31e5; envelope-from=odion@efficios.com; helo=smtpout.efficios.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 09 Nov 2024 11:58:36 -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19881 Archived-At: Hi, TLDR; Is there a way to embed a bytevector into a ELF section of a compiled module (.go)? I have a case where I want to generate bytevectors that follow an ABI for event description of static tracepoints. I would like this bytevector to be put into a know ELF section of the compiled module so that external tools can reference it by parsing the ELF file, i.e. without running Guile. I personnaly don't care about none-ELF systems, so I'm fine if this solution is Linux only. I guess this is similar to embedding something else like an audio/image for a video game. So, is there any way for adding section to the compiled ELF, something along like: (embed-bytevector ".my_section" #vu8(bytes ...)) If not, I wonder if this is something that could be appreciated for other users as well? Thanks, Olivier -- Olivier Dion EfficiOS Inc. https://www.efficios.com