[lld] r274729 - Fix endianness issue.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 23:24:29 PDT 2016


>?>>template <class ELFT> void InputSectionBase<ELFT>::uncompress() {

>>>-  typedef typename std::conditional<ELFT::Is64Bits, Elf64_Chdr,
>>>-                                    Elf32_Chdr>::type Elf_Chdr;
?>>So looks it could be just that. Remove of this typedef is enough generally to fix the issue.
>>New code looks better though.
>
>I'm not sure if I understand what you meant, but you have to read Elf_Chdr::ch_size in target's byte order.

Yep.
And I mean that removing of that typename was enough.
With it Elf_Chdr was Elf64_Chdr or Elf32_Chdr which are simple structs with PODs,
but without ELFT::Chdr is used, which is Elf_Chdr_Impl<ELFType<E, Is64>>? and that
was enough to fix that issue I think.

George.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160708/9db4acf7/attachment.html>


More information about the llvm-commits mailing list