[PATCH] [FaultMaps] Add a parser for the __llvm__faultmaps section.

Sanjoy Das sanjoy at playingwithpointers.com
Fri Jun 19 11:25:01 PDT 2015


On Thu, Jun 18, 2015 at 9:02 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>>>> Right now the faultmaps section is generated only for x86_64.
>>>
>>> Why the template then?
>>
>> Because the host (the binary reading and parsing the section) could be
>> big-endian?  llvm-objdump built for and running on a BE architecture
>> should be able to parse an __llvm_faultmaps generated on x86.
>>
>> That said, supporting BE is definitely not something I require, and if
>> you think that makes things clearer, I'm happy to just
>> static_assert(host is LE) and drop the templating.
>
> You should support a BE host, but you don't need the templates for
> that. You can just pass endian::litttle to the utility functions.
> Check out lib/Object/COFF*. It is LE only, but works on a BE host.

I see, I think I had misread the code for support::endian::read -- the
endianness passed in is the endianness for the data, and if that
mismatches with the endianness of the host then some byte-swapping is
done.

I'll fix this.

>
> Thanks for updating the test.
>
> Cheers,
> Rafael




More information about the llvm-commits mailing list