From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: RE: Embedding stuff in ELF section of compiled module Date: Sun, 10 Nov 2024 13:05:38 +0100 Message-ID: <20241110130539.b05f2D0021pRGcz0105fta@laurent.telenet-ops.be> References: <8734k0tp4x.fsf@laura> Reply-To: Maxime Devos Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9286"; mail-complaints-to="usenet@ciao.gmane.io" To: Olivier Dion , "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Nov 10 13:06:29 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 1tA6i4-0002HG-R0 for guile-user@m.gmane-mx.org; Sun, 10 Nov 2024 13:06:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA6he-0000PO-W1; Sun, 10 Nov 2024 07:06:04 -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 1tA6hO-0000OD-Qp for guile-user@gnu.org; Sun, 10 Nov 2024 07:05:48 -0500 Original-Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tA6hM-0002xy-Ic for guile-user@gnu.org; Sun, 10 Nov 2024 07:05:46 -0500 Original-Received: from [IPv6:2a02:1811:8c0e:ef00:5455:b6aa:5262:18f4] ([IPv6:2a02:1811:8c0e:ef00:5455:b6aa:5262:18f4]) by laurent.telenet-ops.be with cmsmtp id b05f2D0021pRGcz0105fta; Sun, 10 Nov 2024 13:05:39 +0100 Importance: normal X-Priority: 3 In-Reply-To: <8734k0tp4x.fsf@laura> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r24; t=1731240339; bh=91PKDodBSIk8++EQqTc49tsyOeCidYbLF6oRHyNjYUA=; h=Message-ID:MIME-Version:To:From:Subject:Date:In-Reply-To: References:Content-Type:From; b=YwAwq0ySz7PM2+UtoVuD4HAMkiuygHPXBwpjnuZxJKhjSGdRocpvRv6NbDxkNqZ3X dXDtE13sK1KVcA8oLdXFBUY64bEtELE4D9jfjzq/TwlRcp+trCamNIXKlIJ4VvLXso oWs4nWdkFx6w5Vf7cJFchhYkHGBaragrFhHAOY3WKS7dTQG3jDRd28mizDIKogChCU K39pXFJoVOXyX1nmkHkPE4P5Ztw88VRUg9DLHyglEPHOANERVNNSMu6Q5XKmqrLPh7 Vu4jfrV0lORCTjIdtUNWVEwI1YpNtHdKhp4IR8/huE5NkSfYlJt6DDDsXo7NDse269 dL6vHNMmKy8ew== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:19887 Archived-At: >TLDR; Is there a way to embed a bytevector into a ELF section of a compiled module (.go)? Yes, all (referenced) bytevectors end up somewhere. But going by the rest, = it needs to be in some section in particular. >So, is there any way for adding section to the compiled ELF, something along like: > (embed-bytevector ".my_section" #vu8(bytes ...)) Except perhaps for external tools (like 'objcopy=E2=80=99 mentioned elsewhe= re), not yet. At least, I think I would remember reading about such a mecha= nism. So, answer is yes: the way to do this is too add support to Guile for this. That said, are you sure it=E2=80=99s a separate section you want? Perhaps a= n entry in the (ELF) symbol table would do as well (and these are already p= opulated, though I don=E2=80=99t recall to what extent). Best regards, Maxime Devos