[PATCH] D25324: [ELF] - Check that section alignment is a power of 2.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 11:16:15 PDT 2016


ruiu added inline comments.


> InputSection.cpp:50
> +      (Header->sh_addralign && !isPowerOf2_32(Header->sh_addralign)))
> +    fatal(getFilename(File) + ": section sh_addralign is invalid");
>    Alignment = std::max<uintX_t>(Header->sh_addralign, 1);

Technically, an alignment greater than 2^32 is not invalid, so this error message is wrong. Please separate the two conditions and print out different messages

  sh_addralign too large
  sh_addralign is not a power of 2

https://reviews.llvm.org/D25324





More information about the llvm-commits mailing list