Commit df71243
committed
MC: Evaluate .org during fragment relaxation
Similar to 742ecfc for MCFillFragment,
ensure `.org` directives with expressions are re-evaluated during
fragment relaxation, as their sizes may change. Continue iteration to
prevent stale, incorrect sizes. While I knew MCOrgFragment likely needed
to be re-evaluated at all, I did not have a motivation to add it;-)
This fixes the root cause of
ClangBuiltLinux/linux#2116
(writeSectionData assertion failure when building the Linux kernel for arm64)
The issue cannot be reliably replicated. The specific test case would
not replicate if any of the following condition was not satisfied:
* .org was not re-evaluated. Fixed by this commit.
* clang -cc1as has a redundant `initSections` call, leading to a
redundant initial FT_Align fragment. llvm-mc -filetype=obj, lacking
the redundant `initSections`, doesn't replicate.
* faa931b decreased sizeof(MCFragment).
* f1aa605 added more fragments1 parent c9684e5 commit df71243
File tree
4 files changed
+16
-2
lines changed- llvm
- include/llvm/MC
- lib/MC
- test/MC/ELF
4 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
391 | | - | |
392 | 393 | | |
| 394 | + | |
| 395 | + | |
393 | 396 | | |
394 | 397 | | |
395 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
948 | 956 | | |
949 | 957 | | |
950 | 958 | | |
| |||
966 | 974 | | |
967 | 975 | | |
968 | 976 | | |
| 977 | + | |
| 978 | + | |
969 | 979 | | |
970 | 980 | | |
971 | 981 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments