[PATCH] D59478: [ELF] Allow sh_entsize to be not a power of 2

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 20:18:05 PDT 2019


MaskRay created this revision.
MaskRay added a reviewer: ruiu.
Herald added subscribers: llvm-commits, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

This implements Rui Ueyama's idea in https://bugs.llvm.org/show_bug.cgi?id=39044#c3
I've checked that ld.bfd and gold do not have the power-of-2 requirement
and do not require sh_entsize to be a multiple of sh_align.

Now on the updated test merge-entsize.s, all the 3 linkers happily
create .rodata that is not 3-byte aligned.

This has a use case in Linux arch/x86/crypto/sha512-avx2-asm.S
It uses sh_entsize of 640, which is not a power of 2.
See https://github.com/ClangBuiltLinux/linux/issues/417


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D59478

Files:
  ELF/SyntheticSections.cpp
  test/ELF/icf-merged-sections.s
  test/ELF/merge-entsize.s
  test/ELF/merge-gc-piece.s
  test/ELF/merge-reloc-O0.s
  test/ELF/merge-sym.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59478.191052.patch
Type: text/x-patch
Size: 4069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190318/bbeee322/attachment.bin>


More information about the llvm-commits mailing list