Commit 8d4dcc6
[MachO] Preserve weak linkage for aliases (llvm#198148)
Mach-O aliases with weak or linkonce linkage were emitted as weak
references, which is appropriate for undefined references but not for
alias definitions. Emit Mach-O aliases through the same linkage path as
other global definitions so weak aliases get .weak_definition.
When writing aliased symbols, keep the aliasee flags and include the
alias symbol's own flags so N_WEAK_DEF is preserved in the Mach-O n_desc
field.
Fixes llvm#111321
llvm#196047 was closed as a duplicate of llvm#111321.
(cherry picked from commit 29575a3)1 parent bb9934d commit 8d4dcc6
3 files changed
Lines changed: 26 additions & 2 deletions
File tree
- llvm
- lib
- CodeGen/AsmPrinter
- MC
- test/CodeGen/AArch64
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2646 | 2646 | | |
2647 | 2647 | | |
2648 | 2648 | | |
2649 | | - | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
2650 | 2652 | | |
2651 | 2653 | | |
2652 | 2654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
447 | 452 | | |
448 | 453 | | |
449 | 454 | | |
| |||
| 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 | + | |
0 commit comments