Commit 3834385
committed
[ELF] Move SHF_LINK_ORDER till OutputSection addresses are known
Sections with the SHF_LINK_ORDER flag must be ordered in the same relative
order as the Sections they have a link to. When using a linker script an
arbitrary expression may be used for the virtual address of the
OutputSection. In some cases the virtual address does not monotonically
increase as the OutputSection index increases, so if we base the ordering
of the SHF_LINK_ORDER sections on the index then we can get the order
wrong. We fix this by moving SHF_LINK_ORDER resolution till after we have
created OutputSection virtual addresses.
Differential Revision: https://reviews.llvm.org/D792861 parent ff4a3ee commit 3834385
2 files changed
+40
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | | - | |
| 1599 | + | |
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
1672 | 1673 | | |
1673 | 1674 | | |
| 1675 | + | |
1674 | 1676 | | |
1675 | 1677 | | |
1676 | 1678 | | |
| |||
2104 | 2106 | | |
2105 | 2107 | | |
2106 | 2108 | | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | 2109 | | |
2114 | 2110 | | |
2115 | 2111 | | |
| |||
2132 | 2128 | | |
2133 | 2129 | | |
2134 | 2130 | | |
| 2131 | + | |
| 2132 | + | |
2135 | 2133 | | |
2136 | 2134 | | |
2137 | 2135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments