Commit 87de633
committed
[LLD][ELF] Include offset when adding Thunk symbols
Include the offset of a thunk in the ThunkSection when adding
symbols.
At Thunk creation time the offset is set to 0 as we don't know
where in the ThunkSection the Thunk will end up. The symbol
values are updated by the setOffset() call in assignOffsets().
When we transform a thunk from a short to a long, we sometimes
add a mapping symbol. At this point the offset of the thunk is
non zero and we need to account for that when defining the
symbol, as the setOffset() call subtracts the offset before
adding the new one back in.
To test; added a second thunk that is converted to a long thunk
to aarch64-thunk-bit-multipass. This second thunk is given a non
zero offset from the start of the Thunk Section so we can observe
the mapping symbol being put in the wrong place without accounting
for the offset.
fixes: #1423261 parent bc14e5e commit 87de633
2 files changed
+23
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
| 605 | + | |
605 | 606 | | |
606 | 607 | | |
607 | 608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| |||
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
| |||
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
91 | 111 | | |
92 | 112 | | |
93 | 113 | | |
| |||
104 | 124 | | |
105 | 125 | | |
106 | 126 | | |
107 | | - | |
| 127 | + | |
108 | 128 | | |
109 | 129 | | |
0 commit comments