[PATCH] [PECOFF] Support linking against DLL.

Sean Silva silvas at purdue.edu
Fri Jul 5 13:29:04 PDT 2013


On Fri, Jul 5, 2013 at 3:57 AM, Rui Ueyama <rui314 at gmail.com> wrote:

>
>   Sean,
>
>   It looks like obj2yaml outputs malformed YAML in the following cases:
>
>    - Section name with special characters: COFF file often contains
> sections like @comp.id or .debug$S. These names should be quoted by "",
> otherwise yaml2obj cannot read them.
>

This seems like an error in YAMLIO's handling of strings. Try adding some
quoting logic to ScalarTraits<StringRef>::output in
lib/Support/YAMLTraits.cpp. (raw_ostream::write_escaped may be useful).


>    - Empty section: If the size of a section is zero, obj2yaml outputs the
> following line, which cannot be parsed by obj2yaml
>
>     SectionData:
>
>   Looks like it needs to be
>
>     SectionData: ""
>

Oops, this looks like a regression when I switched things over to using
BinaryRef. The fix should be to add a special case at the beginning of
BinaryRef::writeAsHex in lib/Object/YAML.cpp; something like:

  if (binary_size() == 0) {
    OS << "\"\"";
    return;
  }

Feel free to commit these changes if they are blocking you. I'll fix them
on Monday if you don't get to them by then.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130705/006a3cd2/attachment.html>


More information about the llvm-commits mailing list