Commit 0d781f8
committed
fix: error on R_X86_64_32/32S relocations in shared objects (#2074)
R_X86_64_32 and R_X86_64_32S cannot be used when making a shared
object because the dynamic linker has no way to patch 32-bit absolute
relocations at runtime. Wild was silently emitting R_X86_64_64 instead
of erroring, producing a broken shared object.
Add an early check in apply_relocation to error when these relocation
types are encountered while building a shared object, matching the
behavior of GNU ld and lld.
Also add ExpectErrorWild test directive (analogous to ExpectWarningWild)
to allow testing Wild-specific error messages independently.
Fixes #20741 parent ce74e0b commit 0d781f8
3 files changed
Lines changed: 29 additions & 0 deletions
File tree
- libwild/src
- wild/tests
- sources/elf/pic-required
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2899 | 2899 | | |
2900 | 2900 | | |
2901 | 2901 | | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
2902 | 2912 | | |
2903 | 2913 | | |
2904 | 2914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
1756 | 1758 | | |
1757 | 1759 | | |
1758 | 1760 | | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1759 | 1768 | | |
1760 | 1769 | | |
1761 | 1770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments