public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Reini Urban <reini.urban@gmail.com>
Cc: <binutils@sourceware.org>
Subject: Re: Unicode security
Date: Mon, 10 Jan 2022 21:07:33 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2201102049540.408253@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CAHiT=DH=tUOJsyLkysDGTNRBfHva8pJJFhLn6+yoAMdn4VtWbw@mail.gmail.com>

On Mon, 10 Jan 2022, Reini Urban via Binutils wrote:

> So sooner or later some ELF/COFF/bla header field will be needed to state
> the obvious:
> name is UTF-8.

I think that's a matter for the ELF gABI document, where it describes the 
*C binding to ELF* (where it says "External C symbols have the same names 
in C and object files' symbol tables." - which says nothing about 
encoding, since the point of that statement in its historical context was 
probably to imply "no leading underscores added").  That is, ELF symbols 
are arbitrary 0-terminated octet sequences (ELF is not limited to C 
objects, symbols only need to be interpreted when included in diagnostics, 
the assembler and linker should allow you to work with objects with 
arbitrary 0-terminated octet sequences for symbols if you want to, just as 
you can use ASCII characters in ELF symbols that aren't valid in C 
identifiers), but when ELF is used for objects compiled from C, those 
octet sequences for C identifiers with external linkage need to be 
interpreted in a particular way.

Maybe such a change could be proposed on the generic-abi list once Cary's 
public repository is available.

I attempted to get such a statement about UTF-8 encoding of ELF symbols 
for C identifiers with external linkage into the gABI in January 2005, and 
was directed to the ia64-abi@unix-os.sc.intel.com mailing list for that 
purpose.  At that time, the gABI maintainers on that mailing list weren't 
willing to accept such a change, but maybe the current maintainers on the 
current mailing list would be.  If it's still not acceptable for the gABI, 
then an operating-system-specific ABI would be the place to go.

DWARF (version 3 and later) does have DW_AT_use_UTF8.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2022-01-10 21:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 13:31 Reini Urban
2022-01-10 21:07 ` Joseph Myers [this message]
2022-01-10 21:38   ` Paul Koning
2022-01-10 22:13     ` Joseph Myers
2022-01-11  0:41       ` Paul Koning
2022-01-11  0:50         ` Joseph Myers
2022-01-21 16:52           ` Thomas Wolff
2022-01-21 22:22       ` Mike Frysinger
2022-01-21 15:55 ` Nick Clifton

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

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

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2201102049540.408253@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=binutils@sourceware.org \
    --cc=reini.urban@gmail.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).