[binutils-owner] Re: RFC: Displaying multibyte symbol names in readelf

suzuki toshiya mpsuzuki@hiroshima-u.ac.jp
Thu May 24 01:02:00 GMT 2012

Excuse me, please let me ask a stupid question.

I guess some people want to receive raw constant data (e.g. hardwired
string data) instead of hexadecimalized constant data, so I believe
there is a requirement of such feature.

But, I'm not sure if the case that the character encoding in ELF binary
and that in current (terminal emulator's) locale are matched is common.
I'm afraid that the mismatched case, like, encoding in binary is UCS2,
UTF-16 or UTF-32 but the locale is UTF-8 would be popular (I'm not saying
it's the most popular case).

According to GCC manual:
           Set the wide execution character set, used for wide string and
           character constants.  The default is UTF-32 or UTF-16, whichever
           corresponds to the width of "wchar_t".  As with -fexec-charset,
           charset can be any encoding supported by the system's "iconv"
           library routine; however, you will have problems with encodings
           that do not fit exactly in "wchar_t".
I'm afraid that the constant wide character string in the binary executable
might be coded by UTF-32 or UTF-16 (I'm not saying it's the most popular case).

If you have already evaluated the proportions of such mismatched cases,
please let me know.


Hans-Peter Nilsson wrote:
> On Wed, 23 May 2012, Nick Clifton wrote:
>>   Does anyone have any objections or questions concerning adding such a
>>   feature ?
> Test-cases, that it works for some common locale (possibly need
> the testing framework to check that it exists, else flag as
> UNTESTED) and as before for the "C" locale?
> brgds, H-P

More information about the Binutils mailing list