[PATCH] D25279: [ELF] - Do not crash on large output.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 13:24:18 PDT 2016


grimar added inline comments.


> rafael wrote in too-large-output-i386.s:3
> Can you create this with yaml2obj?

Nope.
Actually I can, but result binary will be too large.

section-alignment.test creates file with big alignment:

  Sections:
    - Name:            .text
      Type:            SHT_PROGBITS
      Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
      AddressAlign:    0x1000000000000001
      Content:         "00000000"

But that works fine only because AddressAlign is casted to unsigned inside yaml2obj and truncated to 0 finally. So produced binary is little.
But 0xFFFFFFFF value will produce huge binary, what probably not good for testcase.

I noticed this behavior today, not sure how much it is correct.

https://reviews.llvm.org/D25279





More information about the llvm-commits mailing list