[PATCH] D74887: [ELF] Shuffle .init_array/.fini_array with --shuffle-sections=

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 07:35:35 PST 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: lld/test/ELF/shuffle-sections-init-fini.s:11
+# CHECK:      Hex dump of section '.fini_array'
+# CHECK-NEXT: {{....}}ff
+
----------------
grimar wrote:
> I think this tests nothing. If you have the same result with different seeds, it probably means that
> `--shuffle-sections=` does not work as expected.
> 
> What I think can be done to test it:
> Run LLD without `--shuffle-sections` and then check that with this option, the result is just different.
> e.g.:
> 
> ```
> # COMMON:       Hex dump of section '.init_array'
> # WITHOUT-NEXT: ff0100
> # WITH-NOT:     ff0100
> ...
> ```
> 
Random funtion implementations are different across platforms. We may have to create a large number of sections to ensure the result will be different.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74887/new/

https://reviews.llvm.org/D74887





More information about the llvm-commits mailing list