[lld] r231316 - PECOFF: Update comments on .drectve section encoding.
Rui Ueyama
ruiu at google.com
Wed Mar 4 15:22:48 PST 2015
Author: ruiu
Date: Wed Mar 4 17:22:48 2015
New Revision: 231316
URL: http://llvm.org/viewvc/llvm-project?rev=231316&view=rev
Log:
PECOFF: Update comments on .drectve section encoding.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=231316&r1=231315&r2=231316&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Wed Mar 4 17:22:48 2015
@@ -1044,12 +1044,10 @@ std::error_code FileCOFF::findSection(St
// Convert ArrayRef<uint8_t> to std::string. The array contains a string which
// may not be terminated by NUL.
StringRef FileCOFF::ArrayRefToString(ArrayRef<uint8_t> array) {
- // Skip the UTF-8 byte marker if exists. The contents of .drectve section
- // is, according to the Microsoft PE/COFF spec, encoded as ANSI or UTF-8
- // with the BOM marker.
- //
- // FIXME: I think "ANSI" in the spec means Windows-1252 encoding, which is a
- // superset of ASCII. We need to convert it to UTF-8.
+ // .drectve sections are encoded in either ASCII or UTF-8 with BOM.
+ // The PE/COFF spec allows ANSI (Windows-1252 encoding), but seems
+ // it's no longer in use.
+ // Skip a UTF-8 byte marker if exists.
if (array.size() >= 3 && array[0] == 0xEF && array[1] == 0xBB &&
array[2] == 0xBF) {
array = array.slice(3);
More information about the llvm-commits
mailing list