unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: rtl metadata musings
Date: Mon, 20 May 2013 21:28:35 +0200	[thread overview]
Message-ID: <87txlxqwm4.fsf@gnu.org> (raw)
In-Reply-To: <87li79bj4b.fsf@pobox.com> (Andy Wingo's message of "Mon, 20 May 2013 20:29:08 +0200")

Andy Wingo <wingo@pobox.com> skribis:

> On Mon 20 May 2013 18:37, ludo@gnu.org (Ludovic Courtès) writes:
>
>> Andy Wingo <wingo@pobox.com> skribis:
>>
>>> On Sun 19 May 2013 23:52, ludo@gnu.org (Ludovic Courtès) writes:
>>>
>>>> I guess literal strings would go out as per ‘SCM_IMMUTABLE_STRING’
>>>> (which needs relocation), right?
>>>
>>> Yep.  Right now the stringbuf goes into read-only memory, but the string
>>> itself goes in writable memory as it needs its link to the stringbuf
>>> fixed up (relocated) at runtime.
>>
>> OK.  It could be in a PT_GNU_RELRO segment, which the loader (well, the
>> other one, from glibc ;-)) remaps read-only after relocation.
>>
>> [A moment of enlightenment when one realizes what it means to have our
>> own ELF toolchain.  :-)]
>
> Right :) We don't need to rely on the loader, and in fact should not in
> general do so.  Some "relocations" are actually more complicated than
> what glibc does; for example, for symbols or keywords.

Yes.  I meant, there are things Guile’s loader could remap read-only
once the relocations are done, as glibc’s loader does for PT_GNU_RELRO.

>>> (I suppose we should be careful about embedded NUL characters; perhaps
>>> we should use some other format for the string tables.)
>>
>> NULs in string contents should not be a problem, as long as there’s
>> info somewhere about the string length, no?
>
> There isn't -- not in ELF string tables.  They're NUL-terminated.
>
>> UTF-8-encoded ELF symbols may be more of a problem.  How could NULs in
>> symbols be handled?
>
> Well we can just use some other data structure that's not a standard ELF
> string table; since we have the linker and loader and we are defining
> custom sections (.guile.docstrs for example) we can do what we like.

OK.

Ludo’.



  reply	other threads:[~2013-05-20 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10  5:07 rtl metadata musings Andy Wingo
2013-05-11  4:48 ` Mark H Weaver
2013-05-12 21:20   ` Andy Wingo
2013-05-16 21:42 ` Andy Wingo
2013-05-19 21:52 ` Ludovic Courtès
2013-05-20 14:23   ` Andy Wingo
2013-05-20 16:37     ` Ludovic Courtès
2013-05-20 16:48       ` Mike Gran
2013-05-20 18:29       ` Andy Wingo
2013-05-20 19:28         ` Ludovic Courtès [this message]
2013-05-20 20:24           ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txlxqwm4.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).