[PATCH] D98445: [ELF] Special case --shuffle-sections=-1 to reverse input sections

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 12 01:40:34 PST 2021


jhenderson added inline comments.


================
Comment at: lld/ELF/Writer.cpp:1305
+  if (seed == UINT32_MAX) {
+    // If --shuffle-sections=-1, reverse sections. The section order is stable
+    // even if the number of sections changes. This is useful to catch issues
----------------



================
Comment at: lld/test/ELF/shuffle-sections.s:30
+## As a special case, -1 reverses sections as a stable transform.
+# RUN: ld.lld --symbol-ordering-file %t_order.txt --shuffle-sections=-1 %t.o -o %t-1.out
+# RUN: llvm-readelf -x .text %t-1.out | FileCheck %s --check-prefix=SHUFFLE3
----------------
Do you need the `--symbol-ordering-file` option here? It seems like it's unrelated to testing whether -1 reverses the section order. If there's an interaction you want to test between the two, perhaps we should have a case with and a case without.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98445



More information about the llvm-commits mailing list