diff options
author | Fangrui Song <i@maskray.me> | 2021-03-17 09:32:44 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-03-17 09:32:44 -0700 |
commit | 423cb321dfae8a57f878974ce81730d5ee612f95 (patch) | |
tree | ba95c5ac304b4ace3b97c1dcf0ba96532b0d27f1 /lld/docs | |
parent | 9cf21da776b5e71da46826ba941147495285f106 (diff) | |
download | llvm-423cb321dfae8a57f878974ce81730d5ee612f95.zip llvm-423cb321dfae8a57f878974ce81730d5ee612f95.tar.gz llvm-423cb321dfae8a57f878974ce81730d5ee612f95.tar.bz2 |
[ELF] Special case --shuffle-sections=-1 to reverse input sections
If the number of sections changes, which is common for re-links after
incremental updates, the section order may change drastically.
Special case -1 to reverse input sections. This is a stable transform.
The section order is more resilient to incremental updates. Usually the
code issue (e.g. Static Initialization Order Fiasco, assuming pointer
comparison result of two unrelated objects) is due to the relative order
between two problematic input files A and B. Checking the regular order
and the reversed order is sufficient.
Differential Revision: https://reviews.llvm.org/D98445
Diffstat (limited to 'lld/docs')
-rw-r--r-- | lld/docs/ld.lld.1 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1 index 42525df..3c1704c 100644 --- a/lld/docs/ld.lld.1 +++ b/lld/docs/ld.lld.1 @@ -487,7 +487,8 @@ Set address of section. .It Fl -shared , Fl -Bsharable Build a shared object. .It Fl -shuffle-sections Ns = Ns Ar seed -Shuffle input sections using the given seed. If 0, use a random seed. +Shuffle input sections using the given seed. +If -1, reverse the section order. If 0, use a random seed. .It Fl -soname Ns = Ns Ar value , Fl h Ar value Set .Dv DT_SONAME |